OSDI

2022 年那一陣子準備面試材料,看到 vDSO 帶來效能提升方式,也就是在 user space 直接調用 vDSO 無需切換至 kernel space,對 process 在 kernel space 和 user space 是如何切換的感到好奇。又看到 osdi lab 有整份作業需求放出來,想說多一份面試材料也不錯,兩個月內零基礎應該可以自幹出來,結果幹了快一年XD(做到 lab3 後面試上後就懶得更新)

紀錄每個 lab 開發歷程,lab4 之後因為不斷改架構變不再紀錄

Lab 0: Environment Setup

Lab 0 Spec

Lab 1: Hello World

Lab 1 Spec

Lab 1 Source Code

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 command, it print current timestamp.
elective 3 Reboot Add command.
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

Lab 2 Spec

Lab 2 Source Code

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 Spec

Lab3 Source code

R1 R2 R3 R4 E1 E2 E3 Q1 Q2 Q3
ℹ️

Reference

過程中實在卡關,炒幣的同時遇到幾年前也幹過 x86 osdi 大神 yysung1123,把他拖下水重新寫一份 rpi 版的

還有一些無關連結,我應該都不會再點進去的,就放著