├── Lab10-Mmap ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── fcntl.h │ ├── entry.S │ ├── syscall.h │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab11-Network ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── packets.pcap ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── entry.S │ ├── param.h │ └── syscall.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore ├── ping.py ├── .editorconfig └── server.py ├── Lab4-Traps ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── entry.S │ ├── syscall.h │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── bttest.c │ ├── zombie.c │ ├── call.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab8-Lock ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── types.h │ ├── spinlock.h │ ├── sleeplock.h │ ├── buf.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── stats.c │ ├── rm.c │ ├── mkdir.c │ ├── statistics.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab3-Page Tables ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── stats.c │ ├── rm.c │ ├── mkdir.c │ ├── statistics.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab9-File System ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ └── entry.S ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab2-System Calls ├── conf │ └── lab.mk ├── user │ ├── usys.d │ ├── initcode.d │ ├── ln.d │ ├── rm.d │ ├── wc.d │ ├── cat.d │ ├── sh.d │ ├── echo.d │ ├── grep.d │ ├── kill.d │ ├── mkdir.d │ ├── ls.d │ ├── zombie.d │ ├── _cat │ ├── _ln │ ├── _ls │ ├── _rm │ ├── _sh │ ├── _wc │ ├── forktest.d │ ├── ln.o │ ├── ls.o │ ├── rm.o │ ├── sh.o │ ├── wc.o │ ├── _echo │ ├── _find │ ├── _grep │ ├── _grind │ ├── _init │ ├── _kill │ ├── _mkdir │ ├── _primes │ ├── _sleep │ ├── _trace │ ├── _xargs │ ├── _zombie │ ├── cat.o │ ├── echo.o │ ├── grep.o │ ├── grind.o │ ├── init.o │ ├── kill.o │ ├── mkdir.o │ ├── trace.o │ ├── ulib.o │ ├── usys.o │ ├── _forktest │ ├── _pingpong │ ├── _stressfs │ ├── initcode │ ├── printf.o │ ├── ulib.d │ ├── umalloc.o │ ├── zombie.o │ ├── _sysinfotest │ ├── _usertests │ ├── forktest.o │ ├── initcode.o │ ├── initcode.out │ ├── stressfs.o │ ├── trace.d │ ├── usertests.o │ ├── sysinfotest.o │ ├── umalloc.d │ ├── stressfs.d │ ├── sysinfotest.d │ ├── xargstest.sh │ ├── printf.d │ ├── init.d │ ├── grind.d │ ├── usertests.d │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── trace.c │ ├── cat.c │ └── usys.pl ├── kernel │ ├── string.d │ ├── bio.o │ ├── fs.o │ ├── log.o │ ├── vm.o │ ├── entry.o │ ├── exec.o │ ├── file.o │ ├── kernel │ ├── main.o │ ├── pipe.o │ ├── plic.o │ ├── proc.o │ ├── start.o │ ├── swtch.o │ ├── trap.o │ ├── uart.o │ ├── console.o │ ├── kalloc.o │ ├── printf.o │ ├── spinlock.o │ ├── string.o │ ├── syscall.o │ ├── sysfile.o │ ├── sysproc.o │ ├── kernelvec.o │ ├── sleeplock.o │ ├── trampoline.o │ ├── virtio_disk.o │ ├── main.d │ ├── plic.d │ ├── start.d │ ├── date.h │ ├── sysinfo.h │ ├── vm.d │ ├── fcntl.h │ ├── kalloc.d │ ├── proc.d │ ├── trap.d │ ├── uart.d │ ├── bio.d │ ├── log.d │ ├── exec.d │ ├── spinlock.d │ ├── pipe.d │ ├── syscall.d │ ├── sleeplock.d │ ├── file.d │ ├── sysproc.d │ ├── fs.d │ ├── virtio_disk.d │ ├── sysfile.d │ ├── spinlock.h │ ├── console.d │ ├── printf.d │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── entry.S │ ├── syscall.h │ └── param.h ├── fs.img ├── mkfs │ └── mkfs ├── .dir-locals.el ├── __pycache__ │ └── gradelib.cpython-38.pyc ├── .gdbinit ├── .gdbinit.tmpl-riscv ├── xv6.out └── .editorconfig ├── Lab6-Copy-on-Write Fork ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab7-Multithreading ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── uthread_switch.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig ├── Lab1-Xv6 and Unix utilities ├── conf │ └── lab.mk ├── user │ ├── usys.d │ ├── initcode.d │ ├── ln.d │ ├── rm.d │ ├── wc.d │ ├── cat.d │ ├── sh.d │ ├── echo.d │ ├── grep.d │ ├── kill.d │ ├── mkdir.d │ ├── sleep.d │ ├── ls.d │ ├── primes.d │ ├── zombie.d │ ├── forktest.d │ ├── pingpong.d │ ├── find.d │ ├── _cat │ ├── _ln │ ├── _ls │ ├── _rm │ ├── _sh │ ├── _wc │ ├── ln.o │ ├── ls.o │ ├── rm.o │ ├── sh.o │ ├── ulib.d │ ├── wc.o │ ├── xargs.d │ ├── _echo │ ├── _find │ ├── _grep │ ├── _grind │ ├── _init │ ├── _kill │ ├── _mkdir │ ├── _primes │ ├── _sleep │ ├── _xargs │ ├── _zombie │ ├── cat.o │ ├── echo.o │ ├── find.o │ ├── grep.o │ ├── grind.o │ ├── init.o │ ├── kill.o │ ├── mkdir.o │ ├── sleep.o │ ├── ulib.o │ ├── usys.o │ ├── xargs.o │ ├── _forktest │ ├── _pingpong │ ├── _stressfs │ ├── initcode │ ├── primes.o │ ├── printf.o │ ├── umalloc.d │ ├── umalloc.o │ ├── zombie.o │ ├── _usertests │ ├── forktest.o │ ├── initcode.o │ ├── initcode.out │ ├── pingpong.o │ ├── stressfs.o │ ├── usertests.o │ ├── stressfs.d │ ├── xargstest.sh │ ├── printf.d │ ├── init.d │ ├── grind.d │ ├── usertests.d │ ├── sleep.c │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── kernel │ ├── string.d │ ├── bio.o │ ├── fs.o │ ├── log.o │ ├── vm.o │ ├── entry.o │ ├── exec.o │ ├── file.o │ ├── kernel │ ├── main.o │ ├── pipe.o │ ├── plic.o │ ├── proc.o │ ├── start.o │ ├── swtch.o │ ├── trap.o │ ├── uart.o │ ├── console.o │ ├── kalloc.o │ ├── printf.o │ ├── spinlock.o │ ├── string.o │ ├── syscall.o │ ├── sysfile.o │ ├── sysproc.o │ ├── kernelvec.o │ ├── sleeplock.o │ ├── trampoline.o │ ├── virtio_disk.o │ ├── main.d │ ├── plic.d │ ├── start.d │ ├── date.h │ ├── vm.d │ ├── fcntl.h │ ├── kalloc.d │ ├── proc.d │ ├── trap.d │ ├── uart.d │ ├── bio.d │ ├── log.d │ ├── exec.d │ ├── spinlock.d │ ├── sysproc.d │ ├── pipe.d │ ├── syscall.d │ ├── sleeplock.d │ ├── file.d │ ├── fs.d │ ├── virtio_disk.d │ ├── sysfile.d │ ├── spinlock.h │ ├── console.d │ ├── printf.d │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── fs.img ├── mkfs │ └── mkfs ├── .dir-locals.el ├── .gdbinit ├── __pycache__ │ └── gradelib.cpython-38.pyc ├── .gdbinit.tmpl-riscv ├── xv6.out └── .editorconfig ├── Lab5-Lazy Page Allocation ├── conf │ └── lab.mk ├── mkfs │ └── mkfs ├── .dir-locals.el ├── kernel │ ├── date.h │ ├── fcntl.h │ ├── spinlock.h │ ├── types.h │ ├── buf.h │ ├── sleeplock.h │ ├── stat.h │ ├── syscall.h │ ├── entry.S │ └── param.h ├── .gdbinit.tmpl-riscv ├── user │ ├── zombie.c │ ├── kill.c │ ├── ln.c │ ├── echo.c │ ├── rm.c │ ├── mkdir.c │ ├── initcode.S │ ├── cat.c │ └── usys.pl ├── .gitignore └── .editorconfig └── .vscode └── settings.json /Lab10-Mmap/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=mmap 2 | -------------------------------------------------------------------------------- /Lab11-Network/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=net 2 | -------------------------------------------------------------------------------- /Lab4-Traps/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=traps 2 | -------------------------------------------------------------------------------- /Lab8-Lock/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=lock 2 | -------------------------------------------------------------------------------- /Lab3-Page Tables/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=pgtbl 2 | -------------------------------------------------------------------------------- /Lab9-File System/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=fs 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=syscall 2 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=cow 2 | -------------------------------------------------------------------------------- /Lab7-Multithreading/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=thread 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=util 2 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/conf/lab.mk: -------------------------------------------------------------------------------- 1 | LAB=lazy 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/usys.d: -------------------------------------------------------------------------------- 1 | user/usys.o: user/usys.S kernel/syscall.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/usys.d: -------------------------------------------------------------------------------- 1 | user/usys.o: user/usys.S kernel/syscall.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/string.d: -------------------------------------------------------------------------------- 1 | kernel/string.o: kernel/string.c kernel/types.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/initcode.d: -------------------------------------------------------------------------------- 1 | user/initcode.o: user/initcode.S kernel/syscall.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/ln.d: -------------------------------------------------------------------------------- 1 | user/ln.o: user/ln.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/rm.d: -------------------------------------------------------------------------------- 1 | user/rm.o: user/rm.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/wc.d: -------------------------------------------------------------------------------- 1 | user/wc.o: user/wc.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/string.d: -------------------------------------------------------------------------------- 1 | kernel/string.o: kernel/string.c kernel/types.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/initcode.d: -------------------------------------------------------------------------------- 1 | user/initcode.o: user/initcode.S kernel/syscall.h 2 | -------------------------------------------------------------------------------- /Lab10-Mmap/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab10-Mmap/mkfs/mkfs -------------------------------------------------------------------------------- /Lab2-System Calls/user/cat.d: -------------------------------------------------------------------------------- 1 | user/cat.o: user/cat.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/sh.d: -------------------------------------------------------------------------------- 1 | user/sh.o: user/sh.c kernel/types.h user/user.h kernel/fcntl.h 2 | -------------------------------------------------------------------------------- /Lab4-Traps/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab4-Traps/mkfs/mkfs -------------------------------------------------------------------------------- /Lab8-Lock/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab8-Lock/mkfs/mkfs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ln.d: -------------------------------------------------------------------------------- 1 | user/ln.o: user/ln.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/rm.d: -------------------------------------------------------------------------------- 1 | user/rm.o: user/rm.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/wc.d: -------------------------------------------------------------------------------- 1 | user/wc.o: user/wc.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/echo.d: -------------------------------------------------------------------------------- 1 | user/echo.o: user/echo.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/grep.d: -------------------------------------------------------------------------------- 1 | user/grep.o: user/grep.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/kill.d: -------------------------------------------------------------------------------- 1 | user/kill.o: user/kill.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/mkdir.d: -------------------------------------------------------------------------------- 1 | user/mkdir.o: user/mkdir.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/cat.d: -------------------------------------------------------------------------------- 1 | user/cat.o: user/cat.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/sh.d: -------------------------------------------------------------------------------- 1 | user/sh.o: user/sh.c kernel/types.h user/user.h kernel/fcntl.h 2 | -------------------------------------------------------------------------------- /Lab11-Network/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab11-Network/mkfs/mkfs -------------------------------------------------------------------------------- /Lab2-System Calls/fs.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/fs.img -------------------------------------------------------------------------------- /Lab2-System Calls/user/ls.d: -------------------------------------------------------------------------------- 1 | user/ls.o: user/ls.c kernel/types.h kernel/stat.h user/user.h kernel/fs.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/zombie.d: -------------------------------------------------------------------------------- 1 | user/zombie.o: user/zombie.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/echo.d: -------------------------------------------------------------------------------- 1 | user/echo.o: user/echo.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/grep.d: -------------------------------------------------------------------------------- 1 | user/grep.o: user/grep.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/kill.d: -------------------------------------------------------------------------------- 1 | user/kill.o: user/kill.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/mkdir.d: -------------------------------------------------------------------------------- 1 | user/mkdir.o: user/mkdir.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/sleep.d: -------------------------------------------------------------------------------- 1 | user/sleep.o: user/sleep.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab11-Network/packets.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab11-Network/packets.pcap -------------------------------------------------------------------------------- /Lab2-System Calls/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/mkfs/mkfs -------------------------------------------------------------------------------- /Lab2-System Calls/user/_cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_cat -------------------------------------------------------------------------------- /Lab2-System Calls/user/_ln: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_ln -------------------------------------------------------------------------------- /Lab2-System Calls/user/_ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_ls -------------------------------------------------------------------------------- /Lab2-System Calls/user/_rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_rm -------------------------------------------------------------------------------- /Lab2-System Calls/user/_sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_sh -------------------------------------------------------------------------------- /Lab2-System Calls/user/_wc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_wc -------------------------------------------------------------------------------- /Lab2-System Calls/user/forktest.d: -------------------------------------------------------------------------------- 1 | user/forktest.o: user/forktest.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/ln.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/ln.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/ls.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/ls.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/rm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/rm.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/sh.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/sh.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/wc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/wc.o -------------------------------------------------------------------------------- /Lab3-Page Tables/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab3-Page Tables/mkfs/mkfs -------------------------------------------------------------------------------- /Lab9-File System/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab9-File System/mkfs/mkfs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ls.d: -------------------------------------------------------------------------------- 1 | user/ls.o: user/ls.c kernel/types.h kernel/stat.h user/user.h kernel/fs.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/primes.d: -------------------------------------------------------------------------------- 1 | user/primes.o: user/primes.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/zombie.d: -------------------------------------------------------------------------------- 1 | user/zombie.o: user/zombie.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/bio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/bio.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/fs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/fs.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/log.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/log.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/vm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/vm.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/_echo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_echo -------------------------------------------------------------------------------- /Lab2-System Calls/user/_find: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_find -------------------------------------------------------------------------------- /Lab2-System Calls/user/_grep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_grep -------------------------------------------------------------------------------- /Lab2-System Calls/user/_grind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_grind -------------------------------------------------------------------------------- /Lab2-System Calls/user/_init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_init -------------------------------------------------------------------------------- /Lab2-System Calls/user/_kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_kill -------------------------------------------------------------------------------- /Lab2-System Calls/user/_mkdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_mkdir -------------------------------------------------------------------------------- /Lab2-System Calls/user/_primes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_primes -------------------------------------------------------------------------------- /Lab2-System Calls/user/_sleep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_sleep -------------------------------------------------------------------------------- /Lab2-System Calls/user/_trace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_trace -------------------------------------------------------------------------------- /Lab2-System Calls/user/_xargs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_xargs -------------------------------------------------------------------------------- /Lab2-System Calls/user/_zombie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_zombie -------------------------------------------------------------------------------- /Lab2-System Calls/user/cat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/cat.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/echo.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/echo.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/grep.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/grep.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/grind.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/grind.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/init.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/init.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/kill.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/kill.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/mkdir.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/mkdir.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/trace.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/trace.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/ulib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/ulib.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/usys.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/usys.o -------------------------------------------------------------------------------- /Lab7-Multithreading/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab7-Multithreading/mkfs/mkfs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/forktest.d: -------------------------------------------------------------------------------- 1 | user/forktest.o: user/forktest.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/pingpong.d: -------------------------------------------------------------------------------- 1 | user/pingpong.o: user/pingpong.c kernel/types.h kernel/stat.h user/user.h 2 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/entry.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/entry.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/exec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/exec.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/file.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/file.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/kernel -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/main.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/pipe.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/pipe.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/plic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/plic.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/proc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/proc.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/start.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/start.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/swtch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/swtch.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/trap.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/trap.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/uart.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/uart.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/_forktest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_forktest -------------------------------------------------------------------------------- /Lab2-System Calls/user/_pingpong: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_pingpong -------------------------------------------------------------------------------- /Lab2-System Calls/user/_stressfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_stressfs -------------------------------------------------------------------------------- /Lab2-System Calls/user/initcode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/initcode -------------------------------------------------------------------------------- /Lab2-System Calls/user/printf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/printf.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/ulib.d: -------------------------------------------------------------------------------- 1 | user/ulib.o: user/ulib.c kernel/types.h kernel/stat.h kernel/fcntl.h \ 2 | user/user.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/umalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/umalloc.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/zombie.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/zombie.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/fs.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/fs.img -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/find.d: -------------------------------------------------------------------------------- 1 | user/find.o: user/find.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/fs.h 3 | -------------------------------------------------------------------------------- /Lab10-Mmap/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/console.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/console.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/kalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/kalloc.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/printf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/printf.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/spinlock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/spinlock.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/string.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/string.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/syscall.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/syscall.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sysfile.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/sysfile.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sysproc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/sysproc.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/_sysinfotest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_sysinfotest -------------------------------------------------------------------------------- /Lab2-System Calls/user/_usertests: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/_usertests -------------------------------------------------------------------------------- /Lab2-System Calls/user/forktest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/forktest.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/initcode.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/initcode.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/initcode.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/initcode.out -------------------------------------------------------------------------------- /Lab2-System Calls/user/stressfs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/stressfs.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/trace.d: -------------------------------------------------------------------------------- 1 | user/trace.o: user/trace.c kernel/param.h kernel/types.h kernel/stat.h \ 2 | user/user.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/usertests.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/usertests.o -------------------------------------------------------------------------------- /Lab4-Traps/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab5-Lazy Page Allocation/mkfs/mkfs -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab6-Copy-on-Write Fork/mkfs/mkfs -------------------------------------------------------------------------------- /Lab8-Lock/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/mkfs/mkfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/mkfs/mkfs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_cat -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_ln: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_ln -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_ls -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_rm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_rm -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_sh -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_wc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_wc -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ln.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/ln.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ls.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/ls.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/rm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/rm.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/sh.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/sh.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ulib.d: -------------------------------------------------------------------------------- 1 | user/ulib.o: user/ulib.c kernel/types.h kernel/stat.h kernel/fcntl.h \ 2 | user/user.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/wc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/wc.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/xargs.d: -------------------------------------------------------------------------------- 1 | user/xargs.o: user/xargs.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/fs.h 3 | -------------------------------------------------------------------------------- /Lab11-Network/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/kernelvec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/kernelvec.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sleeplock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/sleeplock.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/trampoline.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/trampoline.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/sysinfotest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/user/sysinfotest.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/umalloc.d: -------------------------------------------------------------------------------- 1 | user/umalloc.o: user/umalloc.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/param.h 3 | -------------------------------------------------------------------------------- /Lab3-Page Tables/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab9-File System/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/bio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/bio.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/fs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/fs.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/log.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/log.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/vm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/vm.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_echo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_echo -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_find: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_find -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_grep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_grep -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_grind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_grind -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_init -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_kill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_kill -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_mkdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_mkdir -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_primes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_primes -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_sleep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_sleep -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_xargs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_xargs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_zombie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_zombie -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/cat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/cat.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/echo.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/echo.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/find.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/find.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/grep.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/grep.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/grind.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/grind.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/init.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/init.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/kill.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/kill.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/mkdir.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/mkdir.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/sleep.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/sleep.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/ulib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/ulib.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/usys.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/usys.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/xargs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/xargs.o -------------------------------------------------------------------------------- /Lab2-System Calls/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/virtio_disk.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/kernel/virtio_disk.o -------------------------------------------------------------------------------- /Lab7-Multithreading/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/entry.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/entry.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/exec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/exec.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/file.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/file.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/kernel -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/main.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/pipe.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/pipe.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/plic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/plic.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/proc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/proc.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/start.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/start.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/swtch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/swtch.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/trap.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/trap.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/uart.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/uart.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_forktest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_forktest -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_pingpong: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_pingpong -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_stressfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_stressfs -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/initcode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/initcode -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/primes.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/primes.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/printf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/printf.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/umalloc.d: -------------------------------------------------------------------------------- 1 | user/umalloc.o: user/umalloc.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/param.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/umalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/umalloc.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/zombie.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/zombie.o -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((c-mode 2 | (indent-tabs-mode . nil) 3 | (c-file-style . "bsd") 4 | (c-basic-offset . 2))) 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/console.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/console.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/kalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/kalloc.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/printf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/printf.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/spinlock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/spinlock.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/string.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/string.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/syscall.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/syscall.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sysfile.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/sysfile.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sysproc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/sysproc.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/_usertests: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/_usertests -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/forktest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/forktest.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/initcode.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/initcode.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/initcode.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/initcode.out -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/pingpong.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/pingpong.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/stressfs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/stressfs.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/usertests.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/user/usertests.o -------------------------------------------------------------------------------- /Lab2-System Calls/user/stressfs.d: -------------------------------------------------------------------------------- 1 | user/stressfs.o: user/stressfs.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/fs.h kernel/fcntl.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/sysinfotest.d: -------------------------------------------------------------------------------- 1 | user/sysinfotest.o: user/sysinfotest.c kernel/types.h kernel/riscv.h \ 2 | kernel/sysinfo.h user/user.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/kernelvec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/kernelvec.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sleeplock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/sleeplock.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/trampoline.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/trampoline.o -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/main.d: -------------------------------------------------------------------------------- 1 | kernel/main.o: kernel/main.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/plic.d: -------------------------------------------------------------------------------- 1 | kernel/plic.o: kernel/plic.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/start.d: -------------------------------------------------------------------------------- 1 | kernel/start.o: kernel/start.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/xargstest.sh: -------------------------------------------------------------------------------- 1 | mkdir a 2 | echo hello > a/b 3 | mkdir c 4 | echo hello > c/b 5 | echo hello > b 6 | find . b | xargs grep hello 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "riscv.h": "c", 4 | "sysinfo.h": "c", 5 | "proc.h": "c" 6 | } 7 | } -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/virtio_disk.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/kernel/virtio_disk.o -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/stressfs.d: -------------------------------------------------------------------------------- 1 | user/stressfs.o: user/stressfs.c kernel/types.h kernel/stat.h user/user.h \ 2 | kernel/fs.h kernel/fcntl.h 3 | -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/main.d: -------------------------------------------------------------------------------- 1 | kernel/main.o: kernel/main.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/plic.d: -------------------------------------------------------------------------------- 1 | kernel/plic.o: kernel/plic.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/start.d: -------------------------------------------------------------------------------- 1 | kernel/start.o: kernel/start.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/xargstest.sh: -------------------------------------------------------------------------------- 1 | mkdir a 2 | echo hello > a/b 3 | mkdir c 4 | echo hello > c/b 5 | echo hello > b 6 | find . b | xargs grep hello 7 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab2-System Calls/__pycache__/gradelib.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab2-System Calls/__pycache__/gradelib.cpython-38.pyc -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sysinfo.h: -------------------------------------------------------------------------------- 1 | struct sysinfo { 2 | uint64 freemem; // amount of free memory (bytes) 3 | uint64 nproc; // number of process 4 | }; 5 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/vm.d: -------------------------------------------------------------------------------- 1 | kernel/vm.o: kernel/vm.c kernel/param.h kernel/types.h kernel/memlayout.h \ 2 | kernel/elf.h kernel/riscv.h kernel/defs.h kernel/fs.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/printf.d: -------------------------------------------------------------------------------- 1 | user/printf.o: user/printf.c kernel/types.h kernel/stat.h user/user.h \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h 3 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/kalloc.d: -------------------------------------------------------------------------------- 1 | kernel/kalloc.o: kernel/kalloc.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/spinlock.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/date.h: -------------------------------------------------------------------------------- 1 | struct rtcdate { 2 | uint second; 3 | uint minute; 4 | uint hour; 5 | uint day; 6 | uint month; 7 | uint year; 8 | }; 9 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/vm.d: -------------------------------------------------------------------------------- 1 | kernel/vm.o: kernel/vm.c kernel/param.h kernel/types.h kernel/memlayout.h \ 2 | kernel/elf.h kernel/riscv.h kernel/defs.h kernel/fs.h 3 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/printf.d: -------------------------------------------------------------------------------- 1 | user/printf.o: user/printf.c kernel/types.h kernel/stat.h user/user.h \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/.gdbinit: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:25000 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/kalloc.d: -------------------------------------------------------------------------------- 1 | kernel/kalloc.o: kernel/kalloc.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/spinlock.h kernel/riscv.h kernel/defs.h 3 | -------------------------------------------------------------------------------- /Lab4-Traps/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/.gdbinit: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:25000 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/__pycache__/gradelib.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngyangyang04/KamaOS/HEAD/Lab1-Xv6 and Unix utilities/__pycache__/gradelib.cpython-38.pyc -------------------------------------------------------------------------------- /Lab2-System Calls/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/proc.d: -------------------------------------------------------------------------------- 1 | kernel/proc.o: kernel/proc.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/trap.d: -------------------------------------------------------------------------------- 1 | kernel/trap.o: kernel/trap.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/uart.d: -------------------------------------------------------------------------------- 1 | kernel/uart.o: kernel/uart.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/init.d: -------------------------------------------------------------------------------- 1 | user/init.o: user/init.c kernel/types.h kernel/stat.h kernel/spinlock.h \ 2 | kernel/sleeplock.h kernel/fs.h kernel/file.h user/user.h kernel/fcntl.h 3 | -------------------------------------------------------------------------------- /Lab3-Page Tables/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/proc.d: -------------------------------------------------------------------------------- 1 | kernel/proc.o: kernel/proc.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/trap.d: -------------------------------------------------------------------------------- 1 | kernel/trap.o: kernel/trap.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/uart.d: -------------------------------------------------------------------------------- 1 | kernel/uart.o: kernel/uart.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/init.d: -------------------------------------------------------------------------------- 1 | user/init.o: user/init.c kernel/types.h kernel/stat.h kernel/spinlock.h \ 2 | kernel/sleeplock.h kernel/fs.h kernel/file.h user/user.h kernel/fcntl.h 3 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/bio.d: -------------------------------------------------------------------------------- 1 | kernel/bio.o: kernel/bio.c kernel/types.h kernel/param.h \ 2 | kernel/spinlock.h kernel/sleeplock.h kernel/riscv.h kernel/defs.h \ 3 | kernel/fs.h kernel/buf.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/log.d: -------------------------------------------------------------------------------- 1 | kernel/log.o: kernel/log.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 3 | kernel/buf.h 4 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/exec.d: -------------------------------------------------------------------------------- 1 | kernel/exec.o: kernel/exec.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h kernel/elf.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/spinlock.d: -------------------------------------------------------------------------------- 1 | kernel/spinlock.o: kernel/spinlock.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/spinlock.h kernel/riscv.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/fcntl.h: -------------------------------------------------------------------------------- 1 | #define O_RDONLY 0x000 2 | #define O_WRONLY 0x001 3 | #define O_RDWR 0x002 4 | #define O_CREATE 0x200 5 | #define O_TRUNC 0x400 6 | #define O_NOFOLLOW 0x800 7 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/bio.d: -------------------------------------------------------------------------------- 1 | kernel/bio.o: kernel/bio.c kernel/types.h kernel/param.h \ 2 | kernel/spinlock.h kernel/sleeplock.h kernel/riscv.h kernel/defs.h \ 3 | kernel/fs.h kernel/buf.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/log.d: -------------------------------------------------------------------------------- 1 | kernel/log.o: kernel/log.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 3 | kernel/buf.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/exec.d: -------------------------------------------------------------------------------- 1 | kernel/exec.o: kernel/exec.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/defs.h kernel/elf.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/spinlock.d: -------------------------------------------------------------------------------- 1 | kernel/spinlock.o: kernel/spinlock.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/spinlock.h kernel/riscv.h kernel/proc.h \ 3 | kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/grind.d: -------------------------------------------------------------------------------- 1 | user/grind.o: user/grind.c kernel/param.h kernel/types.h kernel/stat.h \ 2 | user/user.h kernel/fs.h kernel/fcntl.h kernel/syscall.h \ 3 | kernel/memlayout.h kernel/riscv.h 4 | -------------------------------------------------------------------------------- /Lab4-Traps/user/bttest.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | int 6 | main(int argc, char *argv[]) 7 | { 8 | sleep(1); 9 | exit(0); 10 | } 11 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/pipe.d: -------------------------------------------------------------------------------- 1 | kernel/pipe.o: kernel/pipe.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/spinlock.h kernel/proc.h kernel/fs.h \ 3 | kernel/sleeplock.h kernel/file.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/syscall.d: -------------------------------------------------------------------------------- 1 | kernel/syscall.o: kernel/syscall.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/syscall.h kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sysproc.d: -------------------------------------------------------------------------------- 1 | kernel/sysproc.o: kernel/sysproc.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/date.h kernel/param.h kernel/memlayout.h \ 3 | kernel/spinlock.h kernel/proc.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/grind.d: -------------------------------------------------------------------------------- 1 | user/grind.o: user/grind.c kernel/param.h kernel/types.h kernel/stat.h \ 2 | user/user.h kernel/fs.h kernel/fcntl.h kernel/syscall.h \ 3 | kernel/memlayout.h kernel/riscv.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sleeplock.d: -------------------------------------------------------------------------------- 1 | kernel/sleeplock.o: kernel/sleeplock.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/memlayout.h kernel/spinlock.h \ 3 | kernel/proc.h kernel/sleeplock.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/usertests.d: -------------------------------------------------------------------------------- 1 | user/usertests.o: user/usertests.c kernel/param.h kernel/types.h \ 2 | kernel/stat.h user/user.h kernel/fs.h kernel/fcntl.h kernel/syscall.h \ 3 | kernel/memlayout.h kernel/riscv.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/pipe.d: -------------------------------------------------------------------------------- 1 | kernel/pipe.o: kernel/pipe.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/spinlock.h kernel/proc.h kernel/fs.h \ 3 | kernel/sleeplock.h kernel/file.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/syscall.d: -------------------------------------------------------------------------------- 1 | kernel/syscall.o: kernel/syscall.c kernel/types.h kernel/param.h \ 2 | kernel/memlayout.h kernel/riscv.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/syscall.h kernel/defs.h 4 | -------------------------------------------------------------------------------- /Lab10-Mmap/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | set riscv use-compressed-breakpoints yes 7 | -------------------------------------------------------------------------------- /Lab11-Network/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | set riscv use-compressed-breakpoints yes 7 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/file.d: -------------------------------------------------------------------------------- 1 | kernel/file.o: kernel/file.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/fs.h kernel/spinlock.h kernel/sleeplock.h \ 3 | kernel/file.h kernel/stat.h kernel/proc.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sysproc.d: -------------------------------------------------------------------------------- 1 | kernel/sysproc.o: kernel/sysproc.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/date.h kernel/param.h kernel/memlayout.h \ 3 | kernel/spinlock.h kernel/proc.h kernel/sysinfo.h 4 | -------------------------------------------------------------------------------- /Lab8-Lock/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | set riscv use-compressed-breakpoints yes 7 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sleeplock.d: -------------------------------------------------------------------------------- 1 | kernel/sleeplock.o: kernel/sleeplock.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/memlayout.h kernel/spinlock.h \ 3 | kernel/proc.h kernel/sleeplock.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/usertests.d: -------------------------------------------------------------------------------- 1 | user/usertests.o: user/usertests.c kernel/param.h kernel/types.h \ 2 | kernel/stat.h user/user.h kernel/fs.h kernel/fcntl.h kernel/syscall.h \ 3 | kernel/memlayout.h kernel/riscv.h 4 | -------------------------------------------------------------------------------- /Lab9-File System/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | set riscv use-compressed-breakpoints yes 7 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/file.d: -------------------------------------------------------------------------------- 1 | kernel/file.o: kernel/file.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/fs.h kernel/spinlock.h kernel/sleeplock.h \ 3 | kernel/file.h kernel/stat.h kernel/proc.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/fs.d: -------------------------------------------------------------------------------- 1 | kernel/fs.o: kernel/fs.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/stat.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/sleeplock.h kernel/fs.h kernel/buf.h kernel/file.h 4 | -------------------------------------------------------------------------------- /Lab7-Multithreading/.gdbinit.tmpl-riscv: -------------------------------------------------------------------------------- 1 | set confirm off 2 | set architecture riscv:rv64 3 | target remote 127.0.0.1:1234 4 | symbol-file kernel/kernel 5 | set disassemble-next-line auto 6 | set riscv use-compressed-breakpoints yes 7 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/xv6.out: -------------------------------------------------------------------------------- 1 | 2 | xv6 kernel is booting 3 | 4 | hart 1 starting 5 | hart 2 starting 6 | init: starting sh 7 | $ sh < xargstest.sh 8 | $ echo DONE 9 | $ $ $ $ $ hello 10 | hello 11 | hello 12 | $ $ DONE 13 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/fs.d: -------------------------------------------------------------------------------- 1 | kernel/fs.o: kernel/fs.c kernel/types.h kernel/riscv.h kernel/defs.h \ 2 | kernel/param.h kernel/stat.h kernel/spinlock.h kernel/proc.h \ 3 | kernel/sleeplock.h kernel/fs.h kernel/buf.h kernel/file.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/virtio_disk.d: -------------------------------------------------------------------------------- 1 | kernel/virtio_disk.o: kernel/virtio_disk.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/memlayout.h kernel/spinlock.h \ 3 | kernel/sleeplock.h kernel/fs.h kernel/buf.h kernel/virtio.h 4 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sysfile.d: -------------------------------------------------------------------------------- 1 | kernel/sysfile.o: kernel/sysfile.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/stat.h kernel/spinlock.h \ 3 | kernel/proc.h kernel/fs.h kernel/sleeplock.h kernel/file.h \ 4 | kernel/fcntl.h 5 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/virtio_disk.d: -------------------------------------------------------------------------------- 1 | kernel/virtio_disk.o: kernel/virtio_disk.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/memlayout.h kernel/spinlock.h \ 3 | kernel/sleeplock.h kernel/fs.h kernel/buf.h kernel/virtio.h 4 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sysfile.d: -------------------------------------------------------------------------------- 1 | kernel/sysfile.o: kernel/sysfile.c kernel/types.h kernel/riscv.h \ 2 | kernel/defs.h kernel/param.h kernel/stat.h kernel/spinlock.h \ 3 | kernel/proc.h kernel/fs.h kernel/sleeplock.h kernel/file.h \ 4 | kernel/fcntl.h 5 | -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab2-System Calls/xv6.out: -------------------------------------------------------------------------------- 1 | 2 | xv6 kernel is booting 3 | 4 | hart 1 starting 5 | hart 2 starting 6 | init: starting sh 7 | $ sysinfotest 8 | sysinfotest: start 9 | sysinfotest: OK 10 | $ qemu-system-riscv64: terminating on signal 15 from pid 103013 (make) 11 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/sleep.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | int main(int argc, char **argv) { 6 | if(argc < 2) { 7 | printf("usage: sleep \n"); 8 | } 9 | sleep(atoi(argv[1])); 10 | exit(0); 11 | } -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/console.d: -------------------------------------------------------------------------------- 1 | kernel/console.o: kernel/console.c \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h kernel/types.h \ 3 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 4 | kernel/file.h kernel/memlayout.h kernel/riscv.h kernel/defs.h \ 5 | kernel/proc.h 6 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/printf.d: -------------------------------------------------------------------------------- 1 | kernel/printf.o: kernel/printf.c \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h kernel/types.h \ 3 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 4 | kernel/file.h kernel/memlayout.h kernel/riscv.h kernel/defs.h \ 5 | kernel/proc.h 6 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/console.d: -------------------------------------------------------------------------------- 1 | kernel/console.o: kernel/console.c \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h kernel/types.h \ 3 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 4 | kernel/file.h kernel/memlayout.h kernel/riscv.h kernel/defs.h \ 5 | kernel/proc.h 6 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/printf.d: -------------------------------------------------------------------------------- 1 | kernel/printf.o: kernel/printf.c \ 2 | /usr/lib/gcc-cross/riscv64-linux-gnu/9/include/stdarg.h kernel/types.h \ 3 | kernel/param.h kernel/spinlock.h kernel/sleeplock.h kernel/fs.h \ 4 | kernel/file.h kernel/memlayout.h kernel/riscv.h kernel/defs.h \ 5 | kernel/proc.h 6 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/types.h: -------------------------------------------------------------------------------- 1 | typedef unsigned int uint; 2 | typedef unsigned short ushort; 3 | typedef unsigned char uchar; 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short uint16; 7 | typedef unsigned int uint32; 8 | typedef unsigned long uint64; 9 | 10 | typedef uint64 pde_t; 11 | -------------------------------------------------------------------------------- /Lab8-Lock/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab10-Mmap/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab11-Network/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab4-Traps/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab3-Page Tables/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab4-Traps/user/call.c: -------------------------------------------------------------------------------- 1 | #include "kernel/param.h" 2 | #include "kernel/types.h" 3 | #include "kernel/stat.h" 4 | #include "user/user.h" 5 | 6 | int g(int x) { 7 | return x+3; 8 | } 9 | 10 | int f(int x) { 11 | return g(x); 12 | } 13 | 14 | void main(void) { 15 | printf("%d %d\n", f(8)+1, 13); 16 | exit(0); 17 | } 18 | -------------------------------------------------------------------------------- /Lab7-Multithreading/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/spinlock.h: -------------------------------------------------------------------------------- 1 | // Mutual exclusion lock. 2 | struct spinlock { 3 | uint locked; // Is the lock held? 4 | 5 | // For debugging: 6 | char *name; // Name of lock. 7 | struct cpu *cpu; // The cpu holding the lock. 8 | #ifdef LAB_LOCK 9 | int nts; 10 | int n; 11 | #endif 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /Lab9-File System/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab10-Mmap/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab4-Traps/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/user/zombie.c: -------------------------------------------------------------------------------- 1 | // Create a zombie process that 2 | // must be reparented at exit. 3 | 4 | #include "kernel/types.h" 5 | #include "kernel/stat.h" 6 | #include "user/user.h" 7 | 8 | int 9 | main(void) 10 | { 11 | if(fork() > 0) 12 | sleep(5); // Let child exit before parent. 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab8-Lock/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab11-Network/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/buf.h: -------------------------------------------------------------------------------- 1 | struct buf { 2 | int valid; // has data been read from disk? 3 | int disk; // does disk "own" buf? 4 | uint dev; 5 | uint blockno; 6 | struct sleeplock lock; 7 | uint refcnt; 8 | struct buf *prev; // LRU cache list 9 | struct buf *next; 10 | uchar data[BSIZE]; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab3-Page Tables/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab7-Multithreading/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab9-File System/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _* 3 | *.o 4 | *.d 5 | *.asm 6 | *.sym 7 | *.img 8 | vectors.S 9 | bootblock 10 | entryother 11 | initcode 12 | initcode.out 13 | kernelmemfs 14 | mkfs 15 | kernel/kernel 16 | user/usys.S 17 | .gdbinit 18 | myapi.key 19 | *-handin.tar.gz 20 | xv6.out* 21 | .vagrant/ 22 | submissions/ 23 | ph 24 | barrier 25 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/sleeplock.h: -------------------------------------------------------------------------------- 1 | // Long-term locks for processes 2 | struct sleeplock { 3 | uint locked; // Is the lock held? 4 | struct spinlock lk; // spinlock protecting this sleep lock 5 | 6 | // For debugging: 7 | char *name; // Name of lock. 8 | int pid; // Process holding lock 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Lab10-Mmap/user/kill.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | int 6 | main(int argc, char **argv) 7 | { 8 | int i; 9 | 10 | if(argc < 2){ 11 | fprintf(2, "usage: kill pid...\n"); 12 | exit(1); 13 | } 14 | for(i=1; i '9')){ 13 | fprintf(2, "Usage: %s mask command\n", argv[0]); 14 | exit(1); 15 | } 16 | 17 | if (trace(atoi(argv[1])) < 0) { 18 | fprintf(2, "%s: trace failed\n", argv[0]); 19 | exit(1); 20 | } 21 | 22 | for(i = 2; i < argc && i < MAXARG; i++){ 23 | nargv[i-2] = argv[i]; 24 | } 25 | exec(nargv[0], nargv); 26 | exit(0); 27 | } 28 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab9-File System/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/syscall.h: -------------------------------------------------------------------------------- 1 | // System call numbers 2 | #define SYS_fork 1 3 | #define SYS_exit 2 4 | #define SYS_wait 3 5 | #define SYS_pipe 4 6 | #define SYS_read 5 7 | #define SYS_kill 6 8 | #define SYS_exec 7 9 | #define SYS_fstat 8 10 | #define SYS_chdir 9 11 | #define SYS_dup 10 12 | #define SYS_getpid 11 13 | #define SYS_sbrk 12 14 | #define SYS_sleep 13 15 | #define SYS_uptime 14 16 | #define SYS_open 15 17 | #define SYS_write 16 18 | #define SYS_mknod 17 19 | #define SYS_unlink 18 20 | #define SYS_link 19 21 | #define SYS_mkdir 20 22 | #define SYS_close 21 23 | #define SYS_sigalarm 22 24 | #define SYS_sigreturn 23 25 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/entry.S: -------------------------------------------------------------------------------- 1 | # qemu -kernel loads the kernel at 0x80000000 2 | # and causes each CPU to jump there. 3 | # kernel.ld causes the following code to 4 | # be placed at 0x80000000. 5 | .section .text 6 | _entry: 7 | # set up a stack for C. 8 | # stack0 is declared in start.c, 9 | # with a 4096-byte stack per CPU. 10 | # sp = stack0 + (hartid * 4096) 11 | la sp, stack0 12 | li a0, 1024*4 13 | csrr a1, mhartid 14 | addi a1, a1, 1 15 | mul a0, a0, a1 16 | add sp, sp, a0 17 | # jump to start() in start.c 18 | call start 19 | spin: 20 | j spin 21 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/syscall.h: -------------------------------------------------------------------------------- 1 | // System call numbers 2 | #define SYS_fork 1 3 | #define SYS_exit 2 4 | #define SYS_wait 3 5 | #define SYS_pipe 4 6 | #define SYS_read 5 7 | #define SYS_kill 6 8 | #define SYS_exec 7 9 | #define SYS_fstat 8 10 | #define SYS_chdir 9 11 | #define SYS_dup 10 12 | #define SYS_getpid 11 13 | #define SYS_sbrk 12 14 | #define SYS_sleep 13 15 | #define SYS_uptime 14 16 | #define SYS_open 15 17 | #define SYS_write 16 18 | #define SYS_mknod 17 19 | #define SYS_unlink 18 20 | #define SYS_link 19 21 | #define SYS_mkdir 20 22 | #define SYS_close 21 23 | #define SYS_trace 22 // trace系统调用号 24 | #define SYS_sysinfo 23 // sysinfo系统调用号 25 | -------------------------------------------------------------------------------- /Lab10-Mmap/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab4-Traps/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab8-Lock/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 10000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab3-Page Tables/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab7-Multithreading/user/uthread_switch.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | /* 4 | * save the old thread's registers, 5 | * restore the new thread's registers. 6 | */ 7 | 8 | .globl thread_switch 9 | thread_switch: 10 | sd ra, 0(a0) 11 | sd sp, 8(a0) 12 | sd s0, 16(a0) 13 | sd s1, 24(a0) 14 | sd s2, 32(a0) 15 | sd s3, 40(a0) 16 | sd s4, 48(a0) 17 | sd s5, 56(a0) 18 | sd s6, 64(a0) 19 | sd s7, 72(a0) 20 | sd s8, 80(a0) 21 | sd s9, 88(a0) 22 | sd s10, 96(a0) 23 | sd s11, 104(a0) 24 | 25 | ld ra, 0(a1) 26 | ld sp, 8(a1) 27 | ld s0, 16(a1) 28 | ld s1, 24(a1) 29 | ld s2, 32(a1) 30 | ld s3, 40(a1) 31 | ld s4, 48(a1) 32 | ld s5, 56(a1) 33 | ld s6, 64(a1) 34 | ld s7, 72(a1) 35 | ld s8, 80(a1) 36 | ld s9, 88(a1) 37 | ld s10, 96(a1) 38 | ld s11, 104(a1) 39 | 40 | ret /* return to ra */ 41 | -------------------------------------------------------------------------------- /Lab10-Mmap/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab2-System Calls/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab4-Traps/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab7-Multithreading/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab8-Lock/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab11-Network/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/kernel/param.h: -------------------------------------------------------------------------------- 1 | #define NPROC 64 // maximum number of processes 2 | #define NCPU 8 // maximum number of CPUs 3 | #define NOFILE 16 // open files per process 4 | #define NFILE 100 // open files per system 5 | #define NINODE 50 // maximum number of active i-nodes 6 | #define NDEV 10 // maximum major device number 7 | #define ROOTDEV 1 // device number of file system root disk 8 | #define MAXARG 32 // max exec arguments 9 | #define MAXOPBLOCKS 10 // max # of blocks any FS op writes 10 | #define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log 11 | #define NBUF (MAXOPBLOCKS*3) // size of disk block cache 12 | #define FSSIZE 1000 // size of file system in blocks 13 | #define MAXPATH 128 // maximum file path name 14 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab3-Page Tables/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab7-Multithreading/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab8-Lock/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab9-File System/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/cat.c: -------------------------------------------------------------------------------- 1 | #include "kernel/types.h" 2 | #include "kernel/stat.h" 3 | #include "user/user.h" 4 | 5 | char buf[512]; 6 | 7 | void 8 | cat(int fd) 9 | { 10 | int n; 11 | 12 | while((n = read(fd, buf, sizeof(buf))) > 0) { 13 | if (write(1, buf, n) != n) { 14 | fprintf(2, "cat: write error\n"); 15 | exit(1); 16 | } 17 | } 18 | if(n < 0){ 19 | fprintf(2, "cat: read error\n"); 20 | exit(1); 21 | } 22 | } 23 | 24 | int 25 | main(int argc, char *argv[]) 26 | { 27 | int fd, i; 28 | 29 | if(argc <= 1){ 30 | cat(0); 31 | exit(0); 32 | } 33 | 34 | for(i = 1; i < argc; i++){ 35 | if((fd = open(argv[i], 0)) < 0){ 36 | fprintf(2, "cat: cannot open %s\n", argv[i]); 37 | exit(1); 38 | } 39 | cat(fd); 40 | close(fd); 41 | } 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /Lab3-Page Tables/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab7-Multithreading/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab6-Copy-on-Write Fork/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab1-Xv6 and Unix utilities/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab5-Lazy Page Allocation/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | -------------------------------------------------------------------------------- /Lab11-Network/kernel/syscall.h: -------------------------------------------------------------------------------- 1 | // System call numbers 2 | #define SYS_fork 1 3 | #define SYS_exit 2 4 | #define SYS_wait 3 5 | #define SYS_pipe 4 6 | #define SYS_read 5 7 | #define SYS_kill 6 8 | #define SYS_exec 7 9 | #define SYS_fstat 8 10 | #define SYS_chdir 9 11 | #define SYS_dup 10 12 | #define SYS_getpid 11 13 | #define SYS_sbrk 12 14 | #define SYS_sleep 13 15 | #define SYS_uptime 14 16 | #define SYS_open 15 17 | #define SYS_write 16 18 | #define SYS_mknod 17 19 | #define SYS_unlink 18 20 | #define SYS_link 19 21 | #define SYS_mkdir 20 22 | #define SYS_close 21 23 | 24 | // System calls for labs 25 | #define SYS_trace 22 26 | #define SYS_sysinfo 23 27 | #define SYS_sigalarm 24 28 | #define SYS_sigreturn 25 29 | #define SYS_symlink 26 30 | #define SYS_mmap 27 31 | #define SYS_munmap 28 32 | #define SYS_connect 29 33 | -------------------------------------------------------------------------------- /Lab11-Network/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | entry("connect"); 40 | -------------------------------------------------------------------------------- /Lab9-File System/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | entry("symlink"); 40 | -------------------------------------------------------------------------------- /Lab10-Mmap/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | entry("mmap"); 40 | entry("munmap"); 41 | -------------------------------------------------------------------------------- /Lab4-Traps/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | entry("sigalarm"); 40 | entry("sigreturn"); 41 | -------------------------------------------------------------------------------- /Lab2-System Calls/user/usys.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generate usys.S, the stubs for syscalls. 4 | 5 | print "# generated by usys.pl - do not edit\n"; 6 | 7 | print "#include \"kernel/syscall.h\"\n"; 8 | 9 | sub entry { 10 | my $name = shift; 11 | print ".global $name\n"; 12 | print "${name}:\n"; 13 | print " li a7, SYS_${name}\n"; 14 | print " ecall\n"; 15 | print " ret\n"; 16 | } 17 | 18 | entry("fork"); 19 | entry("exit"); 20 | entry("wait"); 21 | entry("pipe"); 22 | entry("read"); 23 | entry("write"); 24 | entry("close"); 25 | entry("kill"); 26 | entry("exec"); 27 | entry("open"); 28 | entry("mknod"); 29 | entry("unlink"); 30 | entry("fstat"); 31 | entry("link"); 32 | entry("mkdir"); 33 | entry("chdir"); 34 | entry("dup"); 35 | entry("getpid"); 36 | entry("sbrk"); 37 | entry("sleep"); 38 | entry("uptime"); 39 | entry("trace"); # 为trace添加系统调用接口 40 | entry("sysinfo"); # 为sysinfo添加系统调用接口 41 | --------------------------------------------------------------------------------