Skip to content

Commit

Permalink
Add some XV6 notes
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddwlee84 committed Jun 17, 2019
1 parent 7dfcb68 commit 5cc808e
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 4 deletions.
21 changes: 21 additions & 0 deletions Notes/XV6/XV6FileSystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# XV6 Source Code Reading -- File System

## Requirement

Code to read

* File system
* [ ] `buf.h` (p.38)
* [ ] `sleeplock.h` (p.39)
* [ ] `fcntl.h` (p.39)
* [ ] `stat.h` (p.40)
* [ ] `fs.h` (p.40)
* [ ] `file.h` (p.41)
* [ ] `ide.c` (p.42)
* [ ] `bio.c` (p.44)
* [ ] `sleeplock.c` (p.46)
* [ ] `log.c` (p.47)
* [ ] `fs.c` (p.49)
* [ ] `file.c` (p.58)
* [ ] `sysfile.c` (p.60)
* [ ] `exec.c` (p.66)
36 changes: 36 additions & 0 deletions Notes/XV6/XV6InterruptSyscall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# XV6 Source Code Reading -- Interrupt and System Call

## Requirement

Code to read

* Bootloader
* [ ] `bootasm.S` (p.91)
* [ ] `bootmain.c` (p.92)
* Entering xv6
* [ ] `entry.S` (p.10)
* [ ] `entryother.S` (p.11)
* [ ] `main.c` (p.12)
* System calls (and interrupt)
* [ ] `traps.h` (p.32)
* [ ] `vectors.pl` (p.32)
* [ ] `trapasm.S` (p.33)
* [ ] `trap.c` (p.33)
* [ ] `syscall.h` (p.35)
* [ ] `syscall.c` (p.35)
* [ ] `sysproc.c` (p.37)

## Resources

### Instruction

#### Interrupt

* cli - Clear Interrupt Flag
* [x86 Instruction Set Reference - CLI](https://c9x.me/x86/html/file_module_x86_id_31.html)
* [CLI — Clear Interrupt Flag](https://www.felixcloutier.com/x86/cli)
* sti - Set Interrupt Flag
* [STI — Set Interrupt Flag](https://www.felixcloutier.com/x86/sti)
* int
* [INT n/INTO/INT3/INT1 — Call to Interrupt Procedure](https://www.felixcloutier.com/x86/intn:into:int3:int1)
* [wiki - INT (x86 instruction)](https://en.wikipedia.org/wiki/INT_(x86_instruction))
8 changes: 8 additions & 0 deletions Notes/XV6/XV6Memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# XV6 Source Code Reading -- Memory

## Requirement

Code to read

* [ ] `kalloc.c` (p.31)
* [ ] `vm.c` (p.17)
25 changes: 25 additions & 0 deletions Notes/XV6/XV6Synchronization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# XV6 Source Code Reading -- Synchronization

## Requirement

Code to read

* Locks
* [ ] `spinlock.h` (p.15)
* [ ] `spinlock.c` (p.15)

## Resources

xchg

* [XCHG — Exchange Register/Memory with Register](https://www.felixcloutier.com/x86/xchg)
* [X86組合語言/基本指令集/IA32指令:xchg](https://zh.wikibooks.org/zh-tw/X86%E7%B5%84%E5%90%88%E8%AA%9E%E8%A8%80/%E5%9F%BA%E6%9C%AC%E6%8C%87%E4%BB%A4%E9%9B%86/IA32%E6%8C%87%E4%BB%A4:xchg)

### Implementation

implement semaphore using spinlock

implement readers-writer lock using spinlock

* [Readers–writer lock - Implementation](https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Implementation)
* [How would you implement your own reader/writer lock in C++11?](https://stackoverflow.com/questions/12033188/how-would-you-implement-your-own-reader-writer-lock-in-c11)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ PKU OS course project and notes based on Nachos and XV6.
### XV6 Source Code Reading

1. [Process and Thread (with Scheduling)](Notes/XV6/XV6ProcessThread.md)
2. Synchronization Mechanism
3. Interrupt and System Call
4. Memory Management
5. File System
2. [Synchronization Mechanism](Notes/XV6/XV6Synchronization.md)
3. [Interrupt and System Call](Notes/XV6/XV6InterruptSyscall.md)
4. [Memory Management](Notes/XV6/XV6Memory.md)
5. [File System](Notes/XV6/XV6FileSystem.md)

### Additional Task

Expand Down

0 comments on commit 5cc808e

Please sign in to comment.