├── LICENSE ├── Makefile ├── README.md ├── bin-build ├── MENU.LST ├── Makefile ├── assembler-parser.py ├── bigdisk.img ├── bochsout.txt ├── bochsrc.txt ├── minixdata-old.img ├── minixdata.img ├── module.c ├── module.c.pre ├── module.h ├── module.o ├── start.asm ├── start.o ├── ulix.aux ├── ulix.bin ├── ulix.c ├── ulix.c.bak ├── ulix.c.pre ├── ulix.ce ├── ulix.dump ├── ulix.ld ├── ulix.o ├── ulix.output ├── ulix.s ├── ulix.sym └── ulixboot.img ├── extra └── tutorials.zip ├── lib-build ├── Makefile ├── diskfiles │ ├── ascii.txt │ ├── bin │ │ ├── args │ │ ├── ascii │ │ ├── bindump │ │ ├── cat │ │ ├── chgrp │ │ ├── chmod │ │ ├── chown │ │ ├── clear │ │ ├── cp │ │ ├── df │ │ ├── diff │ │ ├── dumblock │ │ ├── echo │ │ ├── exit42 │ │ ├── fault-div0 │ │ ├── fault-mem │ │ ├── fbomb │ │ ├── filecomm │ │ ├── fork1 │ │ ├── fork2 │ │ ├── fork3 │ │ ├── free │ │ ├── grep │ │ ├── hello │ │ ├── hexdump │ │ ├── init2 │ │ ├── inode │ │ ├── keys │ │ ├── kill │ │ ├── login │ │ ├── ls │ │ ├── memwrite │ │ ├── mkdir │ │ ├── mutex │ │ ├── paging │ │ ├── print │ │ ├── ps │ │ ├── ptree │ │ ├── pw │ │ ├── readelf │ │ ├── recurse │ │ ├── rm │ │ ├── rmdir │ │ ├── sbrk │ │ ├── sbrk1 │ │ ├── sh │ │ ├── sigtest │ │ ├── stat │ │ ├── stdio │ │ ├── su │ │ ├── swapper │ │ ├── sync │ │ ├── testcp │ │ ├── thread │ │ ├── touch │ │ ├── tp │ │ ├── trunc │ │ ├── tt │ │ ├── vi │ │ ├── wc │ │ └── xlogin │ ├── etc │ │ ├── passwd │ │ └── script │ ├── hello.c │ ├── home │ │ └── esser │ │ │ └── testdir │ │ │ ├── 10 │ │ │ ├── 11 │ │ │ ├── 12 │ │ │ ├── 13 │ │ │ ├── 14 │ │ │ ├── 15 │ │ │ ├── 16 │ │ │ ├── 17 │ │ │ ├── 18 │ │ │ ├── 19 │ │ │ ├── 20 │ │ │ ├── 21 │ │ │ ├── 22 │ │ │ ├── 23 │ │ │ ├── 24 │ │ │ ├── 25 │ │ │ ├── 26 │ │ │ ├── 27 │ │ │ ├── 28 │ │ │ ├── 29 │ │ │ ├── 30 │ │ │ ├── 31 │ │ │ ├── 32 │ │ │ ├── 03 │ │ │ ├── 04 │ │ │ ├── 05 │ │ │ ├── 06 │ │ │ ├── 07 │ │ │ ├── 08 │ │ │ └── 09 │ ├── none │ ├── test.txt │ └── usr │ │ └── man │ │ └── kill.1 ├── init ├── init.c ├── init.c.old ├── init.o ├── noweb.sty ├── orig-sh.c ├── process.ld ├── tools │ ├── Makefile │ ├── Makefile.orig │ ├── args │ ├── args.c │ ├── args.dump │ ├── ascii │ ├── ascii.c │ ├── ascii.dump │ ├── bindump │ ├── bindump.c │ ├── bindump.dump │ ├── cat │ ├── cat.c │ ├── cat.dump │ ├── chgrp │ ├── chgrp.c │ ├── chgrp.dump │ ├── chmod │ ├── chmod.c │ ├── chmod.dump │ ├── chown │ ├── chown.c │ ├── chown.dump │ ├── clear │ ├── clear.c │ ├── clear.dump │ ├── cp │ ├── cp.c │ ├── cp.dump │ ├── df │ ├── df.c │ ├── df.dump │ ├── diff │ ├── diff.c │ ├── diff.dump │ ├── dumblock │ ├── dumblock.c │ ├── dumblock.dump │ ├── echo │ ├── echo.c │ ├── echo.dump │ ├── esp-beobachtung.txt │ ├── exit42 │ ├── exit42.c │ ├── exit42.dump │ ├── fault-div0 │ ├── fault-div0.c │ ├── fault-div0.dump │ ├── fault-mem │ ├── fault-mem.c │ ├── fault-mem.dump │ ├── fbomb │ ├── fbomb.c │ ├── fbomb.dump │ ├── filecomm │ ├── filecomm.c │ ├── filecomm.dump │ ├── fork1 │ ├── fork1.c │ ├── fork1.dump │ ├── fork2 │ ├── fork2.c │ ├── fork2.dump │ ├── fork3 │ ├── fork3.c │ ├── fork3.dump │ ├── free │ ├── free.c │ ├── free.dump │ ├── grep │ ├── grep.c │ ├── grep.dump │ ├── hexdump │ ├── hexdump.c │ ├── hexdump.dump │ ├── hexdump.o │ ├── init2 │ ├── init2.c │ ├── init2.dump │ ├── inode │ ├── inode.c │ ├── inode.dump │ ├── keys │ ├── keys.c │ ├── keys.dump │ ├── kill │ ├── kill.c │ ├── kill.dump │ ├── login │ ├── login.GOOD │ ├── login.c │ ├── login.dump │ ├── login.i │ ├── login.o │ ├── login.s │ ├── login.symbols │ ├── ls │ ├── ls.c │ ├── ls.dump │ ├── memwrite │ ├── memwrite.c │ ├── memwrite.dump │ ├── mkdir │ ├── mkdir.c │ ├── mkdir.dump │ ├── mutex │ ├── mutex.c │ ├── mutex.dump │ ├── paging │ ├── paging.c │ ├── paging.dump │ ├── print │ ├── print.c │ ├── print.dump │ ├── process.ld │ ├── process.ld.copy │ ├── ps │ ├── ps.c │ ├── ps.dump │ ├── ptree │ ├── ptree.c │ ├── ptree.dump │ ├── pw │ ├── pw.c │ ├── pw.dump │ ├── readelf │ ├── readelf.c │ ├── readelf.dump │ ├── recurse │ ├── recurse.c │ ├── recurse.dump │ ├── rm │ ├── rm.c │ ├── rm.dump │ ├── rmdir │ ├── rmdir.c │ ├── rmdir.dump │ ├── sbrk │ ├── sbrk.c │ ├── sbrk.dump │ ├── sbrk1 │ ├── sbrk1.c │ ├── sbrk1.dump │ ├── sh │ ├── sh.c │ ├── sh.dump │ ├── sigtest │ ├── sigtest.c │ ├── sigtest.dump │ ├── stat │ ├── stat.c │ ├── stat.dump │ ├── stdio │ ├── stdio.c │ ├── stdio.dump │ ├── su │ ├── su.c │ ├── su.dump │ ├── swapper │ ├── swapper.c │ ├── swapper.dump │ ├── sync │ ├── sync.c │ ├── sync.dump │ ├── testcp │ ├── testcp.c │ ├── testcp.dump │ ├── thread │ ├── thread.c │ ├── thread.dump │ ├── touch │ ├── touch.c │ ├── touch.dump │ ├── tp │ ├── tp.c │ ├── tp.c.orig │ ├── tp.dump │ ├── trunc │ ├── trunc.c │ ├── trunc.dump │ ├── tt │ ├── tt.c │ ├── tt.dump │ ├── vi │ ├── vi.c │ ├── vi.dump │ ├── wc │ ├── wc.c │ ├── wc.dump │ ├── xlogin │ ├── xlogin.c │ └── xlogin.dump ├── ulixlib.c ├── ulixlib.h └── ulixlib.o ├── tex-build ├── Makefile ├── bchart.sty ├── diss.ist ├── filter-uses.py ├── grep-patterns ├── hge-is-alpha.bst ├── noweb.sty ├── pics │ ├── 8259-drawing.pdf │ ├── 8259-drawing2.pdf │ ├── Blue-punch-card-front-horiz.jpg │ ├── Intel-Paging-Descriptors.pdf │ ├── Intel-Paging-Grafik.pdf │ ├── Oxygen480-devices-drive-harddisk.svg │ ├── Process.mm │ ├── Process.pdf │ ├── ULIX-Logo.pdf │ ├── ULIX-Logo2.png │ ├── ULIX-Logo3.png │ ├── a_lq6cty.enc │ ├── address-decoder-logic.pdf │ ├── address-translation-using-page-descriptors.pdf │ ├── address-translation.pdf │ ├── book-spine │ │ ├── buchruecken.pdf │ │ └── buchruecken.ps │ ├── buchruecken.pdf │ ├── buchruecken.ps │ ├── buddy-system-tree.pdf │ ├── burst-distribution-nehmer.dat │ ├── burst-distribution-nehmer.eps │ ├── burst-distribution-nehmer.gpl │ ├── burst-distribution-nehmer.tex │ ├── clock-algorithm.pdf │ ├── code-chunks.pdf │ ├── compaction.pdf │ ├── eax-ax-al.pdf │ ├── fau_logo_dina1_4c.pdf │ ├── fork-tree-structure.graphml │ ├── fork-tree-structure.pdf │ ├── fork-tree-structure.ps │ ├── forking.pdf │ ├── fragmentation-types.pdf │ ├── fs-content.graphml │ ├── fs-content.pdf │ ├── fs-content.png │ ├── fs-unix-NEU.pdf │ ├── fs-unix.graphml │ ├── fs-unix.pdf │ ├── fs-unix.png │ ├── fs-unix.ps │ ├── fs-unix.svg │ ├── fs-windows-NEU.pdf │ ├── fs-windows.graphml │ ├── fs-windows.pdf │ ├── fs-windows.png │ ├── fs-windows.ps │ ├── fs-windows.svg │ ├── gfd-lfd.graphml │ ├── gfd-lfd.pdf │ ├── gfd-lfd.pdf.export │ ├── gfd-lfd.ps │ ├── hat.jpg │ ├── identity-mapping-1.pdf │ ├── identity-mapping-2.pdf │ ├── identity-mapping-3.pdf │ ├── indirection-general-clipped.pdf │ ├── indirection-general.pdf │ ├── indirection-minix-double.pdf │ ├── indirection.pdf │ ├── intentionally-left-blank.png │ ├── irq-stack.pdf │ ├── kernel-stacks.pdf │ ├── kernel-sync.pdf │ ├── keyb-handler-vs-u-kill.pdf │ ├── keyboards │ │ ├── tastatur-deutsch.odg │ │ ├── tastatur-deutsch.pdf │ │ ├── tastatur-scancode-vector.pdf │ │ ├── tastatur-scancode.pdf │ │ ├── tastatur-scancode.png │ │ ├── tastatur-scancode.psd │ │ ├── tastatur-us-vector.pdf │ │ ├── tastatur-us.odg │ │ ├── tastatur-us.pdf │ │ ├── tastatur-us.png │ │ └── tastatur-us.psd │ ├── linked-list-problems.pdf │ ├── linked-list.pdf │ ├── lost-wakeup.pdf │ ├── minix-fs-structure.graphml │ ├── minix-fs-structure.pdf │ ├── minix-fs-structure.pdf.export │ ├── minix-fs-structure.ps │ ├── multi-level-page-table.pdf │ ├── mutexes-2cpu.pdf │ ├── mutexes.pdf │ ├── mx-who-calls-who.graphml │ ├── mx-who-calls-who.pdf │ ├── mx-who-calls-who.ps │ ├── noweb.pdf │ ├── organization-of-process-address-space-multi-stack.pdf │ ├── organization-of-process-address-space.pdf │ ├── page-table-2layers.pdf │ ├── page-table-3layers.pdf │ ├── page-table-intel.pdf │ ├── pages-and-page-frames.pdf │ ├── partitioning-fixed.pdf │ ├── partitioning-flexible.pdf │ ├── processor-hierarchy.pdf │ ├── ready-queue-implementation.pdf │ ├── sched-fcfs.pdf │ ├── sched-priority.pdf │ ├── sched-rr-interaction.pdf │ ├── sched-rr.pdf │ ├── segment-selector.pdf │ ├── segmentation-adder-limitcheck.pdf │ ├── segmentation-adder-only.pdf │ ├── simple-thread-state-model.pdf │ ├── stack-handler-entry-2.pdf │ ├── stack-handler-entry-3.pdf │ ├── stack-handler-entry.pdf │ ├── state-diagram-swapping.pdf │ ├── state-diagram-ulixprocess.pdf │ ├── successful-page-translation.pdf │ ├── symlink-as-file-invert.png │ ├── symlink-as-file.png │ ├── sync-functions.pdf │ ├── sync-hierarchy.pdf │ ├── time-multiplex.pdf │ ├── translation-table.pdf │ ├── tree-structure-of-descriptors.pdf │ ├── ulix-devel.png │ ├── ulix-ex01.png │ ├── ulixos-website.png │ ├── unix-plate │ │ ├── UNIX-Licence-Plate.JPG │ │ ├── titlepage-book.odg │ │ ├── titlepage-book.pdf │ │ ├── unix_plate.jpg │ │ └── unix_plate.psd │ ├── use-of-null-descriptors.pdf │ ├── vfs-open.pdf │ ├── vfs.pdf │ └── weave-and-tangle.pdf ├── ulix-book.bib └── zi4.sty ├── ulix-book.nw └── ulix-book.pdf /Makefile: -------------------------------------------------------------------------------- 1 | all: tools bin 2 | 3 | pdf: ulix-book.nw 4 | make -C tex-build 5 | 6 | bin: ulix-book.nw 7 | make -C bin-build 8 | 9 | run: 10 | make -C bin-build run 11 | 12 | runs: 13 | make -C bin-build runs 14 | 15 | tools: ulix-book.nw 16 | make -C lib-build 17 | 18 | clean: 19 | make -C lib-build clean 20 | make -C bin-build clean 21 | make -C tex-build clean 22 | make -C libtex-build clean 23 | 24 | mkfs: 25 | ssh -p 2222 localhost "/sbin/mkfs.minix -2 bin-build/minixdata.img; sync" 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ulix, the Literate Unix 2 | Ulix (Literate Unix) is a Unix-like operating system that was developed at University of Erlangen-Nuremberg. We used Donald E. Knuth's concept of Literate Programming for the implementation and documentation. The intention was to create a fully working system which can be used in operating system courses to show students how OS concepts (such as paging and scheduling) can be implemented. Literate programs are very accessible because they can be read like a book; the order of presentation is not enforced by program logic or compiler restrictions, but instead is guided by the implementer's creative process. 3 | 4 | Ulix was written in C and Assembler for the Intel x86 architecture; for literate programming we used Norman Ramsey's noweb tool. 5 | 6 | Ulix has already been used twice in operating system courses at TH Nürnberg (Nuremberg Institute of Technology); lecture slides and videos in German language are online (see below). 7 | 8 | Your options are ... 9 | * [Ulix Development Blog](http://hgesser.de/ulix/) 10 | * Ulix Source Code (released under the GPL, version 3, on this GitHub page) 11 | * The [Wiki](https://github.com/hgesser/ulix/wiki) (here on GitHub) 12 | * [The Ulix Book](http://ulixos.org/doc/ulix-book-0.13.pdf) (Hans-Georg Eßer and Felix Freiling: The Design and Implementation of the Ulix Operating System, 708 pages, September 2015) 13 | * [Development VM](https://www.dropbox.com/s/3x3iwzvygecivf6/Ulix-0.13-Debian.ova?dl=1) (OVA format, tested with VirtualBox, Debian-based, 1 GByte, expands to ca. 3 GByte) 14 | * the full list of publications about Ulix (on the [http://ulixos.org/](http://ulixos.org/) page) 15 | * lecture notes of Ulix-based courses (on the [http://ulixos.org/](http://ulixos.org/) page) 16 | 17 | Note: ulix-book.nw is the literate document. 18 | -------------------------------------------------------------------------------- /bin-build/MENU.LST: -------------------------------------------------------------------------------- 1 | timeout 5 2 | 3 | title ULIX-i386 0.10 (c) 2008-2014 F. Freiling, H.-G. Esser 4 | root (fd0) 5 | kernel /ulix.bin 6 | -------------------------------------------------------------------------------- /bin-build/Makefile: -------------------------------------------------------------------------------- 1 | UNAME_S := $(shell uname -s) 2 | 3 | ifeq ($(UNAME_S),Linux) 4 | OS=Linux 5 | LD=ld 6 | CC=/usr/bin/gcc-4.4 7 | OBJDUMP=objdump 8 | CFLAGS=-O0 -m32 -mstackrealign 9 | endif 10 | 11 | ifeq ($(UNAME_S),Darwin) 12 | OS=MacOS 13 | LD=/usr/cross/bin/i586-elf-ld 14 | CC=/usr/cross/bin/i586-elf-gcc 15 | OBJDUMP=/usr/cross/bin/i586-elf-objdump 16 | CFLAGS=-O0 -m32 -march=i586 17 | endif 18 | 19 | BOOT_IMG=ulixboot.img 20 | HDA_IMG=minixdata.img 21 | HDB_IMG=bigdisk.img 22 | FD1_IMG=minixdata-old.img 23 | 24 | ASM=nasm 25 | ASMFLAGS=-f elf 26 | TEXSRC_FILE=../ulix-book.nw 27 | TEXSRC_MODULE_FILE=../bachelorarbeit.nw 28 | EXTRACT_FILES=ulix.c start.asm ulix.ld 29 | # EXTRACT_FILES=ulix.c printf.c start.asm 30 | 31 | all: build 32 | 33 | build: extract parse asm compile linking objdump mtools 34 | 35 | extract: 36 | notangle -L -Rulix.c $(TEXSRC_FILE) > ulix.c; true 37 | sed -i.bak 's/^#line .*/\/\/ old line comment removed/' ulix.c 38 | # notangle -L -Rprintf.c $(TEXSRC_FILE) > printf.c 39 | notangle -Rstart.asm $(TEXSRC_FILE) > start.asm 40 | notangle -Rulix.ld $(TEXSRC_FILE) > ulix.ld 41 | notangle -L -Rmodule.c $(TEXSRC_MODULE_FILE) > module.c 42 | notangle -L -Rmodule.h $(TEXSRC_MODULE_FILE) > module.h 43 | 44 | parse: 45 | mv ulix.c ulix.c.pre 46 | ./assembler-parser.py ulix.c.pre ulix.c 47 | sed -ie "s/SCRIPTBUILDDATE/`date`/" ulix.c 48 | 49 | asm: 50 | mv module.c module.c.pre 51 | ./assembler-parser.py module.c.pre module.c 52 | $(ASM) $(ASMFLAGS) -o start.o start.asm 53 | 54 | compile: 55 | $(CC) $(CFLAGS) -fno-stack-protector -std=c99 -g -nostdlib -nostdinc -fno-builtin -I./include -c -o module.o module.c 56 | $(CC) $(CFLAGS) -fno-stack-protector -std=c99 -g -nostdlib -nostdinc -fno-builtin -I./include -c -o ulix.o -aux-info ulix.aux ulix.c 57 | 58 | linking: 59 | $(LD) $(LDFLAGS) -T ulix.ld -o ulix.bin *.o 60 | 61 | mtools: 62 | mcopy -o -i $(BOOT_IMG) ulix.bin :: 63 | 64 | objdump: 65 | $(OBJDUMP) -M intel -D ulix.bin > ulix.dump 66 | cat ulix.dump | grep -e '^[^ ]* <' | sed -e 's/://' > ulix.sym 67 | 68 | clean: 69 | rm -f ./*.o ./*.c ./*.h ./*.pre ./ulix.bin ./ulix.aux ./ulix.ce 70 | rm -f ./ulix.dump* ./*asm ./*.objdump ./*sym 71 | 72 | run: 73 | qemu -m 64 -rtc base=localtime -boot a -fda $(BOOT_IMG) -fdb $(FD1_IMG) -hda $(HDA_IMG) -hdb $(HDB_IMG) -d cpu_reset -s -serial mon:stdio | tee ulix.output 74 | 75 | runs: 76 | qemu -m 64 -rtc base=localtime -boot a -fda $(BOOT_IMG) -fdb $(FD1_IMG) -hda $(HDA_IMG) -hdb $(HDB_IMG) -d cpu_reset 77 | 78 | nolog: 79 | qemu -m 64 -rtc base=localtime -boot a -fda $(BOOT_IMG) -fdb $(FD1_IMG) -hda $(HDA_IMG) -hdb $(HDB_IMG) -d cpu_reset 80 | 81 | 82 | -------------------------------------------------------------------------------- /bin-build/assembler-parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | This Parser replaces Code of the following form: 5 | 6 | asm { 7 | starta: mov eax, 0x1001 // comment 8 | mov ebx, 'A' // more comment 9 | int 0x80 10 | } 11 | 12 | with code that looks like this: 13 | 14 | asm ("\ 15 | .intel_syntax noprefix; \ 16 | starta: mov eax, 0x1001; \ 17 | mov ebx, 'A'; \ 18 | int 0x80; \ 19 | .att_syntax; \ 20 | "); 21 | 22 | It also understands asm volatile. 23 | 24 | What it cannot cope with is variable / register usage. 25 | 26 | Note that it does not change the number or position 27 | of code lines. 28 | """ 29 | 30 | from sys import argv, exit 31 | 32 | if len(argv)<3: 33 | print ("Error: give input and output filenames") 34 | exit (1) 35 | infilename = argv[1] 36 | outfilename = argv[2] 37 | 38 | 39 | global ReplaceMode 40 | ReplaceMode = False 41 | 42 | def count_leading_blanks (line): 43 | counter = 0 44 | while line and (line[0] == " "): 45 | counter+=1 46 | line = line[1:] 47 | return counter 48 | 49 | def remove_trailing_blanks (line): 50 | if (line == ""): return line 51 | while (line != "") and (line[-1] == " "): 52 | line = line[:-1] 53 | return line 54 | 55 | def transform (line): 56 | global ReplaceMode 57 | if ReplaceMode: 58 | if "}" in line: 59 | # reached the end; skip this line 60 | blanks = count_leading_blanks (line) 61 | line = (blanks+2) * " " + '.att_syntax; ");' 62 | ReplaceMode = False 63 | return line 64 | else: 65 | # do something to the line 66 | if '//' in line: 67 | # remove comment 68 | pos = line.find ("//") 69 | line = line[:pos] 70 | line = remove_trailing_blanks (line) 71 | line = line + "; \\" 72 | return line 73 | 74 | 75 | def process (line): 76 | global ReplaceMode 77 | line = line[:-1] 78 | if ReplaceMode: 79 | # we're already in ReplaceMode, working on assembler 80 | line = transform (line) 81 | else: 82 | # we're in normal C mode, check for asm { 83 | if ("asm volatile{" in line) or ("asm volatile {" in line): 84 | blanks = count_leading_blanks (line) 85 | line = blanks * " " + 'asm volatile (".intel_syntax noprefix; \\' 86 | ReplaceMode = True 87 | elif ("asm{" in line) or ("asm {" in line): 88 | blanks = count_leading_blanks (line) 89 | line = blanks * " " + 'asm (".intel_syntax noprefix; \\' 90 | ReplaceMode = True 91 | 92 | return line 93 | 94 | infile = file (infilename, "r") 95 | outfile = file (outfilename, "w"); 96 | 97 | EndOfLoop = False 98 | 99 | for line in infile: 100 | # line = infile.readline()[:-1] 101 | # if (not line): EndOfLoop = True # end loop 102 | line = process (line) 103 | outfile.write (line+"\n") 104 | 105 | infile.close() 106 | outfile.close() 107 | -------------------------------------------------------------------------------- /bin-build/bigdisk.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/bigdisk.img -------------------------------------------------------------------------------- /bin-build/bochsrc.txt: -------------------------------------------------------------------------------- 1 | megs: 64 2 | romimage: file=/usr/share/bochs/BIOS-bochs-latest 3 | vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest 4 | 5 | 6 | # floppya: 1_44=ulixboot-bochs.img, status=inserted 7 | floppya: 1_44=ulixboot.img, status=inserted 8 | # floppyb: 1_44=ulixdata.img, status=inserted 9 | # floppyb: 1_44=minixdata.img, status=inserted 10 | floppyb: 1_44=minixdata-old.img, status=inserted 11 | 12 | boot: a 13 | 14 | # ata0-master: type=disk, mode=flat, path="testhd.img" 15 | ata0-master: type=disk, mode=flat, path="minixdata.img" 16 | ata0-slave: type=disk, mode=flat, path="bigdisk.img" 17 | 18 | 19 | # load32bitOSImage: os=nullkernel, path=src/kernel, iolog=vga_io.log 20 | 21 | log: bochsout.txt 22 | mouse: enabled=0 23 | clock: sync=realtime 24 | cpu: ips=500000 25 | 26 | #config_interface: wx 27 | #display_library: wx 28 | 29 | display_library: x, options="gui_debug" 30 | 31 | port_e9_hack: enabled=1 32 | 33 | info: action=report 34 | 35 | magic_break: enabled=1 36 | 37 | debug_symbols: file="ulix.sym" 38 | 39 | -------------------------------------------------------------------------------- /bin-build/minixdata-old.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/minixdata-old.img -------------------------------------------------------------------------------- /bin-build/minixdata.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/minixdata.img -------------------------------------------------------------------------------- /bin-build/module.c: -------------------------------------------------------------------------------- 1 | #line 220 "../bachelorarbeit.nw" 2 | /* Code */ 3 | #include "module.h" 4 | 5 | #define DEV_HDA 0x300 // /dev/hda 6 | 7 | extern int mx_open (int device, const char *path, int oflag); 8 | extern int mx_read (int device, int mfd, void *buf, int nbyte); 9 | extern int mx_close (int device, int mfd); 10 | 11 | // char this_buf[128]; 12 | 13 | void initialize_module () { 14 | // printf ("Modul aktiviert.\n"); 15 | 16 | /* Testing... 17 | int fd = mx_open (DEV_HDA, "a.txt", 0); 18 | mx_read (DEV_HDA, fd, this_buf, 128); 19 | this_buf[127] = 0; 20 | printf ("MODULE READING FILE: %s", this_buf); 21 | mx_close (DEV_HDA, fd); 22 | */ 23 | return; 24 | } 25 | -------------------------------------------------------------------------------- /bin-build/module.c.pre: -------------------------------------------------------------------------------- 1 | #line 220 "../bachelorarbeit.nw" 2 | /* Code */ 3 | #include "module.h" 4 | 5 | #define DEV_HDA 0x300 // /dev/hda 6 | 7 | extern int mx_open (int device, const char *path, int oflag); 8 | extern int mx_read (int device, int mfd, void *buf, int nbyte); 9 | extern int mx_close (int device, int mfd); 10 | 11 | // char this_buf[128]; 12 | 13 | void initialize_module () { 14 | // printf ("Modul aktiviert.\n"); 15 | 16 | /* Testing... 17 | int fd = mx_open (DEV_HDA, "a.txt", 0); 18 | mx_read (DEV_HDA, fd, this_buf, 128); 19 | this_buf[127] = 0; 20 | printf ("MODULE READING FILE: %s", this_buf); 21 | mx_close (DEV_HDA, fd); 22 | */ 23 | return; 24 | } 25 | -------------------------------------------------------------------------------- /bin-build/module.h: -------------------------------------------------------------------------------- 1 | #line 246 "../bachelorarbeit.nw" 2 | /* Header-Datei */ 3 | 4 | /* Diese Funktion wird aus der Initialisierung des 5 | Betriebssystems heraus aufgerufen. */ 6 | void initialize_module (); 7 | extern int printf(const char *format, ...); 8 | -------------------------------------------------------------------------------- /bin-build/module.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/module.o -------------------------------------------------------------------------------- /bin-build/start.asm: -------------------------------------------------------------------------------- 1 | [section .setup] 2 | [bits 32] 3 | align 4 4 | mboot: 5 | MB_HEADER_MAGIC equ 0x1BADB002 6 | ; Header flags: page align (bit 0), memory info (bit 1) 7 | MB_HEADER_FLAGS equ 11b ; Bits: 1, 0 8 | MB_CHECKSUM equ -(MB_HEADER_MAGIC + MB_HEADER_FLAGS) 9 | 10 | ; GRUB Multiboot header, boot signature 11 | dd MB_HEADER_MAGIC ; 00..03: magic string 12 | dd MB_HEADER_FLAGS ; 04..07: flags 13 | dd MB_CHECKSUM ; 08..11: checksum 14 | [section .setup] 15 | 16 | trickgdt: dw gdt_end - gdt_data - 1 ; GDT size 17 | dd gdt_data ; linear address of GDT 18 | 19 | gdt_data: dd 0, 0 ; selector 0x00: empty entry 20 | 21 | ; code selector 0x08: 22 | ; base 0x40000000, limit 0xFFFFF, type 10011010, flags 1100 23 | db 0x0F, 0xFF, 0, 0, 0, 10011010b, 11001111b, 0x40 24 | 25 | ; data selector 0x10: 26 | ; base 0x40000000, limit 0xFFFFF, type 10010010, flags 1100 27 | db 0x0F, 0xFF, 0, 0, 0, 10010010b, 11001111b, 0x40 28 | gdt_end: 29 | global start 30 | [section .setup] 31 | start: ; BEGIN higher half trick 32 | lgdt [trickgdt] 33 | mov ax, 0x10 34 | mov ds, ax 35 | mov es, ax 36 | mov fs, ax 37 | mov gs, ax 38 | mov ss, ax 39 | jmp 0x08:higherhalf ; far jump to the higher half kernel 40 | 41 | [section .text] 42 | higherhalf: ; END higher half trick 43 | mov esp, _sys_stack ; set new stack 44 | push esp ; save ESP 45 | push ebx ; address of mboot structure (from GRUB) 46 | 47 | extern main ; C function main() in ulix.c 48 | call main 49 | jmp $ ; infinite loop 50 | global stack_first_address 51 | global stack_last_address 52 | 53 | [section .bss] 54 | stack_first_address: 55 | resb 32*1024 ; reserve 32 KByte for the stack 56 | stack_last_address: 57 | _sys_stack: 58 | [section .text] 59 | extern gp ; defined in the C file 60 | global gdt_flush 61 | gdt_flush: lgdt [gp] 62 | mov ax, 0x10 63 | mov ds, ax 64 | mov es, ax 65 | mov fs, ax 66 | mov gs, ax 67 | mov ss, ax 68 | jmp 0x08:flush2 69 | flush2: ret 70 | global irq0, irq1, irq2, irq3, irq4, irq5, irq6, irq7 71 | global irq8, irq9, irq10, irq11, irq12, irq13, irq14, irq15 72 | 73 | %macro irq_macro 1 74 | push byte 0 ; error code (none) 75 | push byte %1 ; interrupt number 76 | jmp irq_common_stub ; rest is identical for all handlers 77 | %endmacro 78 | 79 | irq0: irq_macro 32 80 | irq1: irq_macro 33 81 | irq2: irq_macro 34 82 | irq3: irq_macro 35 83 | irq4: irq_macro 36 84 | irq5: irq_macro 37 85 | irq6: irq_macro 38 86 | irq7: irq_macro 39 87 | irq8: irq_macro 40 88 | irq9: irq_macro 41 89 | irq10: irq_macro 42 90 | irq11: irq_macro 43 91 | irq12: irq_macro 44 92 | irq13: irq_macro 45 93 | irq14: irq_macro 46 94 | irq15: irq_macro 47 95 | 96 | extern irq_handler ; defined in the C source file 97 | 98 | irq_common_stub: ; this is the identical part 99 | pusha 100 | push ds 101 | push es 102 | push fs 103 | push gs 104 | push esp ; pointer to the context_t 105 | call irq_handler ; call C function 106 | pop esp 107 | pop gs 108 | pop fs 109 | pop es 110 | pop ds 111 | popa 112 | add esp, 8 113 | iret 114 | extern idtp ; defined in the C file 115 | global idt_load 116 | idt_load: lidt [idtp] 117 | ret 118 | global fault0, fault1, fault2, fault3, fault4, fault5, fault6, fault7 119 | global fault8, fault9, fault10, fault11, fault12, fault13, fault14, fault15 120 | global fault16, fault17, fault18, fault19, fault20, fault21, fault22, fault23 121 | global fault24, fault25, fault26, fault27, fault28, fault29, fault30, fault31 122 | %macro fault_macro_0 1 123 | push byte 0 ; error code 124 | push byte %1 125 | jmp fault_common_stub 126 | %endmacro 127 | 128 | 129 | 130 | 131 | %macro fault_macro_no0 1 132 | ; don't push error code 133 | push byte %1 134 | jmp fault_common_stub 135 | %endmacro 136 | fault0: fault_macro_0 0 ; Divide by Zero 137 | fault1: fault_macro_0 1 ; Debug 138 | fault2: fault_macro_0 2 ; Non Maskable Interrupt 139 | fault3: fault_macro_0 3 ; INT 3 140 | fault4: fault_macro_0 4 ; INTO 141 | fault5: fault_macro_0 5 ; Out of Bounds 142 | fault6: fault_macro_0 6 ; Invalid Opcode 143 | fault7: fault_macro_0 7 ; Coprocessor not available 144 | fault8: fault_macro_no0 8 ; Double Fault 145 | fault9: fault_macro_0 9 ; Coprocessor Segment Overrun 146 | fault10: fault_macro_no0 10 ; Bad TSS 147 | fault11: fault_macro_no0 11 ; Segment Not Present 148 | fault12: fault_macro_no0 12 ; Stack Fault 149 | fault13: fault_macro_no0 13 ; General Protection Fault 150 | fault14: fault_macro_no0 14 ; Page Fault 151 | fault15: fault_macro_0 15 ; (reserved) 152 | fault16: fault_macro_0 16 ; Floating Point 153 | fault17: fault_macro_0 17 ; Alignment Check 154 | fault18: fault_macro_0 18 ; Machine Check 155 | fault19: fault_macro_0 19 ; (reserved) 156 | fault20: fault_macro_0 20 ; (reserved) 157 | fault21: fault_macro_0 21 ; (reserved) 158 | fault22: fault_macro_0 22 ; (reserved) 159 | fault23: fault_macro_0 23 ; (reserved) 160 | fault24: fault_macro_0 24 ; (reserved) 161 | fault25: fault_macro_0 25 ; (reserved) 162 | fault26: fault_macro_0 26 ; (reserved) 163 | fault27: fault_macro_0 27 ; (reserved) 164 | fault28: fault_macro_0 28 ; (reserved) 165 | fault29: fault_macro_0 29 ; (reserved) 166 | fault30: fault_macro_0 30 ; (reserved) 167 | fault31: fault_macro_0 31 ; (reserved) 168 | extern fault_handler 169 | fault_common_stub: 170 | pusha 171 | push ds 172 | push es 173 | push fs 174 | push gs 175 | push esp ; pointer to the context_t 176 | call fault_handler ; call C function 177 | pop esp 178 | pop gs 179 | pop fs 180 | pop es 181 | pop ds 182 | popa 183 | add esp, 8 ; for errcode, irq no. 184 | iret 185 | [section .text] 186 | global tss_flush 187 | 188 | tss_flush: mov ax, 0x28 | 0x03 189 | ltr ax ; load the task register 190 | ret 191 | global cpu_usermode 192 | cpu_usermode: cli ; disable interrupts 193 | mov ebp, esp ; remember current stack address 194 | mov ax, 0x20 | 0x03 ; code selector 0x20 | RPL3: 0x03 195 | ; RPL = requested protection level 196 | mov ds, ax 197 | mov es, ax 198 | mov fs, ax 199 | mov gs, ax 200 | mov eax, esp 201 | push 0x20 | 0x03 ; code selector 0x20 | RPL3: 0x03 202 | mov eax, [ebp + 8] ; stack address is 2nd argument 203 | push eax ; stack pointer 204 | pushf ; EFLAGS 205 | pop eax ; trick: reenable interrupts when doing iret 206 | or eax, 0x200 207 | push eax 208 | push 0x18 | 0x03 ; code selector 0x18 | RPL3: 0x03 209 | mov eax, [ebp + 4] ; return address (1st argument) for iret 210 | push eax 211 | iret 212 | [section .text] 213 | extern syscall_handler 214 | global syscallh 215 | 216 | syscallh: push byte 0 ; put 128 on the stack so it looks the same 217 | ; push byte 128 ; as it does after a hardware interrupt 218 | push byte -128 ; (getting rid of nasm error for signed byte) 219 | pusha 220 | push ds 221 | push es 222 | push fs 223 | push gs 224 | push esp ; pointer to the context_t 225 | call syscall_handler 226 | pop esp 227 | pop gs 228 | pop fs 229 | pop es 230 | pop ds 231 | popa 232 | add esp, 8 ; undo the two "push byte" commands from the start_ 233 | iret 234 | global get_eip 235 | 236 | get_eip: pop eax ; top of stack contains return address 237 | push eax ; write it back 238 | ret 239 | -------------------------------------------------------------------------------- /bin-build/start.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/start.o -------------------------------------------------------------------------------- /bin-build/ulix.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/ulix.bin -------------------------------------------------------------------------------- /bin-build/ulix.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-i386") 2 | ENTRY(start) 3 | phys = 0x00100000; 4 | virt = 0xC0000000; 5 | SECTIONS { 6 | . = phys; 7 | 8 | .setup : AT(phys) { *(.setup) } 9 | 10 | . += virt; 11 | 12 | .text : AT(code - virt) { code = .; 13 | *(.text) 14 | *(.rodata*) 15 | . = ALIGN(4096); } 16 | 17 | .data : AT(data - virt) { data = .; 18 | *(.data) 19 | . = ALIGN(4096); } 20 | 21 | .bss : AT(bss - virt) { bss = .; 22 | *(COMMON*) 23 | *(.bss*) 24 | . = ALIGN(4096); } 25 | end = .; } 26 | -------------------------------------------------------------------------------- /bin-build/ulix.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/ulix.o -------------------------------------------------------------------------------- /bin-build/ulix.output: -------------------------------------------------------------------------------- 1 | Kernel page directory set up. 2 | Ulix-i386 0.13 Build: Do 3 Sep 2015 15:41:31 CEST 3 | Current time: 2015/11/03 22:51:27 4 | RAM: 64 MByte, mapped to 0xD0000000-0xD3FFFFFF 5 | VT: Initialized ten terminals (press [Alt-1] to [Alt-0]) 6 | FDC: fd0 (1440 KByte), fd1 (1440 KByte) 7 | ATA: hda (1440 KByte), hdb (100000 KByte) 8 | mount: dev[03:00] = /dev/hda on / type minix (options 0) 9 | mount: dev[02:01] = /dev/fd1 on /mnt/ type minix (options 0) 10 | mount: dev[03:40] = /dev/hdb on /tmp/ type minix (options 0) 11 | mount: none on /dev/ type dev (options 0) 12 | swapon: enabling /tmp/swap (64 MByte) 13 | Starting five shells on tty0..tty4. Press [Ctrl-L] for de/en keyboard. 14 | swapper launched in background. output at console 10 15 | 16 | ulix login: ulix login: ulix login: ulix login: esser 17 | Password: (auto login) 18 | [2.0] swapper: 15159 free frames. threshold = 14684. 19 | ulix login: root 20 | Password: (auto login) 21 | [2.1] swapper: 15134 free frames. threshold = 14684. 22 | esser@ulix[8]:/home/esser$ root@ulix[9]:/root# 23 | esser@ulix[8]:/home/esser$ ls 24 | [2.2] swapper: 15109 free frames. threshold = 14684. 25 | 69 ./ 68 ../ 70 testdir/ 26 | [2.3] swapper: 15134 free frames. threshold = 14684. 27 | esser@ulix[8]:/home/esser$ ls -l 28 | 69 drwxr-xr-x 3 1000 1000 96 15 Aug 2:24 . 29 | 68 drwxr-xr-x 4 1000 1000 128 29 Apr 20:05 .. 30 | 70 drwxr-xr-x 2 1000 1000 1024 15 Aug 2:33 testdir 31 | esser@ulix[8]:/home/esser$ cd / 32 | esser@ulix[8]:/$ +ls -l 33 | Error in execv: /bin/+ls not found 34 | esser@ulix[8]:/$ ls -l 35 | 1 drwxr-xr-x 10 1000 1000 544 15 Aug 2:33 . 36 | 1 drwxr-xr-x 10 1000 1000 544 15 Aug 2:33 .. 37 | 2 -rwxr-xr-x 1 1000 1000 8192 10 Jun 2015 init 38 | 3 -rw------- 1 1000 1000 231 3 Nov 2013 ascii.txt 39 | 4 drwxr-xr-x 2 1000 1000 2016 15 Aug 21:52 bin 40 | 63 drw------- 1 0 0 -1 1 Jan 1970 dev 41 | 64 drwxr-xr-x 2 1000 1000 128 29 Apr 20:05 etc 42 | [2.4] swapper: 15109 free frames. threshold = 14684. 43 | 67 -rw-r--r-- 1 1000 1000 316 2 Nov 2013 hello.c 44 | 68 drwxr-xr-x 4 1000 1000 128 29 Apr 20:05 home 45 | 102 drwxr-xr-x 2 1000 1000 160 17 Aug 13:00 mnt 46 | 103 -r--r--r-- 1 1000 1000 0 29 Apr 10:32 none 47 | 104 drwxr-xr-x 2 1000 1000 96 29 Apr 20:05 root 48 | 105 -rw-r--r-- 1 1000 1000 1680 2 Nov 2013 test.txt 49 | 106 drwxr-xr-x 2 0 0 256 6 Jul 20:10 tmp 50 | 107 drwxr-xr-x 3 1000 1000 96 7 Jun 10:57 usr 51 | 115 -rw-r--r-- 1 1000 100 1680 14 Aug 2015 t2.txt 52 | esser@ulix[8]:/$ [2.5] swapper: 15134 free frames. threshold = 14684. 53 | 54 | esser@ulix[8]:/$ 55 | esser@ulix[8]:/$ clear 56 | [2.6] swapper: 15109 free frames. threshold = 14684. 57 | esser@ulix[8]:/$ [2.7] swapper: 15134 free frames. threshold = 14684. 58 | ps 59 | [2.8] swapper: 15109 free frames. threshold = 14684. 60 | PID PPID UID GID TERM STATE CWD CMD 61 | 1 0 0 0 tty0 READY / [idle] 62 | 2 1 0 0 tty9 W_LCK / [swapper] 63 | 3 1 1000 100 tty0 WAIT4 /home/esser login 64 | 4 1 0 0 tty1 WAIT4 /root login 65 | 5 1 0 0 tty2 W_KEY / login 66 | 6 1 0 0 tty3 W_KEY / login 67 | 7 1 0 0 tty4 W_KEY / login 68 | 8 3 1000 100 tty0 WAIT4 / /bin/sh 69 | 9 4 0 0 tty1 W_KEY /root /bin/sh 70 | 15 8 1000 100 tty0 READY / ps 71 | esser@ulix[8]:/$ [2.9] swapper: 15134 free frames. threshold = 14684. 72 | 73 | esser@ulix[8]:/$ 74 | esser@ulix[8]:/$ -------------------------------------------------------------------------------- /bin-build/ulixboot.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/bin-build/ulixboot.img -------------------------------------------------------------------------------- /extra/tutorials.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/extra/tutorials.zip -------------------------------------------------------------------------------- /lib-build/Makefile: -------------------------------------------------------------------------------- 1 | UNAME_S := $(shell uname -s) 2 | 3 | ifeq ($(UNAME_S),Linux) 4 | OS=Linux 5 | LD=ld 6 | CC=/usr/bin/gcc-4.4 7 | OBJDUMP=objdump 8 | endif 9 | 10 | ifeq ($(UNAME_S),Darwin) 11 | OS=MacOS 12 | LD=/usr/cross/bin/i586-elf-ld 13 | CC=/usr/cross/bin/i586-elf-gcc 14 | OBJDUMP=/usr/cross/bin/i586-elf-objdump 15 | endif 16 | 17 | NOWEBFILE=../ulix-book.nw 18 | 19 | CCOPTIONS=-nostdlib -ffreestanding -fforce-addr -fomit-frame-pointer -fno-function-cse -nostartfiles -mtune=i386 -momit-leaf-frame-pointer -O0 20 | CCASMOPTIONS=-fverbose-asm -masm=intel 21 | LDOPTIONS=-static -s 22 | 23 | all: build 24 | 25 | build: extract compile image 26 | 27 | extract: 28 | notangle -L -Rulixlib.c < $(NOWEBFILE) > ulixlib.c ; true 29 | notangle -L -Rulixlib.h < $(NOWEBFILE) > ulixlib.h ; true 30 | 31 | compile: 32 | $(CC) $(CCOPTIONS) -g $(CCTESTOPTIONS) -c ulixlib.c 33 | $(CC) $(CCOPTIONS) $(CCTESTOPTIONS) -c init.c 34 | # link it with linker script "process.ld" 35 | $(LD) $(LDOPTIONS) -T process.ld -o init init.o ulixlib.o 36 | touch tools/*.c 37 | make -C tools 38 | 39 | image: 40 | ifeq ($(OS),Linux) 41 | sudo mount -o loop ../bin-build/minixdata.img ../mountpoint 42 | cp init ../mountpoint/ 43 | sudo umount ../mountpoint 44 | endif 45 | ifeq ($(OS),MacOS) 46 | ssh -p 2222 localhost "cp ~/ulix/bin-build/minixdata.img /tmp/; mount /mnt/minix; sudo cp -a ~esser/ulix/lib-build/init /mnt/minix/; sync; sudo cp -rp ~esser/ulix/lib-build/diskfiles/* /mnt/minix/; umount /mnt/minix; sync; cp /tmp/minixdata.img ~/ulix/bin-build/; sync" 47 | endif 48 | 49 | clean-image: 50 | ssh -p 2222 localhost "dd if=/dev/zero of=/tmp/minixdata.img bs=1k count=1440; /sbin/mkfs.minix -2 /tmp/minixdata.img; mount /mnt/minix; cp ~/ulix/lib-build/init /mnt/minix/; sync; sudo cp -rp ~/ulix/lib-build/diskfiles/* /mnt/minix/; umount /mnt/minix; sync; cp /tmp/minixdata.img ~/ulix/bin-build/; sync" 51 | 52 | 53 | tex: 54 | echo Making PDF file 55 | noweave -autodefs c -latex -index -delay $(NOWEBFILE) > ulixlib.tex 56 | pdflatex ulixlib.tex 57 | makeindex ulixlib 58 | pdflatex ulixlib.tex 59 | 60 | clean: 61 | rm -f ./*.o 62 | 63 | -------------------------------------------------------------------------------- /lib-build/diskfiles/ascii.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/ascii.txt -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/args -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/ascii: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/ascii -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/bindump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/bindump -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/cat -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/chgrp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/chgrp -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/chmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/chmod -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/chown: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/chown -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/clear: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/clear -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/cp -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/df: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/df -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/diff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/diff -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/dumblock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/dumblock -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/echo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/echo -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/exit42: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/exit42 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fault-div0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fault-div0 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fault-mem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fault-mem -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fbomb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fbomb -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/filecomm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/filecomm -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fork1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fork1 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fork2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fork2 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/fork3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/fork3 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/free: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/free -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/grep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/grep -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/hello -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/hexdump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/hexdump -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/init2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/init2 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/inode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/inode -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/keys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/keys -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/kill -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/login: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/login -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/ls -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/memwrite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/memwrite -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/mkdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/mkdir -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/mutex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/mutex -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/paging: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/paging -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/print: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/print -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/ps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/ps -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/ptree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/ptree -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/pw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/pw -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/readelf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/readelf -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/recurse: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/recurse -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/rm -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/rmdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/rmdir -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/sbrk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/sbrk -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/sbrk1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/sbrk1 -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/sh -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/sigtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/sigtest -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/stat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/stat -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/stdio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/stdio -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/su: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/su -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/swapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/swapper -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/sync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/sync -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/testcp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/testcp -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/thread -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/touch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/touch -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/tp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/tp -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/trunc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/trunc -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/tt -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/vi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/vi -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/wc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/wc -------------------------------------------------------------------------------- /lib-build/diskfiles/bin/xlogin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/bin/xlogin -------------------------------------------------------------------------------- /lib-build/diskfiles/etc/passwd: -------------------------------------------------------------------------------- 1 | root:xyz:0:0:/root 2 | esser:xyz:1000:100:/home/esser 3 | freiling:xyz:1001:100:/home/freiling 4 | 5 | -------------------------------------------------------------------------------- /lib-build/diskfiles/etc/script: -------------------------------------------------------------------------------- 1 | ls 2 | df 3 | ps 4 | 5 | -------------------------------------------------------------------------------- /lib-build/diskfiles/hello.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | int i; 5 | for (i=0;i<5;i++) 6 | printf ("Hello World\n"); 7 | /* 8 | printf ("argc = %d\n", argc); 9 | printf ("&argc= %x\n", &argc); 10 | printf ("argv = %x\n", argv); 11 | // printf ("argv = '%s'\n", argv); 12 | */ 13 | printf ("getpid = %d\n", getpid()); 14 | exit(0); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/03 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/04 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/05 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/06 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/07 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/08: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/08 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/09: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/09 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/10 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/11 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/12 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/13 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/14 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/15 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/16 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/17: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/17 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/18: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/18 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/19: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/19 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/20 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/21 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/22 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/23: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/23 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/24: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/24 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/25: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/25 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/26: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/26 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/27: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/27 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/28: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/28 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/29: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/29 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/30: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/30 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/31: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/31 -------------------------------------------------------------------------------- /lib-build/diskfiles/home/esser/testdir/32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/home/esser/testdir/32 -------------------------------------------------------------------------------- /lib-build/diskfiles/none: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/diskfiles/none -------------------------------------------------------------------------------- /lib-build/diskfiles/test.txt: -------------------------------------------------------------------------------- 1 | 01 1111111222222222211111111112222222222111111111122222222221111111111222222222 2 | 02 1111111222222222211111111112222222222111111111122222222221111111111222222222 3 | 03 1111111222222222211111111112222222222111111111122222222221111111111222222222 4 | 04 1111111222222222211111111112222222222111111111122222222221111111111222222222 5 | 05 1111111222222222211111111112222222222111111111122222222221111111111222222222 6 | 06 1111111222222222211111111112222222222111111111122222222221111111111222222222 7 | 07 1111111222222222211111111112222222222111111111122222222221111111111222222222 8 | 08 1111111222222222211111111112222222222111111111122222222221111111111222222222 9 | 09 1111111222222222211111111112222222222111111111122222222221111111111222222222 10 | 10 1111111222222222211111111112222222222111111111122222222221111111111222222222 11 | 11 1111111222222222211111111112222222222111111111122222222221111111111222222222 12 | 12 1111111222222222211111111112222222222111111111122222222221111111111222222222 13 | 13 1111111222222222211111111112222222222111111111122222222221111111111222222222 14 | 14 1111111222222222211111111112222222222111111111122222222221111111111222222222 15 | 15 1111111222222222211111111112222222222111111111122222222221111111111222222222 16 | 16 1111111222222222211111111112222222222111111111122222222221111111111222222222 17 | 17 1111111222222222211111111112222222222111111111122222222221111111111222222222 18 | 18 1111111222222222211111111112222222222111111111122222222221111111111222222222 19 | 19 1111111222222222211111111112222222222111111111122222222221111111111222222222 20 | 20 1111111222222222211111111112222222222111111111122222222221111111111222222222 21 | 21 1111111222222222211111111112222222222111111111122222222221111111111222222222 22 | -------------------------------------------------------------------------------- /lib-build/diskfiles/usr/man/kill.1: -------------------------------------------------------------------------------- 1 | KILL(1) ULIX General Commands Manual KILL(1) 2 | 3 | NAME 4 | kill -- terminate or signal a process 5 | 6 | SYNOPSIS 7 | kill [-signal_number] pid 8 | 9 | DESCRIPTION 10 | The kill utility sends a signal to the process specified by the pid op- 11 | erand(s). Only the super-user may send signals to other users' proces- 12 | ses. The options are as follows: 13 | 14 | -signal_number 15 | A non-negative decimal integer, specifying the signal to be sent 16 | instead of the default TERM. 17 | 18 | Some of the more commonly used signals: 19 | 9 KILL (non-catchable, non-ignorable kill) 20 | 15 TERM (software termination signal) 21 | 22 | NOTES 23 | This is a shortened version of the kill manpage from Mac OS X. 24 | 25 | ULIX June 7, 2014 ULIX 26 | -------------------------------------------------------------------------------- /lib-build/init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/init -------------------------------------------------------------------------------- /lib-build/init.c: -------------------------------------------------------------------------------- 1 | #include "ulixlib.h" 2 | 3 | void umain() { 4 | /* 5 | if (fork() != 0) 6 | execve ("/bin/swapper", 0, 0); 7 | 8 | int pid = fork (); 9 | printf ("fork() = %d\n", pid); 10 | if (pid == 0) { 11 | printf ("child\n"); 12 | // child 13 | execve ("/bin/swapper", 0, 0); 14 | exit (0); 15 | } 16 | */ 17 | 18 | // printf ("calling execve()\n"); 19 | char *args[] = { "/bin/login", 0 }; 20 | execv (args[0], args); 21 | printf ("exec failed\n"); 22 | for (;;); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /lib-build/init.c.old: -------------------------------------------------------------------------------- 1 | #include "ulixlib.h" 2 | 3 | // program breaks when I put global variables in here 4 | // (BSS segment) 5 | 6 | //unsigned char username[64]; 7 | //unsigned char password[64]; 8 | 9 | void create_login (int terminal); 10 | 11 | #define LOGIN_PROCESSES 5 12 | 13 | void umain() { 14 | int i; 15 | for (i=0; i $@.dump 30 | 31 | clean: 32 | rm $(OBJECTS) 33 | 34 | copy: 35 | cp $(OBJECTS) ../diskfiles/bin/ 36 | 37 | # test: login.c 38 | # /usr/cross/bin/i586-elf-objdump -M intel -D login > login.dump 39 | -------------------------------------------------------------------------------- /lib-build/tools/Makefile.orig: -------------------------------------------------------------------------------- 1 | ifeq ($(HOME),/home/esser) 2 | OS=Linux 3 | LD=ld 4 | CC=/usr/bin/gcc-4.4 5 | OBJDUMP=objdump 6 | endif 7 | 8 | ifeq ($(HOME),/Users/esser) 9 | OS=MacOS 10 | LD=/usr/cross/bin/i586-elf-ld 11 | CC=/usr/cross/bin/i586-elf-gcc 12 | OBJDUMP=/usr/cross/bin/i586-elf-objdump 13 | endif 14 | 15 | CCOPTIONS=-nostdlib -ffreestanding -fforce-addr -fomit-frame-pointer -fno-function-cse -nostartfiles -mtune=i386 -momit-leaf-frame-pointer 16 | CCASMOPTIONS=-fverbose-asm -masm=intel 17 | 18 | LDOPTIONS=-static -s --pie 19 | 20 | all: build copy 21 | 22 | build: compile 23 | 24 | compile: 25 | $(CC) $(CCOPTIONS) $(CCTESTOPTIONS) -c hello.c 26 | $(CC) $(CCOPTIONS) $(CCTESTOPTIONS) -c hexdump.c 27 | # link it with linked script "linked.ld" 28 | $(LD) $(LDOPTIONS) -T process.ld --entry 0 -o hello hello.o ../ulixlib.o 29 | $(LD) $(LDOPTIONS) -T process.ld --entry 0 -o hexdump hexdump.o ../ulixlib.o 30 | 31 | copy: 32 | cp hello hexdump ../diskfiles/bin/ 33 | clean: 34 | rm -f ./*.o 35 | 36 | -------------------------------------------------------------------------------- /lib-build/tools/args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/args -------------------------------------------------------------------------------- /lib-build/tools/args.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | // unsigned char buf[2048]; 4 | 5 | void hallo () { 6 | printf ("ICH BIN HALLO -- UND DAS IST EIN FEHLER!\n"); 7 | exit(0); 8 | } 9 | 10 | int main (int argc, char** argv) { 11 | int i; 12 | printf ("argc: %d, &argc: 0x%08x, argv: 0x%08x, &argv: 0x%08x\n", 13 | argc, &argc, argv, &argv); 14 | for (i=0; i255) 10 | printf ("ascii: call without arguments or with a number between 32 and 255\n"); 11 | else 12 | printf ("%2x: %c\n", i, (unsigned char)i); 13 | } else { 14 | for (i=32;i<256;i++) { 15 | printf ("%2x: %c ", i, (unsigned char)i); 16 | if (i%13 == 5) printf ("\n"); 17 | } 18 | printf ("\n"); 19 | } 20 | return; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /lib-build/tools/bindump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/bindump -------------------------------------------------------------------------------- /lib-build/tools/bindump.c: -------------------------------------------------------------------------------- 1 | // bindump.c 2 | // Hans-Georg Esser 3 | 4 | #include "../ulixlib.h" 5 | 6 | int rev; // reverse output? 7 | 8 | void binwrite (unsigned char c); 9 | void bindump (unsigned char* bytes, int offset, int num); 10 | 11 | int main (int argc, char *argv[]) { 12 | unsigned char buf[8]; 13 | char filename[101]; 14 | int count; 15 | int pos = 0; 16 | int argpos; 17 | rev = 0; // reverse? 18 | 19 | if (argc==1) { 20 | printf ("usage: bindump [-r] filemame\n"); 21 | exit (0); 22 | } 23 | // Test, ob Option -r gesetzt: 24 | if (argc>2) { 25 | argpos = 2; 26 | if (strcmp(argv[1],"-r") != 0) { 27 | rev = 1; // reverse! 28 | } 29 | } else { 30 | argpos = 1; 31 | } 32 | 33 | // get filename 34 | strncpy (filename, argv[argpos], 100); 35 | 36 | printf ("open %s\n", filename); 37 | 38 | int fd = open(filename, 0); 39 | if (fd == -1) { 40 | printf ("bindump: %s not found\n"); 41 | exit (0); 42 | } 43 | 44 | do { 45 | count = read (fd, &buf, 7); 46 | if (count>0) bindump ((unsigned char*)&buf, pos, count); 47 | pos += 7; 48 | } while (count > 0); 49 | exit (0); 50 | } 51 | 52 | void binwrite (unsigned char c) { 53 | unsigned int v = (unsigned int)c; 54 | int i; 55 | for (i=7; i>-1; i--) { 56 | if (rev==0) 57 | printf ("%d", (v>>i)%2); // normale Ausgabe 58 | else 59 | printf ("%d", (v>>(7-i))%2); // reverse 60 | }; 61 | printf (" "); 62 | } 63 | 64 | void bindump (unsigned char* bytes, int offset, int num) { 65 | int i; unsigned char c; 66 | printf ("%04x ", offset); 67 | for (i=0; i31)&&(c<128)) 74 | printf ("%c",c); 75 | else 76 | printf ("."); 77 | }; 78 | printf ("\n"); 79 | return; 80 | }; 81 | -------------------------------------------------------------------------------- /lib-build/tools/cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/cat -------------------------------------------------------------------------------- /lib-build/tools/cat.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0); 3 | 4 | #define stdout 1 5 | 6 | #define BUFSIZE 1024 7 | 8 | char buf[BUFSIZE]; 9 | 10 | int main (int argc, char* argv[]) { 11 | if (argc < 2) { 12 | printf ("cat: requires at least one argument\n"); 13 | return; 14 | } 15 | 16 | // int total_bytes = 0; 17 | int read_bytes = 0; 18 | 19 | int i, fd; 20 | for (i = 1; i < argc; i++) { 21 | fd = open(argv[i], 0); 22 | if (fd == -1) { 23 | int err = errno; 24 | printf ("cat: %s: ", argv[i]); 25 | switch (err) { 26 | case ENOENT: printf ("no such file\n"); break; 27 | case EACCES: printf ("access denied\n"); break; 28 | default: printf ("unknown error\n"); break; 29 | } 30 | exit (1); 31 | } else { 32 | while ( (read_bytes = read(fd, &buf, BUFSIZE)) > 0 ) { 33 | write (stdout, buf, read_bytes); 34 | // total_bytes += read_bytes; 35 | } 36 | close (fd); 37 | } 38 | // printf ("\ncat: total read bytes: %d\n", total_bytes); 39 | } 40 | return; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /lib-build/tools/chgrp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/chgrp -------------------------------------------------------------------------------- /lib-build/tools/chgrp.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | if (argc != 3) { 5 | printf ("chown: requires two arguments (file, mode)\n"); 6 | exit (1); 7 | } 8 | 9 | if (chown (argv[2], -1, atoi (argv[1])) != 0) { 10 | printf ("chown: permission denied\n"); 11 | exit (1); 12 | } 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /lib-build/tools/chmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/chmod -------------------------------------------------------------------------------- /lib-build/tools/chmod.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | if (argc != 3) { 5 | printf ("chmod: requires two arguments (file, mode)\n"); 6 | exit (1); 7 | } 8 | 9 | if (chmod (argv[2], atoi8 (argv[1])) != 0) { 10 | printf ("chmod: permission denied\n"); 11 | exit (1); 12 | } 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /lib-build/tools/chown: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/chown -------------------------------------------------------------------------------- /lib-build/tools/chown.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | if (argc != 3) { 5 | printf ("chown: requires two arguments (file, mode)\n"); 6 | exit (1); 7 | } 8 | 9 | if (chown (argv[2], atoi (argv[1]), -1) != 0) { 10 | printf ("chown: permission denied\n"); 11 | exit (1); 12 | } 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /lib-build/tools/clear: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/clear -------------------------------------------------------------------------------- /lib-build/tools/clear.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | clrscr(); 6 | return; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /lib-build/tools/cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/cp -------------------------------------------------------------------------------- /lib-build/tools/cp.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | #define O_RDONLY 0x0000 /* read only */ 5 | #define O_WRONLY 0x0001 /* write only */ 6 | #define O_RDWR 0x0002 /* read and write */ 7 | #define O_APPEND 0x0008 /* append mode */ 8 | #define O_CREAT 0x0200 /* create file */ 9 | 10 | unsigned char buf[2048]; 11 | 12 | int main (int argc, char* argv[]) { 13 | int i, fd1, fd2, len, res; 14 | fd1 = open(argv[1], O_RDONLY); 15 | if (fd1 == -1) { 16 | printf ("cp: %s: no such file\n", argv[1]); 17 | return; 18 | } 19 | 20 | // check if second argument is a directory 21 | int is_file = chdir (argv[2]); 22 | if (is_file == 0) { 23 | printf ("cp: target must not be a directory.\n"); 24 | exit (0); 25 | } 26 | 27 | fd2 = open(argv[2], O_WRONLY | O_CREAT); 28 | if (fd2 == -1) { 29 | printf ("cp: %s: cannot create file\n", argv[2]); 30 | close (fd1); 31 | return; 32 | } 33 | 34 | struct stat st; 35 | stat (argv[1], &st); 36 | int size = st.st_size; 37 | int count = 0; 38 | int progress = 1; 39 | int old_pertwenty = 0; 40 | int pertwenty = 0; 41 | int plus_signs; 42 | 43 | printf ("fd1 = open() = %d, fd2 = open() = %d\n", fd1, fd2); 44 | 45 | printf ("[ ]\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); 46 | 47 | while ( (len = read (fd1, &buf, 2048)) > 0 ) { 48 | // printf ("reading/writing %d bytes\n", len); 49 | res = write (fd2, &buf, len); 50 | if (res == -1) { 51 | printf ("\ncp: Writing failed, copy aborted\n"); 52 | exit (1); 53 | } 54 | 55 | count += len; 56 | old_pertwenty = pertwenty; 57 | if (size != 0) 58 | pertwenty = count*20/size; 59 | else 60 | pertwenty = 20; // avoid division by 0 61 | plus_signs = pertwenty - old_pertwenty; 62 | for (i=0;i 0 ) { 23 | len2 = read (fd2, &buf2, BUFSIZE); 24 | if (len1 != len2) { 25 | printf ("files differ (length)\n"); 26 | close (fd1); close (fd2); exit(0); 27 | } 28 | if (memcmp (buf,buf2,len1) != 0) { 29 | printf ("files differ (content)\n"); 30 | close (fd1); close (fd2); exit(0); 31 | } 32 | } 33 | close (fd1); close (fd2); 34 | exit(0); 35 | } 36 | 37 | 38 | int memcmp (unsigned char *b1, unsigned char *b2, int len) { 39 | int i; 40 | for (i=0; i 0) { 37 | printf ("BUF: "); 38 | write (1, buf, bytes); 39 | printf ("\n"); 40 | } else resign (); 41 | } 42 | close (fd); 43 | exit (0); 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /lib-build/tools/fork1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/fork1 -------------------------------------------------------------------------------- /lib-build/tools/fork1.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | int fret = fork (); 5 | int pid = getpid (); 6 | int ppid = getppid (); 7 | int tid = gettid (); 8 | 9 | printf ("[%d]: pid = %d, tid = %d, ppid = %d, forkret = %d\n", 10 | pid, pid, tid, ppid, fret); 11 | exit (0); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /lib-build/tools/fork2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/fork2 -------------------------------------------------------------------------------- /lib-build/tools/fork2.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | printf ("Press Return to end.\n"); 5 | int f1 = fork (); // 2 procs 6 | int f2 = fork (); // 4 procs 7 | int f3 = fork (); // 8 procs 8 | int f4 = fork (); // 16 procs 9 | int f5 = fork (); // 32 procs 10 | int f6 = fork (); // 64 procs 11 | 12 | int pid = getpid (); 13 | int ppid = getppid (); 14 | int tid = gettid (); 15 | 16 | printf ("[%2d]: pid = %2d, tid = %2d, ppid = %2d, " 17 | "forkrets = [%2d %2d %2d %2d]\n", 18 | pid, pid, tid, ppid, f1, f2, f3, f4); 19 | 20 | if (f1!=0 && f2!=0 && f3!=0 && f4!=0) { 21 | char s[80]; 22 | ureadline ((char*)s, 79, false); 23 | } 24 | 25 | long int j; for (j = 0; j < 9999999ul; j++); 26 | exit (0); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /lib-build/tools/fork3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/fork3 -------------------------------------------------------------------------------- /lib-build/tools/fork3.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | void status () { 4 | printf ("[%d]: ppid = %d\n", getpid(), getppid()); 5 | } 6 | 7 | int main () { 8 | int pid = fork (); 9 | if (pid == 0) { 10 | // child 11 | printf ("Child: pid = %d\n", getpid()); 12 | int i; 13 | for (i=0; i<10; i++) { 14 | status (); 15 | resign (); 16 | } 17 | 18 | } else { 19 | // parent 20 | printf ("Parent: pid = %d\n", getpid()); 21 | int i; 22 | for (i=0; i<3; i++) { 23 | status (); 24 | resign (); 25 | } 26 | printf ("Parent exits\n"); 27 | exit (0); 28 | } 29 | 30 | 31 | exit (0); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib-build/tools/free: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/free -------------------------------------------------------------------------------- /lib-build/tools/free.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | int free = get_free_frames (); 5 | printf ("%d frames (%d KByte) total memory.\n", 6 | MEM_SIZE / 4096, MEM_SIZE / 1024); 7 | printf ("%d frames (%d KByte) free.\n", free, free*4); 8 | printf ("%d %% usage.\n", 100 - (free*100/(MEM_SIZE/4096))); 9 | exit (0); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /lib-build/tools/grep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/grep -------------------------------------------------------------------------------- /lib-build/tools/grep.c: -------------------------------------------------------------------------------- 1 | // Simple grep. Only supports ^ . * $ operators. 2 | 3 | // taken from the xv6 OS 4 | 5 | 6 | /* 7 | The xv6 software is: 8 | 9 | Copyright (c) 2006-2009 Frans Kaashoek, Robert Morris, Russ Cox, 10 | Massachusetts Institute of Technology 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | */ 31 | 32 | #include "../ulixlib.h" 33 | 34 | char buf[1024]; 35 | int match(char*, char*); 36 | 37 | 38 | // from ulib.c 39 | 40 | void* 41 | memmove(void *vdst, void *vsrc, int n) 42 | { 43 | char *dst, *src; 44 | 45 | dst = vdst; 46 | src = vsrc; 47 | while(n-- > 0) 48 | *dst++ = *src++; 49 | return vdst; 50 | } 51 | 52 | char* 53 | strchr(const char *s, char c) 54 | { 55 | for(; *s; s++) 56 | if(*s == c) 57 | return (char*) s; 58 | return 0; 59 | } 60 | 61 | 62 | // from grep.c 63 | 64 | void 65 | grep(char *pattern, int fd) 66 | { 67 | int n, m; 68 | char *p, *q; 69 | 70 | m = 0; 71 | while((n = read(fd, buf+m, sizeof(buf)-m)) > 0){ 72 | m += n; 73 | p = buf; 74 | while((q = strchr(p, '\n')) != 0){ 75 | *q = 0; 76 | if(match(pattern, p)){ 77 | *q = '\n'; 78 | write(1, p, q+1 - p); 79 | } 80 | p = q+1; 81 | } 82 | if(p == buf) 83 | m = 0; 84 | if(m > 0){ 85 | m -= p - buf; 86 | memmove(buf, p, m); 87 | } 88 | } 89 | } 90 | 91 | int 92 | main(int argc, char *argv[]) 93 | { 94 | int fd, i; 95 | char *pattern; 96 | 97 | if(argc <= 1){ 98 | printf("usage: grep pattern [file ...]\n"); 99 | exit(-1); 100 | } 101 | pattern = argv[1]; 102 | 103 | if(argc <= 2){ 104 | grep(pattern, 0); // stdin 105 | exit(0); 106 | } 107 | 108 | for(i = 2; i < argc; i++){ 109 | if((fd = open(argv[i], 0)) < 0){ 110 | printf("grep: cannot open %s\n", argv[i]); 111 | exit(-1); 112 | } 113 | grep(pattern, fd); 114 | close(fd); 115 | } 116 | exit(0); 117 | } 118 | 119 | // Regexp matcher from Kernighan & Pike, 120 | // The Practice of Programming, Chapter 9. 121 | 122 | int matchhere(char*, char*); 123 | int matchstar(int, char*, char*); 124 | 125 | int 126 | match(char *re, char *text) 127 | { 128 | if(re[0] == '^') 129 | return matchhere(re+1, text); 130 | do{ // must look at empty string 131 | if(matchhere(re, text)) 132 | return 1; 133 | }while(*text++ != '\0'); 134 | return 0; 135 | } 136 | 137 | // matchhere: search for re at beginning of text 138 | int matchhere(char *re, char *text) 139 | { 140 | if(re[0] == '\0') 141 | return 1; 142 | if(re[1] == '*') 143 | return matchstar(re[0], re+2, text); 144 | if(re[0] == '$' && re[1] == '\0') 145 | return *text == '\0'; 146 | if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 147 | return matchhere(re+1, text+1); 148 | return 0; 149 | } 150 | 151 | // matchstar: search for c*re at beginning of text 152 | int matchstar(int c, char *re, char *text) 153 | { 154 | do{ // a * matches zero or more instances 155 | if(matchhere(re, text)) 156 | return 1; 157 | }while(*text!='\0' && (*text++==c || c=='.')); 158 | return 0; 159 | } 160 | 161 | -------------------------------------------------------------------------------- /lib-build/tools/hexdump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/hexdump -------------------------------------------------------------------------------- /lib-build/tools/hexdump.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | unsigned char buf[2048]; 4 | int err; 5 | 6 | int main (int argc, char* argv[]) { 7 | // printf ("argc = %d\n", argc); 8 | // printf ("argv[0] = %s\n", argv[0]); 9 | int offset = 0; 10 | int endpos = -1; 11 | int i, n; char c; 12 | int filesize; 13 | 14 | if (argc<2) { 15 | printf ("usage: hexdump file [offset [endpos]]\n"); 16 | exit(0); 17 | } 18 | 19 | int fd = open(argv[1], 0); 20 | if (fd == -1) { 21 | err = errno; 22 | printf ("hexdump: %s: ", argv[1]); 23 | switch (err) { 24 | case ENOENT: printf ("no such file\n"); break; 25 | case EACCES: printf ("access denied\n"); break; 26 | default: printf ("unknown error\n"); break; 27 | } 28 | exit (1); 29 | } 30 | 31 | filesize = lseek (fd, 0, SEEK_END); 32 | // seek to begin 33 | lseek (fd, offset, SEEK_SET); 34 | 35 | if (argc>=3) { 36 | offset = atoi (argv[2]); 37 | // check filesize 38 | if (offset >= filesize) { 39 | printf ("hexdump: trying to read past EOF\n"); 40 | exit(0); 41 | } 42 | } 43 | 44 | if (argc>=4) { 45 | endpos = atoi (argv[3]); 46 | } 47 | 48 | // printf ("fd = open() = %d\n", fd); 49 | if (fd == -1) { 50 | printf ("hexdump: %s: no such file\n", argv[1]); 51 | exit (0); 52 | } else { 53 | int null_lines = 0; 54 | unsigned char check_null; 55 | int line_count = 0; 56 | char input[2]; 57 | while ( (n = read(fd, &buf, 16)) > 0) { 58 | // check if all bytes are 0 59 | check_null = 0; 60 | for (i=0; i= 23) { 84 | // ureadline (0,0); // wait for [Enter] 85 | c = 0; 86 | while (c == 0) c = ureadchar(); 87 | if (c==3) { printf ("\n"); exit(0); } 88 | line_count = 0; 89 | } 90 | printf ("\n"); 91 | } 92 | 93 | // if (offset % 1024 == 0) printf ("K"); 94 | 95 | offset += 16; 96 | if (null_lines == 2) { 97 | line_count++; 98 | printf ("*\n"); 99 | } 100 | if (endpos != -1 && offset > endpos-1) break; 101 | } 102 | 103 | if ((filesize % 16) != 0) { 104 | offset -= (16 - (filesize % 16)); 105 | } 106 | printf ("%04x\n", offset); // final offset 107 | close (fd); 108 | exit(0); 109 | } 110 | 111 | } 112 | 113 | 114 | -------------------------------------------------------------------------------- /lib-build/tools/hexdump.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/hexdump.o -------------------------------------------------------------------------------- /lib-build/tools/init2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/init2 -------------------------------------------------------------------------------- /lib-build/tools/init2.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | char *args1[] = { "/bin/swapper", 0 }; 5 | /* 6 | if (fork() != 0) { // parent: swapper 7 | get_free_frames (); 8 | get_free_frames (); 9 | execv (args1[0], args1); 10 | } 11 | */ 12 | 13 | char *args[] = { "/bin/login", 0 }; 14 | execv (args[0], args); 15 | exit (1); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /lib-build/tools/inode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/inode -------------------------------------------------------------------------------- /lib-build/tools/inode.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | int ino = atoi (argv[1]); 5 | printf ("Requesting inode info for inode no. %d on /dev/hda\n", ino); 6 | syscall2 (777, ino); 7 | 8 | exit (0); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /lib-build/tools/keys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/keys -------------------------------------------------------------------------------- /lib-build/tools/keys.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | unsigned char c; 6 | printf ("keys: press ctrl-c to quit\n"); 7 | for (;;) { 8 | c = ureadchar(); 9 | if (c==0) continue; 10 | printf ("char: %c, ord: %d = 0x%x\n", c, 11 | (unsigned int)c, (unsigned int)c); 12 | if (c==3) return; // Strg-C 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /lib-build/tools/kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/kill -------------------------------------------------------------------------------- /lib-build/tools/kill.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | int sig, pid, res, err; 5 | switch (argc) { 6 | case 2: 7 | sig = 15; 8 | pid = atoi(argv[1]); 9 | break; 10 | case 3: 11 | if (argv[1][0] == '-') 12 | sig = atoi(argv[1]+1); 13 | else 14 | sig = atoi(argv[1]); 15 | pid = atoi(argv[2]); 16 | break; 17 | default: 18 | printf ("kill: requires one or two arguments ([signal] pid)\n"); 19 | exit (0); 20 | } 21 | 22 | printf ("kill: sending signal %d to process %d\n", sig, pid); 23 | res = kill (pid, sig); 24 | if (res == -1) { 25 | err = errno; 26 | printf ("kill: could not send signal. "); 27 | switch (err) { 28 | case EPERM: printf ("permission denied\n"); break; 29 | case ESRCH: printf ("no such process\n"); break; 30 | case EINVAL: printf ("invalid signal number\n"); break; 31 | default: printf ("reason unknown; errno = %d\n", err); 32 | }; 33 | } 34 | exit (0); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /lib-build/tools/login: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/login -------------------------------------------------------------------------------- /lib-build/tools/login.GOOD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/login.GOOD -------------------------------------------------------------------------------- /lib-build/tools/login.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | // program breaks when I put global variables in here 4 | // (BSS segment) 5 | 6 | #define LOGIN_PROCESSES 5 7 | 8 | void create_login (int terminal); 9 | void create_auto_login (int terminal, int userid, char *pass); 10 | 11 | void main() { 12 | // create swapper process 13 | int pid = fork (); 14 | if (pid == 0) { // child 15 | char *args[] = { "/bin/swapper", 0 }; 16 | execv (args[0], args); 17 | printf ("init: Error while trying to launch /bin/swapper\n"); 18 | exit (1); 19 | } 20 | printf ("swapper launched in background. output at console 10\n\n"); 21 | 22 | // create login processes 23 | int i; 24 | create_auto_login (0, 1000, "xyz"); // auto login uid 1000 on 1st vt 25 | create_auto_login (1, 0, "xyz"); // auto login root on 2nd vt 26 | for (i = 2; i < LOGIN_PROCESSES; i++) 27 | create_login (i); 28 | 29 | // logins spawned; now become the idle process 30 | setpsname ("[idle]"); 31 | for (;;) { 32 | idle (); // if we don't call idle, qemu will have 100% CPU usage 33 | // printf ("I"); // check that it is alive... 34 | } 35 | }; 36 | 37 | void create_login (int terminal) { 38 | unsigned char username[32]; 39 | unsigned char password[32]; 40 | struct passwd pd; 41 | struct passwd *pwdptr=&pd; 42 | char pwdentry[128]; 43 | int uid; 44 | int user_exists; 45 | 46 | if (fork() != 0) return; 47 | 48 | setterm (terminal); 49 | setpsname ("login"); 50 | for (;;) { 51 | printf ("ulix login: "); 52 | ureadline (username, sizeof(username)-1, true); 53 | // look up username in /etc/passwd 54 | if ((getpwnam_r(username ,pwdptr, pwdentry, sizeof(pwdentry), 0))==0) { 55 | uid = pd.pw_uid; 56 | user_exists = true; 57 | } else { 58 | user_exists = false; 59 | } 60 | 61 | write (1, "Password: ", 10); 62 | ureadline ((char*)&password, sizeof(password)-1, false); // no echo 63 | write (1, "\n", 1); 64 | if (!user_exists || login(uid, password) != 0) { 65 | write (1, "Login denied\n", 13); 66 | continue; 67 | } 68 | // launch shell 69 | int pid; 70 | LABEL: 71 | pid = fork(); 72 | if (pid == 0) { 73 | // child 74 | char *args[] = { "/bin/sh", 0 }; 75 | execv (args[0], args); 76 | } else { 77 | waitpid (pid, 0, 0); 78 | } 79 | } 80 | } 81 | 82 | 83 | void create_auto_login (int terminal, int userid, char *pass) { 84 | struct passwd pwd; 85 | char buffer[256]; 86 | int bufsize = sizeof(buffer); 87 | struct passwd **result; 88 | 89 | if (fork() != 0) return; 90 | 91 | getpwuid_r (userid, &pwd, buffer, bufsize, result); 92 | setterm (terminal); 93 | setpsname ("login"); 94 | for (;;) { 95 | printf ("ulix login: %s\n", pwd.pw_name); 96 | printf ("Password: (auto login)\n"); 97 | login(userid, pass); 98 | // launch shell 99 | int pid = fork(); 100 | if (pid == 0) { 101 | // child 102 | char *args[] = { "/bin/sh", 0 }; 103 | execv (args[0], args); 104 | } else { 105 | waitpid (pid, 0, 0); 106 | } 107 | } 108 | } 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /lib-build/tools/login.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/login.o -------------------------------------------------------------------------------- /lib-build/tools/login.symbols: -------------------------------------------------------------------------------- 1 | 2 | Discarded input sections 3 | 4 | .stab 0x0000000000000000 0x357c ulixlib.o 5 | .stabstr 0x0000000000000000 0x1cca ulixlib.o 6 | .stab 0x0000000000000000 0x7e0 login.o 7 | .stabstr 0x0000000000000000 0xdee login.o 8 | 9 | Memory Configuration 10 | 11 | Name Origin Length Attributes 12 | *default* 0x0000000000000000 0xffffffffffffffff 13 | 14 | Linker script and memory map 15 | 16 | LOAD ulixlib.o 17 | LOAD login.o 18 | 0x0000000000000000 virt = 0x0 19 | 0x0000000000000000 . = virt 20 | 21 | .setup 22 | *(.setup) 23 | 24 | .text 0x0000000000000000 0x2000 25 | 0x0000000000000000 code = . 26 | *(.text) 27 | .text 0x0000000000000000 0x13e9 ulixlib.o 28 | 0x0000000000000000 strlen 29 | 0x0000000000000027 BAD_strcmp 30 | 0x00000000000000a3 strcmp 31 | 0x0000000000000101 strncmp 32 | 0x000000000000018c atoi 33 | 0x00000000000001db atoi8 34 | 0x0000000000000226 strncpy 35 | 0x000000000000026f strcpy 36 | 0x00000000000002aa memcpy 37 | 0x00000000000002e6 memset 38 | 0x000000000000031a memsetw 39 | 0x0000000000000351 sbrk 40 | 0x0000000000000369 syscall4 41 | 0x000000000000038c syscall3 42 | 0x00000000000003ad syscall2 43 | 0x00000000000003ca syscall1 44 | 0x00000000000003df fork 45 | 0x00000000000003f9 pthread_create 46 | 0x000000000000040c pthread_exit 47 | 0x000000000000041a execve 48 | 0x0000000000000434 idle 49 | 0x0000000000000442 lib_page_out 50 | 0x0000000000000454 get_free_frames 51 | 0x0000000000000462 free_a_frame 52 | 0x0000000000000470 waitpid 53 | 0x0000000000000488 exit 54 | 0x0000000000000497 yield 55 | 0x00000000000004a2 getpid 56 | 0x00000000000004ad getppid 57 | 0x00000000000004b8 getpsinfo 58 | 0x00000000000004cf setpsname 59 | 0x00000000000004e2 setterm 60 | 0x00000000000004f4 clrscr 61 | 0x0000000000000502 get_xy 62 | 0x000000000000051a set_xy 63 | 0x0000000000000548 read_screen 64 | 0x000000000000055b write_screen 65 | 0x000000000000056e pthread_mutex_init 66 | 0x0000000000000586 pthread_mutex_lock 67 | 0x0000000000000599 pthread_mutex_unlock 68 | 0x00000000000005ac isatty 69 | 0x00000000000005be open 70 | 0x00000000000005d2 stat 71 | 0x00000000000005e7 close 72 | 0x00000000000005f6 read 73 | 0x000000000000060e write 74 | 0x0000000000000626 lseek 75 | 0x000000000000063d getdent 76 | 0x0000000000000656 mkdir 77 | 0x000000000000066a rmdir 78 | 0x000000000000067a getcwd 79 | 0x0000000000000691 chdir 80 | 0x00000000000006a1 link 81 | 0x00000000000006b6 unlink 82 | 0x00000000000006c6 symlink 83 | 0x00000000000006db readlink 84 | 0x00000000000006f4 diskfree 85 | 0x0000000000000707 sync 86 | 0x0000000000000712 kill 87 | 0x0000000000000725 signal 88 | 0x0000000000000739 setuid 89 | 0x000000000000075a setgid 90 | 0x000000000000077b seteuid 91 | 0x000000000000079c setegid 92 | 0x00000000000007bd login 93 | 0x00000000000007e3 getpwnam_r 94 | 0x0000000000000a2e getpwuid_r 95 | 0x0000000000000c84 getuid 96 | 0x0000000000000c94 geteuid 97 | 0x0000000000000ca4 getgid 98 | 0x0000000000000cb4 getegid 99 | 0x0000000000000cc4 chown 100 | 0x0000000000000cf9 chmod 101 | 0x0000000000000d1c scroll_up 102 | 0x0000000000000d70 scroll_down 103 | 0x0000000000000dbe ulixlib_printchar 104 | 0x00000000000011e0 printf 105 | 0x00000000000011f2 sprintf 106 | 0x0000000000001207 readline 107 | 0x000000000000121e ureadline 108 | 0x00000000000013d1 ureadchar 109 | *fill* 0x00000000000013e9 0x3 00 110 | .text 0x00000000000013ec 0x385 login.o 111 | 0x00000000000013ec main 112 | 0x0000000000001482 create_login 113 | 0x0000000000001653 create_auto_login 114 | *(.rodata*) 115 | .rodata 0x0000000000001771 0x34 ulixlib.o 116 | *fill* 0x00000000000017a5 0x3 00 117 | .rodata 0x00000000000017a8 0xc8 login.o 118 | 0x0000000000002000 . = ALIGN (0x1000) 119 | *fill* 0x0000000000001870 0x790 00 120 | 121 | .plt 0x0000000000002000 0x0 122 | .plt 0x0000000000000000 0x0 ulixlib.o 123 | 124 | .interp 0x0000000000002000 0x13 125 | .interp 0x0000000000002000 0x13 ulixlib.o 126 | 127 | .gnu.version_d 0x0000000000002014 0x0 load address 0x0000000000002013 128 | .gnu.version_d 129 | 0x0000000000000000 0x0 ulixlib.o 130 | 131 | .gnu.version 0x0000000000002014 0x0 load address 0x0000000000002013 132 | .gnu.version 0x0000000000000000 0x0 ulixlib.o 133 | 134 | .gnu.version_r 0x0000000000002014 0x0 load address 0x0000000000002013 135 | .gnu.version_r 136 | 0x0000000000000000 0x0 ulixlib.o 137 | 138 | .dynsym 0x0000000000002014 0x60 139 | .dynsym 0x0000000000002014 0x60 ulixlib.o 140 | 141 | .dynstr 0x0000000000002074 0x18 142 | .dynstr 0x0000000000002074 0x18 ulixlib.o 143 | 144 | .hash 0x000000000000208c 0x2c 145 | .hash 0x000000000000208c 0x2c ulixlib.o 146 | 147 | .rel.dyn 0x00000000000020b8 0xc8 148 | .rel.plt 0x0000000000000000 0x0 ulixlib.o 149 | .rel.got 0x0000000000000000 0x0 ulixlib.o 150 | .rel.ifunc 0x0000000000000000 0x0 ulixlib.o 151 | .rel.text 0x00000000000020b8 0xc8 ulixlib.o 152 | 153 | .data 0x0000000000002180 0xe80 154 | 0x0000000000002180 data = . 155 | *(.data) 156 | .data 0x0000000000002180 0x0 ulixlib.o 157 | .data 0x0000000000002180 0x0 login.o 158 | 0x0000000000003000 . = ALIGN (0x1000) 159 | *fill* 0x0000000000002180 0xe80 00 160 | 161 | .dynamic 0x0000000000003000 0x80 162 | .dynamic 0x0000000000003000 0x80 ulixlib.o 163 | 0x0000000000003000 _DYNAMIC 164 | 165 | .got 0x0000000000003080 0x0 166 | .got 0x0000000000000000 0x0 ulixlib.o 167 | 168 | .got.plt 0x0000000000003080 0xc 169 | .got.plt 0x0000000000003080 0xc ulixlib.o 170 | 0x0000000000003080 _GLOBAL_OFFSET_TABLE_ 171 | 172 | .bss 0x000000000000308c 0xf74 173 | 0x000000000000308c bss = . 174 | *(COMMON*) 175 | *(.bss*) 176 | .bss 0x000000000000308c 0x0 ulixlib.o 177 | .bss 0x000000000000308c 0x0 login.o 178 | 0x0000000000004000 . = ALIGN (0x1000) 179 | *fill* 0x000000000000308c 0xf74 00 180 | 0x0000000000004000 end = . 181 | OUTPUT(login elf32-i386) 182 | 183 | .dynbss 0x0000000000004000 0x0 184 | .dynbss 0x0000000000000000 0x0 ulixlib.o 185 | 186 | .stab 187 | 188 | .stabstr 189 | 190 | .comment 0x0000000000000000 0x11 191 | .comment 0x0000000000000000 0x11 ulixlib.o 192 | 0x12 (size before relaxing) 193 | .comment 0x0000000000000000 0x12 login.o 194 | 195 | .stab 196 | 197 | .stabstr 198 | -------------------------------------------------------------------------------- /lib-build/tools/ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/ls -------------------------------------------------------------------------------- /lib-build/tools/memwrite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/memwrite -------------------------------------------------------------------------------- /lib-build/tools/memwrite.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | int screen = 0xb8000; 5 | int size = 80*25*2; 6 | char buf[size]; 7 | int fd = open ("/dev/kmem", O_RDWR); 8 | 9 | 10 | lseek (fd, screen, SEEK_SET); 11 | read (fd, (char*)buf, size); 12 | 13 | int i; 14 | printf ("First line:\n"); 15 | for (i = 0; i < 160; i+=2) { 16 | printf ("%c", buf[i]); 17 | } 18 | printf ("\n"); 19 | 20 | char *msg = "HELLO THIS IS A TEST"; 21 | printf ("Setting first line to '%s'\n", msg); 22 | for (i = 0; i < 2 * strlen(msg); i+=2) { 23 | buf[i] = msg[i/2]; 24 | } 25 | 26 | lseek (fd, screen, SEEK_SET); 27 | write (fd, buf, 2 * strlen(msg)); 28 | 29 | close (fd); 30 | exit (0); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /lib-build/tools/mkdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/mkdir -------------------------------------------------------------------------------- /lib-build/tools/mkdir.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | #define O_RDONLY 0x0000 /* read only */ 5 | #define O_WRONLY 0x0001 /* write only */ 6 | #define O_RDWR 0x0002 /* read and write */ 7 | #define O_APPEND 0x0008 /* append mode */ 8 | #define O_CREAT 0x0200 /* create file */ 9 | 10 | 11 | int main (int argc, char* argv[]) { 12 | int fd; 13 | 14 | if (argc<2) { 15 | printf ("mkdir: needs directory name argument\n"); 16 | return; 17 | } 18 | 19 | // try opening first 20 | fd = open (argv[1], O_RDWR); 21 | if (fd != -1) { 22 | printf ("mkdir: directory %s exists\n", argv[1]); 23 | exit (1); 24 | } 25 | 26 | fd = mkdir (argv[1], 0777); // create as a+rwx 27 | if (fd == -1) { 28 | printf ("mkdir: error while creating directory %s\n", argv[1]); 29 | exit (1); 30 | } 31 | 32 | return; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /lib-build/tools/mutex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/mutex -------------------------------------------------------------------------------- /lib-build/tools/mutex.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | pthread_mutex_t m1, m2, m3; 5 | pthread_mutexattr_t attr; 6 | 7 | pthread_mutex_init (&m1, &attr); 8 | pthread_mutex_init (&m2, &attr); 9 | pthread_mutex_init (&m3, &attr); 10 | 11 | printf ("mutex1: %08x\n", m1); 12 | printf ("mutex2: %08x\n", m2); 13 | printf ("mutex3: %08x\n", m3); 14 | 15 | pthread_mutex_lock (&m1); 16 | printf ("m1: locked 1 times\n"); 17 | pthread_mutex_lock (&m1); 18 | printf ("m1: locked 2 times\n"); 19 | 20 | exit (0); 21 | } -------------------------------------------------------------------------------- /lib-build/tools/paging: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/paging -------------------------------------------------------------------------------- /lib-build/tools/paging.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | void *brk = 0; 6 | void *last_brk; 7 | char c = 'a'; 8 | int count=0; 9 | 10 | // sbrk (0x3b00*4096); // 3b69 pages free 11 | 12 | /* 13 | for (;;) { 14 | c++; 15 | if (c > 'z') c = 'a'; 16 | last_brk = brk; 17 | brk = sbrk (4096); // 1 page 18 | if ((int)brk == -1) break; 19 | count++; 20 | // printf ("brk returns: %08x\n", (unsigned int)brk); 21 | * (unsigned char*)(brk-1) = c; // test writing to it 22 | printf ("PAGING TEST PROGRAM -- %c\n", * (unsigned char*)(brk-1)); 23 | } 24 | */ 25 | 26 | fork(); // make us two 27 | fork(); fork(); fork(); 28 | 29 | printf ("Calling sbrk()\n"); 30 | sbrk (4096 * (0x06a0-1000)); 31 | printf ("Finished sbrk()\n"); 32 | char input[10]; 33 | // printf ("Press Enter: "); ureadline (input, 5, true); 34 | 35 | /* 36 | printf ("\nLast value of sbrk() was 0x%08x\n", (unsigned int)last_brk); 37 | printf ("%d MByte successfully aquired\n", count); 38 | */ 39 | exit(0); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lib-build/tools/print: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/print -------------------------------------------------------------------------------- /lib-build/tools/print.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | unsigned int val = 0xFFFF00FF; 5 | printf ("decimal: %u\n", val); 6 | printf ("hexadecimal: %x\n", val); 7 | printf ("octal: %o\n", val); 8 | printf ("binary: %032b\n", val); 9 | exit (0); 10 | } 11 | -------------------------------------------------------------------------------- /lib-build/tools/process.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-i386") 2 | ENTRY(main) 3 | virt = 0x00000000; 4 | SECTIONS { 5 | . = virt; 6 | 7 | .setup : AT(virt) { 8 | *(.setup) 9 | } 10 | 11 | .text : AT(code) { 12 | code = .; 13 | *(.text) 14 | *(.rodata*) 15 | . = ALIGN(4096); 16 | } 17 | 18 | .data : AT(data) { 19 | data = .; 20 | *(.data) 21 | . = ALIGN(4096); 22 | } 23 | 24 | .bss : AT(bss) { 25 | bss = .; 26 | *(COMMON*) 27 | *(.bss*) 28 | . = ALIGN(4096); 29 | } 30 | end = .; 31 | } 32 | -------------------------------------------------------------------------------- /lib-build/tools/process.ld.copy: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-i386") 2 | ENTRY(main) 3 | phys = 0x00000000; 4 | virt = 0x00000000; 5 | SECTIONS { 6 | . = phys; 7 | 8 | .setup : AT(phys) { 9 | *(.setup) 10 | } 11 | 12 | .text : AT(code - virt) { 13 | code = .; 14 | *(.text) 15 | *(.rodata*) 16 | . = ALIGN(4096); 17 | } 18 | 19 | .data : AT(data - virt) { 20 | data = .; 21 | *(.data) 22 | . = ALIGN(4096); 23 | } 24 | 25 | .bss : AT(bss - virt) { 26 | bss = .; 27 | *(COMMON*) 28 | *(.bss*) 29 | . = ALIGN(4096); 30 | } 31 | end = .; 32 | } 33 | -------------------------------------------------------------------------------- /lib-build/tools/ps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/ps -------------------------------------------------------------------------------- /lib-build/tools/ps.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | char *state_names[12] = { "---", "READY", "---", "FORK", "EXIT", "WAIT4", "ZOMBIE", "W_KEY", "W_FLP", "W_LCK", "STOP", "W_IDE" }; 5 | 6 | short tcount[1024] = { 0 }; 7 | short showall; 8 | 9 | int main (int argc, char* argv[]) { 10 | showall = (argc > 1) && strequal (argv[1], "-a"); 11 | TCB t; uint res; int pid; 12 | char plus; 13 | if (showall) 14 | printf (" PID TID PPID UID GID TERM STATE CWD CMD\n"); 15 | else 16 | printf (" PID PPID UID GID TERM STATE CWD CMD\n"); 17 | for (pid=0; pid<1024; pid++) { 18 | res = getpsinfo (pid, &t); 19 | if (res) 20 | if (t.pid != t.tid) 21 | tcount[t.pid]++; 22 | } 23 | for (pid=0; pid<1024; pid++) { 24 | // printf ("%d - %x \n", pid, &pid); 25 | res = getpsinfo (pid, &t); 26 | // printf ("%d - %x \n", pid, &pid); 27 | if (res && (t.pid == t.tid || showall)) { 28 | if (tcount[pid] > 0) 29 | plus = '+'; // process has threads 30 | else if (t.pid != t.tid) 31 | plus = '-'; // this is a thread 32 | else 33 | plus = ' '; // process does not have threads 34 | if (showall) 35 | printf ("%4d%c %4d %4d %4d %4d tty%d %-6s %-15s %-23s\n", t.pid, plus, t.tid, t.ppid, t.uid, t.gid, t.terminal, state_names[t.state], t.cwd, t.cmdline); 36 | else 37 | printf ("%4d%c %4d %4d %4d tty%d %-6s %-15s %-28s\n", t.pid, plus, t.ppid, t.uid, t.gid, t.terminal, state_names[t.state], t.cwd, t.cmdline); 38 | } 39 | } 40 | return; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /lib-build/tools/ptree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/ptree -------------------------------------------------------------------------------- /lib-build/tools/ptree.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | int p1,p2,p3,p4,p5,p6,p7,p8,p9,status; 6 | p1 = fork (); // 2 7 | p2 = fork (); // 4 8 | p3 = fork (); // 8 9 | //p4 = fork (); // 16 10 | //p5 = fork (); // 32 11 | //p6 = fork (); // 64 12 | //p7 = fork (); // 128 13 | //p8 = fork (); // 256 14 | //p9 = fork (); // 512 15 | 16 | //if (p9 != 0) waitpid (p9, &status, 0); 17 | //if (p8 != 0) waitpid (p8, &status, 0); 18 | //if (p7 != 0) waitpid (p7, &status, 0); 19 | //if (p6 != 0) waitpid (p6, &status, 0); 20 | //if (p5 != 0) waitpid (p5, &status, 0); 21 | //if (p4 != 0) waitpid (p4, &status, 0); 22 | 23 | printf ("Process %d, with parent %d.\n", getpid(), getppid()); 24 | 25 | if (p3 != 0) waitpid (p3, &status, 0); 26 | if (p2 != 0) waitpid (p2, &status, 0); 27 | if (p1 != 0) waitpid (p1, &status, 0); 28 | 29 | exit (0); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /lib-build/tools/pw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/pw -------------------------------------------------------------------------------- /lib-build/tools/pw.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main(int argc, char* argv[]) { 4 | struct passwd pd; 5 | struct passwd *pwdptr=&pd; 6 | struct passwd *temp; 7 | char pwdentry[200]; 8 | int pwdlinelen = sizeof(pwdentry); 9 | char s[32]; 10 | 11 | if (argc != 2) { 12 | printf ("pw uid, pw username\n"); 13 | exit (0); 14 | } 15 | 16 | if ((getpwnam_r(argv[1],pwdptr,pwdentry,pwdlinelen,&temp))==0) { 17 | printf("user name: %s\n", pd.pw_name); 18 | printf("user id: %u\n", pd.pw_uid); 19 | printf("group id: %u\n", pd.pw_gid); 20 | printf("home dir.: %s\n", pd.pw_dir); 21 | // printf("shell: %s\n", pd.pw_shell); 22 | } else if ((getpwuid_r(atoi(argv[1]),pwdptr,pwdentry,pwdlinelen,&temp))==0) { 23 | printf("user name: %s\n", pd.pw_name); 24 | printf("user id: %u\n", pd.pw_uid); 25 | printf("group id: %u\n", pd.pw_gid); 26 | printf("home dir.: %s\n", pd.pw_dir); 27 | // printf("shell: %s\n", pd.pw_shell); 28 | } 29 | 30 | exit (0); 31 | } 32 | -------------------------------------------------------------------------------- /lib-build/tools/readelf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/readelf -------------------------------------------------------------------------------- /lib-build/tools/readelf.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | // ELF STUFF 5 | typedef unsigned int Elf32_Addr; // 4 byte 6 | typedef unsigned short int Elf32_Half; // 2 byte 7 | typedef unsigned int Elf32_Off; // 4 byte 8 | typedef signed int Elf32_Sword; // 4 byte 9 | typedef unsigned int Elf32_Word; // 4 byte 10 | 11 | #define EI_NIDENT 16 // Size of e_ident[] 12 | 13 | typedef struct { 14 | unsigned char e_ident[EI_NIDENT]; // Magic Number: 0x7f 0x45(E) 0x4c(L) 0x46(F) 15 | Elf32_Half e_type; // ausfuehrbare / relozierbare Datei 16 | Elf32_Half e_machine; // Hardware Architektur 17 | Elf32_Word e_version; // ELF Version 18 | Elf32_Addr e_entry; // Einsprungpunkt in den Programmcode 19 | Elf32_Off e_phoff; // Offset zur Programm-Header Tabelle 20 | Elf32_Off e_shoff; // Offset zur Sektions-Header Tabelle 21 | Elf32_Word e_flags; // Prozessorspezifische Flags 22 | Elf32_Half e_ehsize; // Groesse des ELF Headers 23 | Elf32_Half e_phentsize; // Groesse eines Programm-Header Eintrags 24 | Elf32_Half e_phnum; // Anzahl der Programm-Header 25 | Elf32_Half e_shentsize; // Groesse eines Sektions-Header Eintrags 26 | Elf32_Half e_shnum; // Anzahl der Sektions-Header 27 | Elf32_Half e_shstrndx; // Index des Sektions-Header, 28 | } Elf32_Ehdr; // der StringTable 29 | 30 | typedef struct { 31 | Elf32_Word p_type; // Beschreibt den Zweck des Programm-Header 32 | Elf32_Off p_offset; // Offset zum Segment 33 | Elf32_Addr p_vaddr; // Virtuelle Adresse des Segments im Prozessimage 34 | Elf32_Addr p_paddr; // Physikalische Adresse (wird nicht verwendet) 35 | Elf32_Word p_filesz; // Groesse des Segments in der ELF-Datei (in Byte) 36 | Elf32_Word p_memsz; // Groesse des Segments im Prozessimage (in Bytes) 37 | Elf32_Word p_flags; // Read / Write / Execute 38 | Elf32_Word p_align; // Memory alignment 39 | } Elf32_Phdr; 40 | 41 | 42 | int main (int argc, char* argv[]) { 43 | 44 | if (argc != 2) { 45 | printf ("elf: requires one argument\n"); 46 | return; 47 | } 48 | 49 | Elf32_Ehdr elf_header; 50 | Elf32_Phdr program_header; 51 | 52 | int fd = open(argv[1], 0); 53 | printf ("fd = open() = %d\n", fd); 54 | if (fd == -1) 55 | printf ("elf: %s: no such file\n", argv[1]); 56 | else { 57 | read (fd, &elf_header, sizeof(elf_header)); 58 | printf ("version: %d\n", elf_header.e_version); 59 | printf ("e_entry: %x\n", elf_header.e_entry); 60 | printf ("#pheaders: %d\n", elf_header.e_phnum); 61 | printf ("e_phoff : %d\n", elf_header.e_phoff); 62 | 63 | int phoffset = elf_header.e_phoff; 64 | 65 | printf ("program header:\n"); 66 | int i; 67 | for (i=0; i < elf_header.e_phnum; i++) { 68 | lseek (fd, phoffset + i * elf_header.e_phentsize, SEEK_SET); 69 | read (fd, &program_header, sizeof(program_header)); 70 | if (program_header.p_type == 1) { // type = PT_LOAD 71 | printf ("p_type : %d\n", program_header.p_type); 72 | printf ("p_offset : %d\n", program_header.p_offset); 73 | printf ("p_vaddr : 0x%x\n", program_header.p_vaddr); 74 | printf ("p_filesz : 0x%x\n", program_header.p_filesz); 75 | printf ("p_memsz : 0x%x\n", program_header.p_memsz); 76 | printf ("p_flags : %d\n", program_header.p_flags); 77 | } 78 | } 79 | 80 | close (fd); 81 | return; 82 | } 83 | 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /lib-build/tools/recurse: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/recurse -------------------------------------------------------------------------------- /lib-build/tools/recurse.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | #define COPY_ESP_TO_VAR(x) asm volatile ("mov %%esp, %0" : "=r"(x)) 4 | int recurse (int level); 5 | int esp; 6 | 7 | int main (int argc, char* argv[]) { 8 | recurse (0); 9 | exit(0); 10 | } 11 | 12 | int recurse (int level) { 13 | COPY_ESP_TO_VAR (esp); 14 | printf ("recursing: level = %d, esp = 0x%x\n", level, esp); 15 | recurse (level+1); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib-build/tools/rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/rm -------------------------------------------------------------------------------- /lib-build/tools/rm.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | #define S_IFMT 0170000 /* mask the file type part */ 5 | #define S_IFREG 0100000 /* regular file */ 6 | #define S_IFLNK 0120000 /* symbolic link */ 7 | 8 | int main (int argc, char* argv[]) { 9 | if (argc != 2) { 10 | printf ("rm: requires one argument\n"); 11 | exit (1); 12 | } 13 | 14 | // check if argument is a regular file 15 | struct stat s; 16 | stat (argv[1], &s); 17 | if (((s.st_mode & S_IFMT) != S_IFREG) && ((s.st_mode & S_IFMT) != S_IFLNK)) { 18 | printf ("rm: %s is not a regular file\n", argv[1]); 19 | exit (1); 20 | } 21 | 22 | int ret = unlink (argv[1]); 23 | printf ("unlink returns %d\n", ret); 24 | return; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /lib-build/tools/rmdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/rmdir -------------------------------------------------------------------------------- /lib-build/tools/rmdir.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | int ret; 6 | if (argc != 2) { 7 | printf ("rmdir: requires one argument\n"); 8 | return; 9 | } 10 | ret = rmdir (argv[1]); 11 | printf ("rmdir returns %d\n", ret); 12 | return; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /lib-build/tools/sbrk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/sbrk -------------------------------------------------------------------------------- /lib-build/tools/sbrk.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | int main (int argc, char* argv[]) { 5 | void *brk = 0; 6 | void *last_brk; 7 | char c = 'a'; 8 | int count=0; 9 | for (;;) { 10 | c++; 11 | if (c > 'z') c = 'a'; 12 | last_brk = brk; 13 | brk = sbrk (1024*1024); // 1 MB 14 | if ((int)brk == -1) break; 15 | count++; 16 | // printf ("brk returns: %08x\n", (unsigned int)brk); 17 | * (unsigned char*)(brk-1) = c; // test writing to it 18 | printf ("%c", * (unsigned char*)(brk-1)); 19 | } 20 | 21 | printf ("\nLast value of sbrk() was 0x%08x\n", (unsigned int)last_brk); 22 | printf ("%d MByte successfully aquired\n", count); 23 | 24 | exit(0); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /lib-build/tools/sbrk1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/sbrk1 -------------------------------------------------------------------------------- /lib-build/tools/sbrk1.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | printf ("Callign sbrk(4096)\n"); 5 | int adr = (int) sbrk (4096); 6 | printf ("sbrk() returned 0x%0x\n", adr); 7 | exit (0); 8 | } 9 | -------------------------------------------------------------------------------- /lib-build/tools/sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/sh -------------------------------------------------------------------------------- /lib-build/tools/sigtest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/sigtest -------------------------------------------------------------------------------- /lib-build/tools/sigtest.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | #define COPY_ESP_TO_VAR(x) asm volatile ("mov %%esp, %0" : "=r"(x) ) 4 | 5 | void handler1 (int sig); 6 | void handler2 (int sig); 7 | void waste_time (); 8 | 9 | int main (int argc, char* argv[]) { 10 | int i; 11 | int pid = fork (); 12 | int esp; 13 | 14 | if (pid == 0) 15 | 16 | { // child 17 | int testcount; 18 | printf ("[child: %d, receives signals]\n", getpid()); 19 | signal (5, handler1); // register handler 1 20 | signal (6, handler2); // register handler 2 21 | for (i = 0; i<40; i++) { 22 | testcount++; 23 | //COPY_ESP_TO_VAR (esp); 24 | printf ("c"); 25 | //printf ("\nESP = %x\n", esp); 26 | waste_time (); 27 | } 28 | printf ("\n[child] testcount = %d (should be 40)\n", testcount); 29 | exit(0); 30 | } 31 | 32 | else 33 | 34 | { // parent 35 | printf ("[parent: %d, sends signals]\n", getpid()); 36 | for (i = 0; i<20; i++) { 37 | printf ("p"); 38 | waste_time (); 39 | } 40 | kill (pid, 5); 41 | kill (pid, 6); 42 | waste_time (); waste_time (); 43 | waste_time (); waste_time (); 44 | waste_time (); waste_time (); 45 | kill (pid, 5); 46 | kill (pid, 6); 47 | for (i = 0; i<22; i++) { 48 | printf ("p"); 49 | waste_time (); 50 | } 51 | printf ("--done\n"); 52 | exit(0); 53 | } 54 | 55 | } 56 | 57 | 58 | void handler1 (int sig) { 59 | int esp; 60 | printf ("\nHandler 1: sig = %d\n", sig); 61 | //COPY_ESP_TO_VAR (esp); 62 | //printf ("\nHandler 1: ESP = %x\n", esp); 63 | return; 64 | } 65 | 66 | void handler2 (int sig) { 67 | printf ("\nHandler 2: sig = %d\n", sig); 68 | return; 69 | } 70 | 71 | void waste_time () { 72 | long int i, z; 73 | for (i=0L; i<1000000L; i++) 74 | z = i*i - (i+1)*(i+1); 75 | } 76 | -------------------------------------------------------------------------------- /lib-build/tools/stat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/stat -------------------------------------------------------------------------------- /lib-build/tools/stat.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0); 3 | 4 | #define stdout 1 5 | 6 | #define BUFSIZE 1024 7 | 8 | 9 | /* 10 | 11 | Ziel: Ausgabe wie bei OS X oder Linux 12 | 13 | [esser@macbookpro:ulix]$ stat -x diss-hgesser-ulix.tex 14 | File: "diss-hgesser-ulix.tex" 15 | Size: 961073 FileType: Regular File 16 | Mode: (0644/-rw-r--r--) Uid: ( 501/ esser) Gid: ( 20/ staff) 17 | Device: 14,2 Inode: 22119971 Links: 1 18 | Access: Tue Apr 22 13:57:50 2014 19 | Modify: Tue Apr 22 13:50:49 2014 20 | Change: Tue Apr 22 13:50:49 2014 21 | 22 | esser@minidebian:~/ulix$ LANG=C stat /tmp 23 | File: `/tmp' 24 | Size: 4096 Blocks: 8 IO Block: 4096 directory 25 | Device: 801h/2049d Inode: 560 Links: 4 26 | Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root) 27 | Access: 2014-04-22 12:12:45.063599007 +0200 28 | Modify: 2014-04-22 13:27:58.367338188 +0200 29 | Change: 2014-04-22 13:27:58.367338188 +0200 30 | Birth: - 31 | 32 | */ 33 | 34 | 35 | struct stat statbuf; 36 | 37 | int main (int argc, char* argv[]) { 38 | if (argc != 2) { 39 | printf ("stat: requires one argument\n"); 40 | return; 41 | } 42 | 43 | printf ("status information for %s\n", argv[1]); 44 | int res = stat (argv[1], &statbuf); 45 | if (res == -1) { 46 | printf ("Failed\n"); 47 | exit (1); 48 | } 49 | 50 | printf ("device: [%d:%d]\n", (statbuf.st_dev >> 8), statbuf.st_dev % 256); 51 | printf ("inode: %d\n", statbuf.st_ino); 52 | printf ("mode: %o\n", statbuf.st_mode); 53 | printf ("links: %d\n", statbuf.st_nlink); 54 | printf ("uid/gid: %d\n", statbuf.st_uid, statbuf.st_gid); 55 | printf ("rdev: %d\n", statbuf.st_rdev); 56 | printf ("size: %d\n", statbuf.st_size); 57 | printf ("atime: %d\n", statbuf.st_atime); 58 | printf ("mtime: %d\n", statbuf.st_mtime); 59 | printf ("ctime: %d\n", statbuf.st_ctime); 60 | return; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /lib-build/tools/stdio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/stdio -------------------------------------------------------------------------------- /lib-build/tools/stdio.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | #define O_RDONLY 0x0000 /* read only */ 4 | #define O_WRONLY 0x0001 /* write only */ 5 | #define O_RDWR 0x0002 /* read and write */ 6 | #define O_APPEND 0x0008 /* append mode */ 7 | #define O_CREAT 0x0200 /* create file */ 8 | 9 | #define string0 "Output via write (0, ...)\n" 10 | #define string1 "Output via write (1, ...)\n" 11 | #define string2 "Output via write (2, ...)\n" 12 | 13 | int main (int argc, char* argv[]) { 14 | printf ("Output via regular printf\n"); 15 | write (0, string0, strlen(string0)); 16 | write (1, string1, strlen(string1)); 17 | write (2, string2, strlen(string2)); 18 | 19 | close (1); // close stdout 20 | open ("/tmpfile", O_WRONLY | O_CREAT); 21 | write (1, string1, strlen(string1)); 22 | close (1); 23 | 24 | exit (0); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /lib-build/tools/su: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/su -------------------------------------------------------------------------------- /lib-build/tools/su.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main () { 4 | char password[32]; 5 | printf ("Enter root password: "); 6 | ureadline ((char*)&password, sizeof(password)-1, false); // no echo 7 | printf ("\n"); 8 | 9 | // int pid = fork(); 10 | // if (pid == 0) { 11 | // child 12 | 13 | if (login (0, password) == -1) { 14 | printf ("Login failed\n"); 15 | exit (1); 16 | } 17 | 18 | // exec shell 19 | char *args[] = { "/bin/sh", 0 }; 20 | execv (args[0], args); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib-build/tools/swapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/swapper -------------------------------------------------------------------------------- /lib-build/tools/swapper.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | // int main (int argc, char* argv[]) { 4 | int main () { 5 | int pid = getpid (); 6 | if (pid != 2) { 7 | printf ("swapper: don't start me manually.\n"); 8 | exit (1); 9 | } 10 | 11 | setterm (9); 12 | setpsname ("[swapper]"); 13 | int init_frames = get_free_frames (); 14 | int last_free_frames; 15 | int free_frames = init_frames; 16 | unsigned int counter = 0; 17 | 18 | #define THRESHOLD init_frames - 500 19 | 20 | for (;;) { 21 | last_free_frames = free_frames; 22 | free_frames = get_free_frames (); 23 | if (free_frames != last_free_frames) { 24 | printf ("[%d.%d] swapper: %d free frames. threshold = %d.", 25 | pid, counter++, free_frames, THRESHOLD); 26 | if (free_frames < THRESHOLD) { 27 | printf ("calling free_a_frame (%d < %d)\n", free_frames, init_frames - 500); 28 | free_a_frame (); 29 | } else { 30 | printf ("\n"); 31 | } 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /lib-build/tools/sync: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/sync -------------------------------------------------------------------------------- /lib-build/tools/sync.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int main (int argc, char* argv[]) { 4 | printf ("Syncing disks... "); 5 | sync (); 6 | printf ("done.\n"); 7 | exit (0); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /lib-build/tools/testcp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/testcp -------------------------------------------------------------------------------- /lib-build/tools/testcp.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | #define return exit(0) 3 | 4 | #define O_RDONLY 0x0000 /* read only */ 5 | #define O_WRONLY 0x0001 /* write only */ 6 | #define O_RDWR 0x0002 /* read and write */ 7 | #define O_APPEND 0x0008 /* append mode */ 8 | #define O_CREAT 0x0200 /* create file */ 9 | 10 | unsigned char buf[2048]; 11 | 12 | int main (int argc, char* argv[]) { 13 | int fd1, fd2, len; 14 | for (;;) { 15 | printf ("copying /mnt/a.txt to /mnt/b.txt\n"); 16 | fd1 = open("/mnt/a.txt", O_RDONLY); 17 | fd2 = open("/mnt/b.txt", O_WRONLY | O_CREAT); 18 | while ( (len = read (fd1, &buf, 2048)) > 0 ) { 19 | write (fd2, &buf, len); 20 | } 21 | close (fd1); 22 | close (fd2); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /lib-build/tools/thread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/thread -------------------------------------------------------------------------------- /lib-build/tools/thread.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | int counter = 0; 4 | int use_locks; 5 | pthread_t t1, t2, t3; 6 | pthread_mutex_t mut; 7 | 8 | int adder_finished = false; 9 | int subber_finished = false; 10 | 11 | void output (); 12 | void add (); 13 | void sub (); 14 | void delay (); 15 | 16 | void usage_and_exit (char *s) { 17 | printf ("%s: %s [01] (0 = no locks, 1 = locks)\n", s, s); 18 | exit (0); 19 | } 20 | 21 | int main (int argc, char* argv[]) { 22 | // if we don't call idle, qemu will have 100% CPU usage 23 | if (argc == 1) { usage_and_exit(argv[0]); } 24 | if (strequal(argv[1], "0")) use_locks = false; 25 | else if (strequal(argv[1], "1")) use_locks = true; 26 | else usage_and_exit (argv[0]); 27 | 28 | printf ("&counter = 0x%08x\n", &counter); 29 | printf ("[%d] I am the master process\n", gettid()); 30 | printf ("[%d] counter = %d (I am the PROCESS)\n", gettid(), counter); 31 | printf ("Going to call pthread_create (0x%08x)\n", output); 32 | 33 | if (use_locks) { 34 | pthread_mutex_init (&mut, 0); // init mutex 35 | printf ("mutex: %x\n", mut); 36 | } 37 | pthread_create (&t1, 0, (void*)output, 0); 38 | pthread_create (&t2, 0, (void*)add, 0); 39 | pthread_create (&t3, 0, (void*)sub, 0); 40 | printf ("after pthread_create. going to wait for completion\n"); 41 | 42 | /* 43 | int j; 44 | for(j=0; j<1500; j++) { 45 | // printf ("[%d] counter = %d (I am the PROCESS)\n", getpid(), counter); 46 | delay (); 47 | delay (); 48 | if (use_locks) { // with locks, it takes longer 49 | delay (); delay (); 50 | delay (); delay (); 51 | } 52 | } 53 | */ 54 | 55 | while (!adder_finished || !subber_finished) ; 56 | 57 | printf ("[%d] PROCESS EXIT, counter = %d\n", gettid(), counter); 58 | if (use_locks) 59 | pthread_mutex_destroy (&mut); 60 | // for (;;); 61 | exit (0); 62 | } 63 | 64 | void delay () { 65 | int i; 66 | for (i = 0; i < 50000; i++) ; 67 | } 68 | 69 | void output () { 70 | int j; 71 | for(j=0; j<50; j++) { 72 | // printf ("[%d] counter = %d (I am the THREAD)\n", getpid(), counter); 73 | delay (); 74 | } 75 | printf ("[%d] THREAD EXIT\n", gettid()); 76 | pthread_exit (); 77 | } 78 | 79 | void add () { 80 | int j, tmp; 81 | for(j=0; j<250; j++) { 82 | if (use_locks) pthread_mutex_lock (&mut); 83 | tmp = counter; 84 | delay (); 85 | tmp++; 86 | counter = tmp; 87 | printf ("[%d] counter++ = %d\n", gettid(), counter); 88 | if (use_locks) pthread_mutex_unlock (&mut); 89 | delay (); 90 | } 91 | printf ("[%d] THREAD EXIT\n", gettid()); 92 | adder_finished = true; 93 | pthread_exit (); 94 | } 95 | 96 | void sub () { 97 | int j, tmp; 98 | for(j=0; j<250; j++) { 99 | if (use_locks) pthread_mutex_lock (&mut); 100 | tmp = counter; 101 | delay (); 102 | tmp--; 103 | counter = tmp; 104 | printf ("[%d] counter-- = %d\n", gettid(), counter); 105 | if (use_locks) pthread_mutex_unlock (&mut); 106 | delay (); 107 | } 108 | printf ("[%d] THREAD EXIT\n", gettid()); 109 | subber_finished = true; 110 | pthread_exit (); 111 | } 112 | -------------------------------------------------------------------------------- /lib-build/tools/touch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/touch -------------------------------------------------------------------------------- /lib-build/tools/touch.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | #define O_RDONLY 0x0000 /* read only */ 4 | #define O_WRONLY 0x0001 /* write only */ 5 | #define O_RDWR 0x0002 /* read and write */ 6 | #define O_APPEND 0x0008 /* append mode */ 7 | #define O_CREAT 0x0200 /* create file */ 8 | 9 | 10 | int main (int argc, char* argv[]) { 11 | // this "touch" is broken, doesn't work with empty files 12 | int fd, err; 13 | 14 | if (argc<2) { 15 | printf ("touch: needs filename argument\n"); 16 | exit (1); // error 17 | } 18 | 19 | // try opening first 20 | fd = open (argv[1], O_RDWR); 21 | if (fd != -1) { 22 | // printf ("touch: file %s exists\n", argv[1]); 23 | // read first byte, write first byte 24 | char data[2]; 25 | if (read (fd, (char*)&data, 1) == 1) { 26 | // only write if we have read something 27 | lseek (fd, 0, SEEK_SET); 28 | write (fd, (char*)&data, 1); 29 | }; 30 | close (fd); 31 | exit (0); // success 32 | } 33 | 34 | // fd was -1 35 | err = errno; 36 | if (err == EACCES) { 37 | printf ("touch: %s: access denied\n", argv[1]); 38 | exit (1); // error 39 | } 40 | 41 | fd = open (argv[1], O_WRONLY | O_CREAT); 42 | if (fd == -1) { 43 | err = errno; 44 | printf ("touch: %s: cannot create file, ", argv[1]); 45 | switch (err) { 46 | case ENOENT: printf ("no such directory\n"); break; 47 | case EACCES: printf ("access denied\n"); break; 48 | default: printf ("unknown error\n"); break; 49 | } 50 | exit (1); // error 51 | } 52 | 53 | close (fd); 54 | // printf ("touch: file %s created.\n", argv[1]); 55 | exit (0); // success 56 | } 57 | 58 | -------------------------------------------------------------------------------- /lib-build/tools/tp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/tp -------------------------------------------------------------------------------- /lib-build/tools/tp.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | char test[1000*8192] __attribute__ ((aligned (4096))); 4 | 5 | int main () { 6 | printf ("Testing paging\n"); 7 | 8 | int i; 9 | for (i = 0; i < 1000*8192; i++) test[i] = 'B'; 10 | 11 | for (i = 0; i < 1000*8192 ; i+=8192) { 12 | unsigned int address = (unsigned int)(&test[i+5]); 13 | printf ("test[%d] = '%c', address = 0x%x\n", i+5, test[i+5], address); 14 | lib_page_out (address >> 12); 15 | sync (); 16 | } 17 | 18 | printf ("PHASE 1: DONE\n"); 19 | 20 | for (i = 0; i < 1000*8192 ; i+=8192) { 21 | unsigned int address = (unsigned int)(&test[i+5]); 22 | printf ("test[%d] = '%c', address = 0x%x\n", i+5, test[i+5], address); 23 | } 24 | 25 | /* 26 | address = (unsigned int)(&test[4100]); 27 | printf ("test[4100] = '%c', address = 0x%x\n", test[4100], address); 28 | sync (); 29 | lib_page_out (address >> 12); 30 | printf ("test[4100] = '%c', address = 0x%x\n", test[4100], address); 31 | */ 32 | 33 | exit (0); 34 | } 35 | -------------------------------------------------------------------------------- /lib-build/tools/tp.c.orig: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | char test[1000*8192] __attribute__ ((aligned (4096))); 4 | 5 | int main () { 6 | printf ("Testing paging\n"); 7 | 8 | test[5] = 'X'; 9 | test[4100] = 'Y'; 10 | 11 | for (;;) { 12 | unsigned int address = (unsigned int)(&test[5]); 13 | printf ("test[5] = '%c', address = 0x%x\n", test[5], address); 14 | lib_page_out (address >> 12); 15 | sync (); 16 | printf ("test[5] = '%c', address = 0x%x\n", test[5], address); 17 | 18 | address = (unsigned int)(&test[4100]); 19 | printf ("test[4100] = '%c', address = 0x%x\n", test[4100], address); 20 | sync (); 21 | lib_page_out (address >> 12); 22 | printf ("test[4100] = '%c', address = 0x%x\n", test[4100], address); 23 | } 24 | 25 | exit (0); 26 | } 27 | -------------------------------------------------------------------------------- /lib-build/tools/trunc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/trunc -------------------------------------------------------------------------------- /lib-build/tools/trunc.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | char emptyblock[1024] = { 0 }; 4 | #define FILENAME "testfile" 5 | 6 | int main () { 7 | 8 | int fd = open (FILENAME, O_RDWR | O_CREAT); 9 | printf ("fd = %d\n", fd); 10 | int i; 11 | for (i = 0; i < 4; i++) 12 | write (fd, (char*)emptyblock, 1024); 13 | printf ("wrote 4 KB\n"); 14 | close (fd); 15 | 16 | struct stat st; 17 | stat (FILENAME, &st); 18 | printf ("stat: size = %d\n", st.st_size); 19 | 20 | fd = open (FILENAME, O_RDWR); 21 | printf ("fd = %d\n", fd); 22 | ftruncate (fd, 512); 23 | printf ("called ftruncate (%d, 512)\n", fd); 24 | close (fd); 25 | 26 | stat (FILENAME, &st); 27 | printf ("stat: size = %d\n", st.st_size); 28 | 29 | exit (0); 30 | } -------------------------------------------------------------------------------- /lib-build/tools/tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/tt -------------------------------------------------------------------------------- /lib-build/tools/tt.c: -------------------------------------------------------------------------------- 1 | #include "../ulixlib.h" 2 | 3 | pthread_t t1, t2; 4 | 5 | void function (); 6 | 7 | int main (int argc, char* argv[]) { 8 | pthread_create (&t1, 0, (void*)function, 0); 9 | pthread_create (&t2, 0, (void*)function, 0); 10 | printf ("after pthread_create. going to wait for completion\n"); 11 | int i; 12 | for (i=0; i<9999999; i++) ; 13 | printf ("[%d] PROCESS EXIT\n", gettid()); 14 | pthread_exit (); // test 15 | // exit(0); 16 | } 17 | 18 | void function () { 19 | printf ("[%d] THREAD EXIT\n", gettid()); 20 | pthread_exit (); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /lib-build/tools/vi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/vi -------------------------------------------------------------------------------- /lib-build/tools/wc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/lib-build/tools/wc -------------------------------------------------------------------------------- /lib-build/tools/wc.c: -------------------------------------------------------------------------------- 1 | // wc 2 | 3 | // taken from the xv6 OS 4 | 5 | 6 | /* 7 | The xv6 software is: 8 | 9 | Copyright (c) 2006-2009 Frans Kaashoek, Robert Morris, Russ Cox, 10 | Massachusetts Institute of Technology 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | */ 31 | 32 | #include "../ulixlib.h" 33 | 34 | char buf[512]; 35 | 36 | // from ulib.c 37 | 38 | char* 39 | strchr(const char *s, char c) 40 | { 41 | for(; *s; s++) 42 | if(*s == c) 43 | return (char*) s; 44 | return 0; 45 | } 46 | 47 | void 48 | wc(int fd, char *name) 49 | { 50 | int i, n; 51 | int l, w, c, inword; 52 | 53 | l = w = c = 0; 54 | inword = 0; 55 | while((n = read(fd, buf, sizeof(buf))) > 0){ 56 | for(i=0; i tmp.nw 6 | nodefs -auto cee tmp.nw | sort -u > noweb.defs 7 | grep -v -f grep-patterns noweb.defs > noweb.filtered.defs 8 | noweave -indexfrom noweb.filtered.defs -delay tmp.nw > tmp.tex.in 9 | ./filter-uses.py < tmp.tex.in > tmp.tex 10 | sed -ie "s/SCRIPTBUILDDATE/`LANG=C date`/" tmp.tex 11 | sed -ie 's/<=/≤/g' tmp.tex 12 | sed -ie 's/>=/≥/g' tmp.tex 13 | sed -ie 's/<≥/<>=/' tmp.tex 14 | sed -ie 's/<≥/<>=/' tmp.tex 15 | 16 | # remove "_" in all IDENT_ comments (three times...) 17 | sed -ie 's|\(.*//.*\)\([a-zA-Z]*\)_ \(.*\)|\1\2 \3|' tmp.tex 18 | sed -ie 's|\(.*//.*\)\([a-zA-Z]*\)_ \(.*\)|\1\2 \3|' tmp.tex 19 | sed -ie 's|\(.*//.*\)\([a-zA-Z]*\)_ \(.*\)|\1\2 \3|' tmp.tex 20 | # once more if at end of line (line ends in '_}}') 21 | sed -ie 's|\(.*//.*\)\([a-zA-Z]*\)_}|\1\2}|' tmp.tex 22 | 23 | # processing 24 | $(TEX) tmp 25 | bibtex tmp 26 | makeindex -s diss.ist tmp.idx 27 | noindex tmp 28 | $(TEX) tmp 29 | $(TEX) tmp 30 | $(TEX) tmp 31 | mv tmp.pdf ../ulix-book.pdf 32 | 33 | clean: 34 | rm -f ./tmp.* noweb.defs noweb.filtered.defs 35 | 36 | -------------------------------------------------------------------------------- /tex-build/bchart.sty: -------------------------------------------------------------------------------- 1 | %------------------------------------------------------------------------------- 2 | % bchart (LaTeX package) 3 | %------------------------------------------------------------------------------- 4 | % Version: 0.1.2 5 | % Date: 22 August 2012 6 | % Author: Tobias Kuhn 7 | %------------------------------------------------------------------------------- 8 | 9 | \ProvidesPackage{bchart} 10 | 11 | \usepackage{ifthen} 12 | \usepackage{tikz} 13 | \usetikzlibrary{calc} 14 | 15 | 16 | % Lengths 17 | 18 | \newlength{\bcpos} 19 | \newlength{\bcwidth} 20 | 21 | 22 | % Global Arguments 23 | 24 | \newcommand{\bcfontstyle}{\sf} 25 | 26 | 27 | % Chart Arguments 28 | 29 | \newcommand{\bcunit}{} 30 | \newcommand{\bcmin}{} 31 | \newcommand{\bcmax}{} 32 | \newcommand{\bcstep}{} 33 | \newcommand{\bcsteps}{} 34 | \newcommand{\bcscale}{} 35 | \newcommand{\bcplainchart}{} 36 | \makeatletter 37 | \define@key{bchart}{unit}{\renewcommand{\bcunit}{#1}} 38 | \define@key{bchart}{width}{\setlength{\bcwidth}{#1}} 39 | \define@key{bchart}{min}{\renewcommand{\bcmin}{#1}} 40 | \define@key{bchart}{max}{\renewcommand{\bcmax}{#1}} 41 | \define@key{bchart}{step}{\renewcommand{\bcstep}{#1}} 42 | \define@key{bchart}{steps}{\renewcommand{\bcsteps}{#1}} 43 | \define@key{bchart}{scale}{\renewcommand{\bcscale}{#1}} 44 | \define@key{bchart}{plain}[false]{\renewcommand{\bcplainchart}{true}} 45 | \makeatother 46 | 47 | 48 | % Bar Arguments 49 | 50 | \newcommand{\bcbarcolor}{} 51 | \newcommand{\bcbartext}{} 52 | \newcommand{\bcbarlabel}{} 53 | \newcommand{\bcbarvalue}{} 54 | \newcommand{\bcplainbar}{} 55 | \makeatletter 56 | \define@key{bcbar}{color}{\renewcommand{\bcbarcolor}{#1}} 57 | \define@key{bcbar}{text}{\renewcommand{\bcbartext}{#1}} 58 | \define@key{bcbar}{label}{\renewcommand{\bcbarlabel}{#1}} 59 | \define@key{bcbar}{value}{\renewcommand{\bcbarvalue}{#1}} 60 | \define@key{bcbar}{plain}[false]{\renewcommand{\bcplainbar}{true}} 61 | \makeatother 62 | 63 | 64 | % Skip Arguments 65 | 66 | \newcommand{\bcskiplabel}{} 67 | \makeatletter 68 | \define@key{bcskip}{label}{\renewcommand{\bcskiplabel}{#1}} 69 | \makeatother 70 | 71 | 72 | % Bar Charts 73 | 74 | \newenvironment{bchart}[1][]{% 75 | % Bars: 76 | \newcommand{\bcbar}[2][]{ 77 | % Set defaults: 78 | \renewcommand{\bcbarcolor}{blue!20} 79 | \renewcommand{\bcbartext}{} 80 | \renewcommand{\bcbarlabel}{} 81 | \renewcommand{\bcbarvalue}{##2\bcunit} 82 | \renewcommand{\bcplainbar}{false} 83 | % Read parameters: 84 | \setkeys{bcbar}{##1} 85 | % Draw bar: 86 | \fill[color=\bcbarcolor,fill,draw] (0,\bcpos) rectangle ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-5mm)$); 87 | \draw (0,\bcpos) rectangle ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-5mm)$); 88 | \ifthenelse{\equal{\bcplainbar}{true}}{}{ 89 | % Write value: 90 | \node[anchor=west] at ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-2.5mm)$) {\bcfontstyle\bcbarvalue}; 91 | } 92 | % Write text: 93 | \node[anchor=west] at (0,\bcpos-2.5mm) {\bcfontstyle\bcbartext}; 94 | % Write label: 95 | \node[anchor=east] at (0,\bcpos-2.5mm) {\bcfontstyle\bcbarlabel}; 96 | % Move vertical position downward: 97 | \addtolength{\bcpos}{-5mm} 98 | }% 99 | % Labels: 100 | \newcommand{\bclabel}[1]{ 101 | % Write label: 102 | \node[anchor=east] at (0,\bcpos) {\bcfontstyle##1}; 103 | }% 104 | % General skips: 105 | \newcommand{\bcskip}[2][]{ 106 | % Set defaults: 107 | \renewcommand{\bcskiplabel}{} 108 | % Read parameters: 109 | \setkeys{bcskip}{##1} 110 | % Write label: 111 | \node[anchor=east] at ($(0,\bcpos) - 0.5*(0,##2)$) {\bcfontstyle\bcskiplabel}; 112 | % Move vertical position downward: 113 | \addtolength{\bcpos}{-##2} 114 | }% 115 | % Small skips: 116 | \renewcommand{\smallskip}[1][]{\bcskip[##1]{2.5mm}}% 117 | % Medium skips: 118 | \renewcommand{\medskip}[1][]{\bcskip[##1]{5.0mm}}% 119 | % Large skips: 120 | \renewcommand{\bigskip}[1][]{\bcskip[##1]{7.5mm}}% 121 | % X-axis label: 122 | \newcommand{\getbcxlabel}{}% 123 | \newcommand{\bcxlabel}[1]{ 124 | \renewcommand{\getbcxlabel}{##1} 125 | }% 126 | \newcommand{\bcrange}{\bcstripunit{\dimexpr\bcmax pt-\bcmin pt\relax}} 127 | % Set defaults: 128 | \renewcommand{\bcunit}{}% 129 | \renewcommand{\bcmin}{0}% 130 | \renewcommand{\bcmax}{100}% 131 | \renewcommand{\bcstep}{\bcrange}% 132 | \renewcommand{\bcsteps}{0,\bcstep,...,\bcrange}% 133 | \renewcommand{\bcscale}{1}% 134 | \renewcommand{\bcplainchart}{false}% 135 | \setlength{\bcpos}{-2.5mm}% 136 | \setlength{\bcwidth}{8cm}% 137 | % Read parameters: 138 | \setkeys{bchart}{#1}% 139 | % Draw chart: 140 | \begin{tikzpicture}[scale=\bcscale] 141 | }{ 142 | % Draw axes: 143 | \addtolength{\bcpos}{-2.5mm} 144 | \draw (0,\bcpos) -- (\bcwidth,\bcpos); 145 | \draw (0,0) -- (0,\bcpos); 146 | % Draw scale: 147 | \ifthenelse{\equal{\bcplainchart}{true}} 148 | { % Scale off 149 | % Set position for x-axis label: 150 | \coordinate (labelpos) at (0,\bcpos-2mm); 151 | }{ % Scale on 152 | % Draw start value and set position for x-axis label: 153 | \draw (0,\bcpos) -- (0,\bcpos-1mm); 154 | \node[anchor=north] (n) at (0,\bcpos-1mm) 155 | {\bcfontstyle\bcstripunit{\dimexpr\bcmin pt\relax}\bcunit}; 156 | \coordinate (labelpos) at (n.south); 157 | % Draw other values: 158 | \foreach \x in \bcsteps { 159 | \ifthenelse{\equal{\x}{0}}{}{ 160 | \draw ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos)$) -- ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos-1mm)$); 161 | \node[anchor=north] at ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos-1mm)$) 162 | {\bcfontstyle\bcstripunit{\dimexpr\bcmin pt+\x pt\relax}\bcunit}; 163 | } 164 | } 165 | } 166 | % Write x-axis label: 167 | \ifthenelse{\equal{\getbcxlabel}{}}{}{ 168 | \node[anchor=north,inner sep=0.5mm] at ($0.5*(\bcwidth,0) + (labelpos)$) {\bcfontstyle\getbcxlabel}; 169 | } 170 | \end{tikzpicture}% 171 | } 172 | 173 | 174 | % Auxiliary commands: 175 | 176 | \makeatletter 177 | \newcommand*{\bcstripunit}[1]{\strip@pt#1} 178 | \makeatother 179 | 180 | -------------------------------------------------------------------------------- /tex-build/diss.ist: -------------------------------------------------------------------------------- 1 | %% LaTeX2e file `./minitoc.ist' 2 | %% generated by the `filecontents' environment 3 | %% from source `minitoc' on 2008/07/16. 4 | %% 5 | %% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 6 | %% 2001 2002 2003 2004 2005 2006 2007 2008 7 | %% Jean-Pierre F. Drucbert 8 | %% 9 | %% 10 | %% This file may be distributed and/or modified under the conditions of 11 | %% the LaTeX Project Public License, either version 1.3 of this license 12 | %% or (at your option) any later version. The latest version of this 13 | %% license is in: 14 | %% 15 | %% http://www.latex-project.org/lppl.txt 16 | %% 17 | %% and version 1.3 or later is part of all distributions of LaTeX version 18 | %% 2003/12/01 or later. 19 | %% 20 | %% This work has the LPPL maintenance status "author-maintained". 21 | %% 22 | %% This Current Maintainer of this work is Jean-Pierre F. Drucbert. 23 | %% 24 | %% This work consists of all the files listed in the file `minitoc.l' 25 | %% distributed with it. 26 | %% \CharacterTable 27 | %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z 28 | %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z 29 | %% Digits \0\1\2\3\4\5\6\7\8\9 30 | %% Exclamation \! Double quote \" Hash (number) \# 31 | %% Dollar \$ Percent \% Ampersand \& 32 | %% Acute accent \' Left paren \( Right paren \) 33 | %% Asterisk \* Plus \+ Comma \, 34 | %% Minus \- Point \. Solidus \/ 35 | %% Colon \: Semicolon \; Less than \< 36 | %% Equals \= Greater than \> Question mark \? 37 | %% Commercial at \@ Left bracket \[ Backslash \\ 38 | %% Right bracket \] Circumflex \^ Underscore \_ 39 | %% Grave accent \` Left brace \{ Vertical bar \| 40 | %% Right brace \} Tilde \~} 41 | actual '@' 42 | quote '"' 43 | level '!' 44 | encap '|' 45 | preamble 46 | "\\begin{theindex}\\flushcolumns\\parindent=0pt \n \\makeatletter\n \\small\n" 47 | % \\scan@allowedfalse 48 | postamble 49 | "\n\\end{theindex}\n" 50 | item_x1 "\n \\subitem " 51 | item_x2 "\n \\subsubitem " 52 | delim_0 "\\dotfill " 53 | delim_1 "\\dotfill " 54 | delim_2 "\\dotfill " 55 | % The next lines will produce some warnings when 56 | % running Makeindex as they try to cover two different 57 | % versions of the program: 58 | %lethead_prefix "{\\lneed{8.5}\\vspace{\\baselineskip}\\large\\bfseries\\null\\relax " 59 | %lethead_suffix "\\hfill\\null}\\nopagebreak\\vspace*{\\baselineskip}\n" 60 | %lethead_flag 1 61 | heading_prefix "{\\lneed{2.5}\\large\\bfseries\\relax " 62 | heading_suffix "\\hfill\\null}\\nopagebreak\\vspace*{0.5\\baselineskip}\n" 63 | headings_flag 1 64 | %% 65 | %% 66 | %% End of file `minitoc.ist'. 67 | -------------------------------------------------------------------------------- /tex-build/filter-uses.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | 4 | import fileinput 5 | from re import sub 6 | 7 | deletemode = False 8 | codemode = False 9 | asmmode = False 10 | breakmode = False 11 | nosyntaxmode = False 12 | 13 | for line in fileinput.input(): 14 | line = line[:-1] # remove \n 15 | if line == "%nouse": 16 | deletemode = True 17 | # print "% DELETE MODE ON" 18 | 19 | if "%BEGIN ASM CHUNK" in line: 20 | asmmode = True 21 | 22 | if "%END ASM CHUNK" in line: 23 | asmmode = False 24 | 25 | if "%BEGIN NOSYNTAX" in line: 26 | nosyntaxmode = True 27 | 28 | if "%END NOSYNTAX" in line: 29 | nosyntaxmode = False 30 | 31 | if "%BREAK BEFORE DEFINES" in line: 32 | breakmode = True 33 | 34 | if "nwendcode" in line: 35 | codemode = False 36 | 37 | if breakmode and "nwindexdefn" in line: 38 | line = sub (r"\\nwindexdefn", r"\\pagebreak\\nwindexdefn", line) 39 | breakmode = False 40 | 41 | if not nosyntaxmode: 42 | 43 | if codemode == True: 44 | if asmmode == False: 45 | # highlight C comments 46 | line = sub (r"(//.*)$", r"\\Green{\\emph{\1}}", line) 47 | line = sub (r"/\*", r"\\Green{\\emph{/*", line) 48 | line = sub (r"\*/", r"*/}}", line) 49 | else: 50 | # highlight ASM comments 51 | line = sub (r"(;.*)$", r"\\Green{\\emph{\1}}", line) 52 | line = sub (r"\(", r"\\Lightblue{(}", line) 53 | line = sub (r"\)", r"\\Lightblue{)}", line) 54 | line = sub (r"\[", r"\\Red{[}", line) 55 | line = sub (r"\]", r"\\Red{]}", line) 56 | line = sub (r"!", r"\\Red{!}", line) 57 | line = sub (r"\\\{", r"\\Orange{\\{}", line) 58 | line = sub (r"\\\}", r"\\Orange{\\}}", line) 59 | for keyword in (r"#define", r"#include"): 60 | line = sub (keyword, r"\\emph{"+keyword+r"}", line) 61 | # for typ in (r"for ", r"if ", r"else ", r"void ", r"uint ", r"int ", r"char ", r"word ", r"byte ", r"unsigned ", r"short "): 62 | # line = sub (typ, r"\\textbf{"+typ+r"}", line) 63 | 64 | if "nwenddeflinemarkup" in line: 65 | codemode = True 66 | 67 | if deletemode and "nwidentuses" in line: 68 | line = sub (r"nwidentuses.*nwindexuse", r"nwindexuse", line) 69 | deletemode = False 70 | 71 | print line 72 | -------------------------------------------------------------------------------- /tex-build/grep-patterns: -------------------------------------------------------------------------------- 1 | uint 2 | __attribute 3 | that 4 | ^it 5 | ^i$ 6 | ^j$ 7 | max 8 | true 9 | false 10 | ^mem$ 11 | ^terminal$ 12 | ^vtno$ 13 | ^csr_x$ 14 | ^csr_y$ 15 | ^memptr$ 16 | ^state$ 17 | ^phys$ 18 | ^mfd$ 19 | ^count$ 20 | ^put$ 21 | ^inode$ 22 | ^add$ 23 | ^byte$ 24 | ^boolean$ 25 | inline 26 | ^target$ 27 | ^address$ 28 | ^fid$ 29 | ^pageno$ 30 | ^pdindex$ 31 | ^ptindex$ 32 | ^tmp$ 33 | ^fd$ 34 | ^error$ 35 | ^c$ 36 | ^u$ 37 | ^device$ 38 | ^addressptr$ 39 | ^entry$ 40 | ^word$ 41 | ^words$ 42 | ^fs$ 43 | ^also$ 44 | ^n$ 45 | ^files$ 46 | ^block$ 47 | ^virt$ 48 | ^endbyte$ 49 | ^startbyte$ 50 | ^pos$ 51 | ^st$ 52 | ^curblock$ 53 | ^read_bytes$ 54 | ^startblock$ 55 | ^endblock$ 56 | ^indirect_zone$ 57 | ^double_indirect_zone$ 58 | ^offset$ 59 | ^mode$ 60 | ^link$ 61 | ^length$ 62 | ^transfer_status$ 63 | ^sectors$ 64 | ^present$ 65 | ^s1$ 66 | ^s2$ 67 | ^frameno$ 68 | ^id$ 69 | ^program$ 70 | ^result$ 71 | ^exitcode$ 72 | ^waitfor$ 73 | ^cmdline$ 74 | ^blank$ 75 | ^rw$ 76 | ^us$ 77 | ^size$ 78 | ^index$ 79 | ^s$ 80 | ^localfd$ 81 | ^localpath$ 82 | ^empty_block$ 83 | ^int_ino$ 84 | ^ext_ino$ 85 | ^file_already_open$ 86 | ^written_bytes$ 87 | ^tmp_term$ 88 | ^show$ 89 | ^test$ 90 | ^save_i$ 91 | ^start_i$ 92 | ^reserved$ 93 | ^should$ 94 | ^filesystem$ 95 | ^tcb$ 96 | ^sz$ 97 | ^current_memsize$ 98 | ^needed_memsize$ 99 | -------------------------------------------------------------------------------- /tex-build/pics/8259-drawing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/8259-drawing.pdf -------------------------------------------------------------------------------- /tex-build/pics/8259-drawing2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/8259-drawing2.pdf -------------------------------------------------------------------------------- /tex-build/pics/Blue-punch-card-front-horiz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/Blue-punch-card-front-horiz.jpg -------------------------------------------------------------------------------- /tex-build/pics/Intel-Paging-Descriptors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/Intel-Paging-Descriptors.pdf -------------------------------------------------------------------------------- /tex-build/pics/Intel-Paging-Grafik.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/Intel-Paging-Grafik.pdf -------------------------------------------------------------------------------- /tex-build/pics/Process.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/Process.pdf -------------------------------------------------------------------------------- /tex-build/pics/ULIX-Logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ULIX-Logo.pdf -------------------------------------------------------------------------------- /tex-build/pics/ULIX-Logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ULIX-Logo2.png -------------------------------------------------------------------------------- /tex-build/pics/ULIX-Logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ULIX-Logo3.png -------------------------------------------------------------------------------- /tex-build/pics/a_lq6cty.enc: -------------------------------------------------------------------------------- 1 | % THIS FILE WAS AUTOMATICALLY GENERATED -- DO NOT EDIT 2 | 3 | %%AutoEnc_lq6ctyqho53d7mbegz3mqtaakg 4 | % Encoding created by otftotfm on Sat Aug 9 15:37:51 2014 5 | % Command line follows encoding 6 | /AutoEnc_lq6ctyqho53d7mbegz3mqtaakg [ 7 | %00 8 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 9 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 10 | %10 11 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 12 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 13 | %20 14 | /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright 15 | /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash 16 | %30 17 | /zero /one /two /three /four /five /six /seven 18 | /eight /nine /colon /semicolon /less /equal /greater /question 19 | %40 20 | /at /A /B /C /D /E /F /G 21 | /H /I /J /K /L /M /N /O 22 | %50 23 | /P /Q /R /S /T /U /V /W 24 | /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore 25 | %60 26 | /quoteleft /a /b /c /d /e /f /g 27 | /h /i /j /k /l /m /n /o 28 | %70 29 | /p /q /r /s /t /u /v /w 30 | /x /y /z /braceleft /bar /braceright /asciitilde /.notdef 31 | %80 32 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 33 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 34 | %90 35 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 36 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 37 | %A0 38 | /.notdef /exclamdown /cent /sterling /fraction /yen /florin /section 39 | /currency /quotesingle /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /f_i /f_l 40 | %B0 41 | /.notdef /endash /dagger /daggerdbl /periodcentered /.notdef /pilcrow /bullet 42 | /quotesinglbase /quotedblbase /quotedblright /guillemotright /ellipsis /perthousand /.notdef /questiondown 43 | %C0 44 | /.notdef /grave /acute /circumflex /tilde /macron /breve /dotaccent 45 | /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron 46 | %D0 47 | /emdash /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 48 | /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 49 | %E0 50 | /.notdef /AE /.notdef /ordfeminine /.notdef /.notdef /.notdef /.notdef 51 | /Lslash /Oslash /OE /ordmasculine /.notdef /.notdef /.notdef /.notdef 52 | %F0 53 | /.notdef /ae /.notdef /.notdef /.notdef /dotlessi /.notdef /.notdef 54 | /lslash /oslash /oe /germandbls /.notdef /.notdef /.notdef /.notdef 55 | ] def 56 | % Command line: 'otftotfm 57 | % /Users/esser/Downloads/Libertine/LinLibertine_R.otf' 58 | -------------------------------------------------------------------------------- /tex-build/pics/address-decoder-logic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/address-decoder-logic.pdf -------------------------------------------------------------------------------- /tex-build/pics/address-translation-using-page-descriptors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/address-translation-using-page-descriptors.pdf -------------------------------------------------------------------------------- /tex-build/pics/address-translation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/address-translation.pdf -------------------------------------------------------------------------------- /tex-build/pics/book-spine/buchruecken.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/book-spine/buchruecken.pdf -------------------------------------------------------------------------------- /tex-build/pics/buchruecken.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/buchruecken.pdf -------------------------------------------------------------------------------- /tex-build/pics/buddy-system-tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/buddy-system-tree.pdf -------------------------------------------------------------------------------- /tex-build/pics/burst-distribution-nehmer.dat: -------------------------------------------------------------------------------- 1 | 1 38 2 | 2 155 3 | 4 32 4 | 8 8 5 | 16 7 6 | 24 6 7 | 32 6 8 | 9 | -------------------------------------------------------------------------------- /tex-build/pics/burst-distribution-nehmer.gpl: -------------------------------------------------------------------------------- 1 | unset key 2 | set ytics 20 3 | set xtics 2 4 | set tics scale 0.75 5 | 6 | # set terminal pdf font "/Users/esser/Downloads/Libertine/LinLibertine_R.otf,9" 7 | # set terminal pdf font "/Users/esser/ulix/tex-build/pics/LinLibertineO.pfa,9" 8 | # set terminal pdf enh font "LinLibertineO,14" 9 | set terminal epslatex 10 | set o "burst-distribution-nehmer.tex" 11 | 12 | set xlabel "Length of CPU burst (ms)" 13 | set ylabel "Frequency" 14 | 15 | set border linewidth 1.5 16 | set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 pi -1 ps 1.5 17 | set pointintervalbox 3 18 | plot 'burst-distribution-nehmer.dat' with linespoints ls 1 19 | 20 | -------------------------------------------------------------------------------- /tex-build/pics/burst-distribution-nehmer.tex: -------------------------------------------------------------------------------- 1 | % GNUPLOT: LaTeX picture with Postscript 2 | \begingroup 3 | \makeatletter 4 | \providecommand\color[2][]{% 5 | \GenericError{(gnuplot) \space\space\space\@spaces}{% 6 | Package color not loaded in conjunction with 7 | terminal option `colourtext'% 8 | }{See the gnuplot documentation for explanation.% 9 | }{Either use 'blacktext' in gnuplot or load the package 10 | color.sty in LaTeX.}% 11 | \renewcommand\color[2][]{}% 12 | }% 13 | \providecommand\includegraphics[2][]{% 14 | \GenericError{(gnuplot) \space\space\space\@spaces}{% 15 | Package graphicx or graphics not loaded% 16 | }{See the gnuplot documentation for explanation.% 17 | }{The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.}% 18 | \renewcommand\includegraphics[2][]{}% 19 | }% 20 | \providecommand\rotatebox[2]{#2}% 21 | \@ifundefined{ifGPcolor}{% 22 | \newif\ifGPcolor 23 | \GPcolorfalse 24 | }{}% 25 | \@ifundefined{ifGPblacktext}{% 26 | \newif\ifGPblacktext 27 | \GPblacktexttrue 28 | }{}% 29 | % define a \g@addto@macro without @ in the name: 30 | \let\gplgaddtomacro\g@addto@macro 31 | % define empty templates for all commands taking text: 32 | \gdef\gplbacktext{}% 33 | \gdef\gplfronttext{}% 34 | \makeatother 35 | \ifGPblacktext 36 | % no textcolor at all 37 | \def\colorrgb#1{}% 38 | \def\colorgray#1{}% 39 | \else 40 | % gray or color? 41 | \ifGPcolor 42 | \def\colorrgb#1{\color[rgb]{#1}}% 43 | \def\colorgray#1{\color[gray]{#1}}% 44 | \expandafter\def\csname LTw\endcsname{\color{white}}% 45 | \expandafter\def\csname LTb\endcsname{\color{black}}% 46 | \expandafter\def\csname LTa\endcsname{\color{black}}% 47 | \expandafter\def\csname LT0\endcsname{\color[rgb]{1,0,0}}% 48 | \expandafter\def\csname LT1\endcsname{\color[rgb]{0,1,0}}% 49 | \expandafter\def\csname LT2\endcsname{\color[rgb]{0,0,1}}% 50 | \expandafter\def\csname LT3\endcsname{\color[rgb]{1,0,1}}% 51 | \expandafter\def\csname LT4\endcsname{\color[rgb]{0,1,1}}% 52 | \expandafter\def\csname LT5\endcsname{\color[rgb]{1,1,0}}% 53 | \expandafter\def\csname LT6\endcsname{\color[rgb]{0,0,0}}% 54 | \expandafter\def\csname LT7\endcsname{\color[rgb]{1,0.3,0}}% 55 | \expandafter\def\csname LT8\endcsname{\color[rgb]{0.5,0.5,0.5}}% 56 | \else 57 | % gray 58 | \def\colorrgb#1{\color{black}}% 59 | \def\colorgray#1{\color[gray]{#1}}% 60 | \expandafter\def\csname LTw\endcsname{\color{white}}% 61 | \expandafter\def\csname LTb\endcsname{\color{black}}% 62 | \expandafter\def\csname LTa\endcsname{\color{black}}% 63 | \expandafter\def\csname LT0\endcsname{\color{black}}% 64 | \expandafter\def\csname LT1\endcsname{\color{black}}% 65 | \expandafter\def\csname LT2\endcsname{\color{black}}% 66 | \expandafter\def\csname LT3\endcsname{\color{black}}% 67 | \expandafter\def\csname LT4\endcsname{\color{black}}% 68 | \expandafter\def\csname LT5\endcsname{\color{black}}% 69 | \expandafter\def\csname LT6\endcsname{\color{black}}% 70 | \expandafter\def\csname LT7\endcsname{\color{black}}% 71 | \expandafter\def\csname LT8\endcsname{\color{black}}% 72 | \fi 73 | \fi 74 | \setlength{\unitlength}{0.0500bp}% 75 | \begin{picture}(7200.00,5040.00)% 76 | \gplgaddtomacro\gplbacktext{% 77 | \csname LTb\endcsname% 78 | \put(946,704){\makebox(0,0)[r]{\strut{} 0}}% 79 | \put(946,1213){\makebox(0,0)[r]{\strut{} 20}}% 80 | \put(946,1722){\makebox(0,0)[r]{\strut{} 40}}% 81 | \put(946,2231){\makebox(0,0)[r]{\strut{} 60}}% 82 | \put(946,2740){\makebox(0,0)[r]{\strut{} 80}}% 83 | \put(946,3248){\makebox(0,0)[r]{\strut{} 100}}% 84 | \put(946,3757){\makebox(0,0)[r]{\strut{} 120}}% 85 | \put(946,4266){\makebox(0,0)[r]{\strut{} 140}}% 86 | \put(946,4775){\makebox(0,0)[r]{\strut{} 160}}% 87 | \put(1078,484){\makebox(0,0){\strut{} 0}}% 88 | \put(1436,484){\makebox(0,0){\strut{} 2}}% 89 | \put(1794,484){\makebox(0,0){\strut{} 4}}% 90 | \put(2151,484){\makebox(0,0){\strut{} 6}}% 91 | \put(2509,484){\makebox(0,0){\strut{} 8}}% 92 | \put(2867,484){\makebox(0,0){\strut{} 10}}% 93 | \put(3225,484){\makebox(0,0){\strut{} 12}}% 94 | \put(3583,484){\makebox(0,0){\strut{} 14}}% 95 | \put(3941,484){\makebox(0,0){\strut{} 16}}% 96 | \put(4298,484){\makebox(0,0){\strut{} 18}}% 97 | \put(4656,484){\makebox(0,0){\strut{} 20}}% 98 | \put(5014,484){\makebox(0,0){\strut{} 22}}% 99 | \put(5372,484){\makebox(0,0){\strut{} 24}}% 100 | \put(5730,484){\makebox(0,0){\strut{} 26}}% 101 | \put(6087,484){\makebox(0,0){\strut{} 28}}% 102 | \put(6445,484){\makebox(0,0){\strut{} 30}}% 103 | \put(6803,484){\makebox(0,0){\strut{} 32}}% 104 | \put(176,2739){\rotatebox{-270}{\makebox(0,0){\strut{}Frequency}}}% 105 | \put(3940,154){\makebox(0,0){\strut{}Length of CPU burst (ms)}}% 106 | }% 107 | \gplgaddtomacro\gplfronttext{% 108 | }% 109 | \gplbacktext 110 | \put(0,0){\includegraphics{pics/burst-distribution-nehmer}}% 111 | \gplfronttext 112 | \end{picture}% 113 | \endgroup 114 | -------------------------------------------------------------------------------- /tex-build/pics/clock-algorithm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/clock-algorithm.pdf -------------------------------------------------------------------------------- /tex-build/pics/code-chunks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/code-chunks.pdf -------------------------------------------------------------------------------- /tex-build/pics/compaction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/compaction.pdf -------------------------------------------------------------------------------- /tex-build/pics/eax-ax-al.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/eax-ax-al.pdf -------------------------------------------------------------------------------- /tex-build/pics/fau_logo_dina1_4c.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fau_logo_dina1_4c.pdf -------------------------------------------------------------------------------- /tex-build/pics/fork-tree-structure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fork-tree-structure.pdf -------------------------------------------------------------------------------- /tex-build/pics/forking.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/forking.pdf -------------------------------------------------------------------------------- /tex-build/pics/fragmentation-types.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fragmentation-types.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-content.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-content.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-content.png -------------------------------------------------------------------------------- /tex-build/pics/fs-unix-NEU.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-unix-NEU.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-unix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-unix.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-unix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-unix.png -------------------------------------------------------------------------------- /tex-build/pics/fs-windows-NEU.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-windows-NEU.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-windows.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-windows.pdf -------------------------------------------------------------------------------- /tex-build/pics/fs-windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/fs-windows.png -------------------------------------------------------------------------------- /tex-build/pics/gfd-lfd.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/gfd-lfd.pdf -------------------------------------------------------------------------------- /tex-build/pics/gfd-lfd.pdf.export: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/gfd-lfd.pdf.export -------------------------------------------------------------------------------- /tex-build/pics/hat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/hat.jpg -------------------------------------------------------------------------------- /tex-build/pics/identity-mapping-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/identity-mapping-1.pdf -------------------------------------------------------------------------------- /tex-build/pics/identity-mapping-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/identity-mapping-2.pdf -------------------------------------------------------------------------------- /tex-build/pics/identity-mapping-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/identity-mapping-3.pdf -------------------------------------------------------------------------------- /tex-build/pics/indirection-general-clipped.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/indirection-general-clipped.pdf -------------------------------------------------------------------------------- /tex-build/pics/indirection-general.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/indirection-general.pdf -------------------------------------------------------------------------------- /tex-build/pics/indirection-minix-double.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/indirection-minix-double.pdf -------------------------------------------------------------------------------- /tex-build/pics/indirection.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/indirection.pdf -------------------------------------------------------------------------------- /tex-build/pics/intentionally-left-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/intentionally-left-blank.png -------------------------------------------------------------------------------- /tex-build/pics/irq-stack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/irq-stack.pdf -------------------------------------------------------------------------------- /tex-build/pics/kernel-stacks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/kernel-stacks.pdf -------------------------------------------------------------------------------- /tex-build/pics/kernel-sync.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/kernel-sync.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyb-handler-vs-u-kill.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyb-handler-vs-u-kill.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-deutsch.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-deutsch.odg -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-deutsch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-deutsch.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-scancode-vector.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-scancode-vector.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-scancode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-scancode.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-scancode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-scancode.png -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-scancode.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-scancode.psd -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-us-vector.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-us-vector.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-us.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-us.odg -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-us.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-us.pdf -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-us.png -------------------------------------------------------------------------------- /tex-build/pics/keyboards/tastatur-us.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/keyboards/tastatur-us.psd -------------------------------------------------------------------------------- /tex-build/pics/linked-list-problems.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/linked-list-problems.pdf -------------------------------------------------------------------------------- /tex-build/pics/linked-list.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/linked-list.pdf -------------------------------------------------------------------------------- /tex-build/pics/lost-wakeup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/lost-wakeup.pdf -------------------------------------------------------------------------------- /tex-build/pics/minix-fs-structure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/minix-fs-structure.pdf -------------------------------------------------------------------------------- /tex-build/pics/minix-fs-structure.pdf.export: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/minix-fs-structure.pdf.export -------------------------------------------------------------------------------- /tex-build/pics/multi-level-page-table.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/multi-level-page-table.pdf -------------------------------------------------------------------------------- /tex-build/pics/mutexes-2cpu.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/mutexes-2cpu.pdf -------------------------------------------------------------------------------- /tex-build/pics/mutexes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/mutexes.pdf -------------------------------------------------------------------------------- /tex-build/pics/mx-who-calls-who.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/mx-who-calls-who.pdf -------------------------------------------------------------------------------- /tex-build/pics/noweb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/noweb.pdf -------------------------------------------------------------------------------- /tex-build/pics/organization-of-process-address-space-multi-stack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/organization-of-process-address-space-multi-stack.pdf -------------------------------------------------------------------------------- /tex-build/pics/organization-of-process-address-space.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/organization-of-process-address-space.pdf -------------------------------------------------------------------------------- /tex-build/pics/page-table-2layers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/page-table-2layers.pdf -------------------------------------------------------------------------------- /tex-build/pics/page-table-3layers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/page-table-3layers.pdf -------------------------------------------------------------------------------- /tex-build/pics/page-table-intel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/page-table-intel.pdf -------------------------------------------------------------------------------- /tex-build/pics/pages-and-page-frames.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/pages-and-page-frames.pdf -------------------------------------------------------------------------------- /tex-build/pics/partitioning-fixed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/partitioning-fixed.pdf -------------------------------------------------------------------------------- /tex-build/pics/partitioning-flexible.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/partitioning-flexible.pdf -------------------------------------------------------------------------------- /tex-build/pics/processor-hierarchy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/processor-hierarchy.pdf -------------------------------------------------------------------------------- /tex-build/pics/ready-queue-implementation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ready-queue-implementation.pdf -------------------------------------------------------------------------------- /tex-build/pics/sched-fcfs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sched-fcfs.pdf -------------------------------------------------------------------------------- /tex-build/pics/sched-priority.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sched-priority.pdf -------------------------------------------------------------------------------- /tex-build/pics/sched-rr-interaction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sched-rr-interaction.pdf -------------------------------------------------------------------------------- /tex-build/pics/sched-rr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sched-rr.pdf -------------------------------------------------------------------------------- /tex-build/pics/segment-selector.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/segment-selector.pdf -------------------------------------------------------------------------------- /tex-build/pics/segmentation-adder-limitcheck.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/segmentation-adder-limitcheck.pdf -------------------------------------------------------------------------------- /tex-build/pics/segmentation-adder-only.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/segmentation-adder-only.pdf -------------------------------------------------------------------------------- /tex-build/pics/simple-thread-state-model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/simple-thread-state-model.pdf -------------------------------------------------------------------------------- /tex-build/pics/stack-handler-entry-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/stack-handler-entry-2.pdf -------------------------------------------------------------------------------- /tex-build/pics/stack-handler-entry-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/stack-handler-entry-3.pdf -------------------------------------------------------------------------------- /tex-build/pics/stack-handler-entry.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/stack-handler-entry.pdf -------------------------------------------------------------------------------- /tex-build/pics/state-diagram-swapping.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/state-diagram-swapping.pdf -------------------------------------------------------------------------------- /tex-build/pics/state-diagram-ulixprocess.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/state-diagram-ulixprocess.pdf -------------------------------------------------------------------------------- /tex-build/pics/successful-page-translation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/successful-page-translation.pdf -------------------------------------------------------------------------------- /tex-build/pics/symlink-as-file-invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/symlink-as-file-invert.png -------------------------------------------------------------------------------- /tex-build/pics/symlink-as-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/symlink-as-file.png -------------------------------------------------------------------------------- /tex-build/pics/sync-functions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sync-functions.pdf -------------------------------------------------------------------------------- /tex-build/pics/sync-hierarchy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/sync-hierarchy.pdf -------------------------------------------------------------------------------- /tex-build/pics/time-multiplex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/time-multiplex.pdf -------------------------------------------------------------------------------- /tex-build/pics/translation-table.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/translation-table.pdf -------------------------------------------------------------------------------- /tex-build/pics/tree-structure-of-descriptors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/tree-structure-of-descriptors.pdf -------------------------------------------------------------------------------- /tex-build/pics/ulix-devel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ulix-devel.png -------------------------------------------------------------------------------- /tex-build/pics/ulix-ex01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ulix-ex01.png -------------------------------------------------------------------------------- /tex-build/pics/ulixos-website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/ulixos-website.png -------------------------------------------------------------------------------- /tex-build/pics/unix-plate/UNIX-Licence-Plate.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/unix-plate/UNIX-Licence-Plate.JPG -------------------------------------------------------------------------------- /tex-build/pics/unix-plate/titlepage-book.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/unix-plate/titlepage-book.odg -------------------------------------------------------------------------------- /tex-build/pics/unix-plate/titlepage-book.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/unix-plate/titlepage-book.pdf -------------------------------------------------------------------------------- /tex-build/pics/unix-plate/unix_plate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/unix-plate/unix_plate.jpg -------------------------------------------------------------------------------- /tex-build/pics/unix-plate/unix_plate.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/unix-plate/unix_plate.psd -------------------------------------------------------------------------------- /tex-build/pics/use-of-null-descriptors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/use-of-null-descriptors.pdf -------------------------------------------------------------------------------- /tex-build/pics/vfs-open.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/vfs-open.pdf -------------------------------------------------------------------------------- /tex-build/pics/vfs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/vfs.pdf -------------------------------------------------------------------------------- /tex-build/pics/weave-and-tangle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/tex-build/pics/weave-and-tangle.pdf -------------------------------------------------------------------------------- /tex-build/zi4.sty: -------------------------------------------------------------------------------- 1 | % Copyright 2013 Michael Sharpe 2 | % Based initially on Karl Berry's inconsolata.sty. 3 | % You may freely use, modify and/or distribute this file. 4 | 5 | \NeedsTeXFormat{LaTeX2e} 6 | \ProvidesPackage{zi4}[2013/06/09 zi4a] 7 | 8 | \RequirePackage{textcomp} 9 | \RequirePackage{keyval} 10 | 11 | \newcount\zifour@ocount 12 | \newif\ifzifour@altzero 13 | \newif\ifzifour@noupq 14 | \define@key{zifour}{scaled}[1.0]{\def\zifour@scaled{s*[#1]}} 15 | 16 | \DeclareOption*{% 17 | \begingroup 18 | \edef\x{\endgroup 19 | \noexpand\setkeys{zifour}{\CurrentOption}}% 20 | \x} 21 | 22 | % by default, change \tt to mean zi4. 23 | \newcommand*{\zifour@default}{% 24 | \renewcommand*{\ttdefault}{zi4}% 25 | } 26 | 27 | % option [nott] to avoid changing tt. 28 | \DeclareOption{nott}{% 29 | \renewcommand*{\zifour@default}{}% 30 | } 31 | % option [noupquote] to prevent loading upquote. 32 | \DeclareOption{noupquote}{% 33 | \zifour@noupqtrue}% 34 | 35 | % option var0---use unslashed zero (slashed is default) 36 | \DeclareOption{var0}{% 37 | \zifour@altzerotrue\advance\zifour@ocount \tw@ % 38 | } 39 | \DeclareOption{varl}{% 40 | \advance\zifour@ocount \@ne % 41 | } 42 | \DeclareOption{varqu}{% 43 | \advance\zifour@ocount 4\relax % 44 | } 45 | 46 | \ProcessOptions* 47 | \zifour@default 48 | \edef\zifour@opt{\the\zifour@ocount} 49 | \ifzifour@altzero 50 | \advance\zifour@ocount -\tw@ 51 | \else 52 | \advance\zifour@ocount \tw@ 53 | \fi 54 | \edef\zifour@altopt{\the\zifour@ocount} 55 | % define an \altzero macro which flips to slashed, unslashed 56 | \def\altzero{{\fontfamily{zi4}% 57 | \fontshape{scit}% 58 | \selectfont 0}} 59 | 60 | \def\zifour@T@ne@nc{T1} 61 | \def\zifour@OT@ne@nc{OT1} 62 | \def\zifour@LY@ne@nc{LY1} 63 | \def\zifour@QX@nc{QX} 64 | \def\zifour@TQS{% 65 | \UndeclareTextCommand{\textquotesingle}{\encodingdefault} 66 | \DeclareTextSymbol{\textquotesingle}{TS1}{39}} 67 | 68 | \ifzifour@noupq% do nothing 69 | % Try to correct for wrong slots for QX 70 | \ifx\encodingdefault\zifour@QX@nc 71 | \zifour@TQS 72 | \else 73 | \ifx\encodingdefault\zifour@LY@ne@nc 74 | \zifour@TQS 75 | \fi 76 | \fi 77 | \else 78 | \AtBeginDocument{% 79 | \ifx\encodingdefault\zifour@T@ne@nc % do nothing 80 | \else 81 | \ifx\encodingdefault\zifour@OT@ne@nc % do nothing 82 | \else 83 | \zifour@TQS 84 | \fi 85 | \fi 86 | \usepackage{upquote}} 87 | \fi 88 | 89 | \endinput 90 | -------------------------------------------------------------------------------- /ulix-book.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgesser/ulix/32535a19a1a25bdd2b52e269de52bc1930c73fbb/ulix-book.pdf --------------------------------------------------------------------------------