forked from ccccourse1/sp110b
-
Notifications
You must be signed in to change notification settings - Fork 0
w18.md
yucing edited this page Jun 17, 2022
·
3 revisions
- 共分 7 個層次
7. File Descriptor (file.c/FILE) // ftable.file 是 struct file (FILE) 的陣列
// fd 就是其索引值
6. Pathname (fs.c/namei+dirlookup) // 透過 namei() 查找對應某路徑的 inode
5. Directory (fs.h/struct dirent) // 目錄以 dirent 形式存在 inode 中
4. Inode (fs.c/struct inode/dinode) // 一個檔案對應一個 inode
3. Logging (log.c) // 日誌,防止寫到一半出現狀況。
2. Buffer cache (bio.c) // 區塊讀取函數 bread(dev, i)/bwrite(dev, i)
// 有緩衝功能。
1. Disk (virtio_disk.c) // 透過 virtio 協定請求讀寫硬碟
- 有兩個中斷器
1.局部中斷 CLINT (Core Local Interruptor)
- 軟體中斷 (Software Interrupt) 和時間中斷 (Timer Interrupt),發生後會立刻執行
- 外部中斷 PLIC (Platform-Level Interrupt Controller)
- 外部設備的中斷,像是磁碟,鍵盤,網路的中斷,必須經過仲裁決定哪個中斷優先處理