Skip to content

swu038/xv6-public

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Info:

Office Hours: Thur: 1:00 - 3:00 pm.

Room: WCH 110.

xv6 tutorial

resources

  • [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
    1. [Intro x86, stack] IS -- nice video to introduce x86 architecture, assembly, and stack
    2. [quick learn x86 assembly instructions] QLAI
    3. Appendix A -- PC hardware
    4. Appendix B -- The boot loader

  • Lab 0.5 syscalls & scheduler (Don't need to turn in anything)
    1. 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().

    2. explain what policy of scheduler uses in xv6.

    3. Read the book chapter.


  • [Lab 1] L11
    1. [tips] L1
    2. [test cases] TC

  • [Lab 2] L2

login sledge

open your terminal, type:

$ ssh [email protected] 
$ password:*

Example


Tutorials

  • [set up git version control] SUG
  • [run xv6 & using gdb] XV6T 9 min

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.

nice discussion of xv6

  • [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.

Tips

How to exit xv6.

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

How to exit xv6 (faster)

in the terminal that qemu is running,

  1. press 'CTL + A'
  2. press 'C'
  3. enter 'q'

Best way to get xv6 source code

$ git clone https://github.com/guilleiguaran/xv6.git

About

xv6 for education purpose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 78.4%
  • C++ 8.9%
  • Assembly 3.7%
  • Makefile 3.4%
  • Shell 2.5%
  • Perl 2.2%
  • Other 0.9%