Worksheet 9
Capoo is still in midterm hell. (Capoo ist kaputt)
He has already consumed 8 instant noodle bowls.
Suddenly, ding! A Discord notification appears:
“Worksheet 9 has been posted”

Capoo freezes. “Walao … Professeur Tony Chen … You have already crushed us with four quizzes. Please don’t.”
He opens the file: Lab: MIT xv6. and shouts:
“Made-in-Taiwan X-v6?! We Taiwanese don’t use X!”
“Even Donald Trump rejects ‘X’ and hates Elon Musk”
Capoo opens the group chat. “Bro, what’s xv6? Where is X-v1? or v2?”
Teammate: “I don’t know. Rumor says if you make qemu three times at midnight, you will be cursed by a ghost!”

Capoo is devastated. Now, the only thing he know is his ultimate savior: GPT the cat. A.K.A Chat-GPT
“Mr. GPT! Help! I just need xv6 to compile before sunrise!”
GPT spits out without hallucination:
“Excellent. Capoo. Let’s do this systematically. I’ll guide you step-by-step, giving you code snippets for every required file modification in xv6 … and you will get X-v7”
Two hours later, the kernel still crashes, and GPT still pretends as if I’m the best programmer in the world.
“Nini!! Nini!! Where are you??? This GPT cat is not lion as he claims to be!
“Now I admit I’m still a kitten. Maybe I should study prompt engineering before I could take OS.”
Capoo tries to find another cat to calm him. He has run out of his ChatGPT daily quota and has to wait for another 3 hours. To kill time, he starts watching his favorite girl cat’s show… ヽ(●´∀`●)ノ
Video Lecture
There is no video lecture this week.
Readings
- Optional reading (補充資料): Chapt 4 of the xv6 book (中文翻譯版). This helps you understand how xv6 handles exception and how system call is made. You can compare this with what you’ve learned in worksheet 4.
Programming Lab
Lab 1: xv6 System Call Tracing
In this lab, you will add a new user program and a new system call into xv6. We teach you how to add a new user program here and how to add a new system call here
We provide a tutorial to teach you how to use gdb to debug your code: here.
Learning Objectives
After working on this worksheet’s material, you should be able to answer all the questions specified at the bottom of the lab description.