GithubHelp home page GithubHelp logo

nihhaar / xv6-public Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jinsongwei/xv6-public

0.0 1.0 0.0 723 KB

xv6 for education purpose

Emacs Lisp 0.04% C 85.53% Makefile 3.40% C++ 0.76% Assembly 3.66% Perl 2.22% Shell 2.44% Ruby 1.10% OpenEdge ABL 0.85%

xv6-public's Introduction

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 (no require to submit 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.


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

  • [Lab 2] L2

    Lab2 warm up:

    1. How to use thread_create, look up the test files.
    2. 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 ).
    3. page table -- know how exec() works (you will be asked in walkthrough doc for lab2)

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.
  • [stack exec] SE --- explanation of stack and exec 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

xv6-public's People

Contributors

jinsongwei avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.