Office Hours: Thur: 1:00 - 3:00 pm.
Room: WCH 110.
-
[class website] CW
-
[lab website] LW
-
[xv6 BOOK] XB Important! Please Read!!!
-
[xv6 source code reference] XS
-
[Official xv6] OX
-
[GDB commands] GC
- [Lab 0: PC booting] LPC
- Lab 0.5 syscalls & scheduler (no require to submit anything)
-
implement a syscall int count(void) that counts number of syscalls.
a. This syscall will return number of syscalls you called, from the begining of process started until to the calling 'count()'.
b. First, you need to create a syscall. If you don't know how to create one, find a syscall such as open(), and see how it created. (hint: the files you need to modify -- user.h, defs.h, sysproc.c, sysfile.c, syscall.h, syscall.c, usys.S)
c. Then, you need to implement it. You will change some code in proc.h and proc.c. You can either implement it in sysfile.c or sysproc.c.
d. Finally, you can create a user file and test your syscall count you just created. If you want to create your own user file, then you should add it in Makefile. You are also able to change the code in usertests.c and add 'count()' some place in main().
-
explain what policy of scheduler uses in xv6.
-
Read the book.
-
-
[Lab 2] L2
Lab2 warm up:
- How to use thread_create, look up the test files.
- synchronization -- create a user program to implement game frisbee (Create serveral threads, they will play throwing and catching a frisbee game. Frisbee is a global variable, so it needs a lock to be protected in critical section. Who gets the lock means who gets the frisbee and releasing the lock means that thread are throwing the frisbee. There will be one of others will catch frisbee. Implement this scenario ).
- page table -- know how exec() works (you will be asked in walkthrough doc for lab2)
open your terminal, type:
$ ssh [email protected]
$ password:*
Example
$ ssh [email protected]
In the tutorial, instead of typing gdb, you should type:
$ gdb q -iex "set auto-load safe-path /home/csgrads/sjin010/xv6-public/"
change the directory
/home/csgrads/sjin010/xv6-public/
to your working directory. Find your working path, type
$pwd
in the terminal.
- [xv6 syscalls] SYSC --- more detail tutorial. (eg: how to create a user file, how syscall works.).
- [xv6 fork(), wait(), exec()] FWE --- play around with syscalls.
- [xv6 scheduler] XS --- nice explanation of scheduler part.
- [stack exec] SE --- explanation of stack and exec part.
open another terminal, find the process PID of running QEMU
$ ps aux | less | grep uname
uname is your cs account. eg: sjin010
Then kill that process
$ kill -9 PID
in the terminal that qemu is running,
- press 'CTL + A'
- press 'C'
- enter 'q'
$ git clone https://github.com/guilleiguaran/xv6.git