OSDI
2022 年那一陣子準備面試材料,看到 vDSO 帶來效能提升方式,也就是在 user space 直接調用 vDSO 無需切換至 kernel space,對 process 在 kernel space 和 user space 是如何切換的感到好奇。又看到 osdi lab 有整份作業需求放出來,想說多一份面試材料也不錯,兩個月內零基礎應該可以自幹出來,結果幹了快一年XD(做到 lab3 後面試上後就懶得更新)
紀錄每個 lab 開發歷程,lab4 之後因為不斷改架構變不再紀錄
Lab 0: Environment Setup
Lab 1: Hello World
| Item | Section | Description | Completed |
|---|---|---|---|
| required 1 | Basic Initialization | Implement the 3 basic steps. | ✅ |
| required 2 | Mini UART | Following UART to set up mini UART. | ✅ |
| required 3 | Simple Shell | Implement a simple shell, it should support the following commands. help: print all available commands hello: print Hello World! |
✅ |
| elective 1 | Simple Shell | Write a program or script on your host computer which can read a text file and write the content to rpi3. | ✅ |
| elective 2 | Get Time | Add |
✅ |
| elective 3 | Reboot | Add |
✅ |
| question 1 | Basic Initialization | Is it reasonable to accelerate booting speed by parallel programming during the initialization stage? | ✅ |
| question2 | Conclusion | Point out the difference between bare-metal programming and programming on top of operating system. |
Lab2 Bootloader
| Item | Section | Description | Completed |
|---|---|---|---|
| required 1 | Mailbox | Get the hardware’s information by mailbox and print them, you should at least print board revision and VC Core base address. | ✅ |
| required 2 | Load kernel image | Implement bootloader can load kernel image by UART. | ✅ |
| elective 1 | Mailbox | Get or set UART clock by mailbox and replace mini UART by PL011 UART. | ✅ |
| elective 2 | Mailbox | Set framebuffer by mailbox to show a splash image, show the result by qemu. | ✅ |
| elective 3 | Load kernel image | User can specify the kernel image’s loading address. | ✅ |
| question 1 | Load kernel image | In x86 machine, how the above 4 steps are implemented? Roughly describe it. | ✅ |
| question2 | Load kernel image | Calculate how long will it take for loading a 10MB kernel image by UART if baud rate is 115200. | ✅ |
Lab3 Exception and Interrupt
Lab3 Source code
| R1 | R2 | R3 | R4 | E1 | E2 | E3 | Q1 | Q2 | Q3 |
|---|---|---|---|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ℹ️ | ✅ | ✅ | ✅ |
Reference
- kaiiiz 作業系統設計與實作: 從該網誌得知 osdi lab
- 2016 NCTU OCW OSDI: 蠻久遠的開放式課程,加減看
- 2020 OSDI課程網頁
- qemu-patch-raspberry4: QEMU官方未收錄的 rpi4 patch,但 lab 還是模擬 rp3
- raspi3-tutorial: 基於 rpi3 的自幹 os 教學
- 在 Raspberry Pi 4B 上設定 UART 連線
- Signal Handling in Linux by @LJP
- ARMv8 (NCKU wiki)
- 學習實作小型作業系統 (筆記) BY
tina0405: 實作完 osdi 在來看這篇回味 - 關於GNU Inline Assembly: 在 c 內寫一些操作暫存器的組語
- Learning operating system development using Linux kernel and Raspberry Pi: BCM2835 System timer 操作方式
- [Lesson03] Exercises questions #70
local timer = Timer (ARM side) of BCM2835?
ARM generic timer = Timer (ARM side) of BCM2835 ? Or The Generic Timer in AArch64 state? - Linux中斷控制器的抽象封裝
過程中實在卡關,炒幣的同時遇到幾年前也幹過 x86 osdi 大神 yysung1123,把他拖下水重新寫一份 rpi 版的
還有一些無關連結,我應該都不會再點進去的,就放著