Worksheet 11
Tom Cat became the new leader of the Cat Kingdom. He had one big idea: he wanted to get rid of all the dogs.
His plan was simple. He wanted to fill the whole world with “Meow” sounds. He thought if there were too many “Meows,” there would be no room left for dogs.

He asked Le Chat (Cat Kingdom’s Sovereign AI) for help. “Generate a program that produces a lot of ‘Meows’,” he said.
Le Chat gave him a script called meow.sh.
cat meow.sh
echo Meow.
echo Meow.
meow.sh &“Thank you very much,” Tom Cat said. He went to the kingdom’s main computer and got ready to run the script.
“Wait a moment!” shouted Nini (Tom’s computer helper), “That script will …”
But Tom Cat didn’t listen. He smiled and pressed Enter.
The computer screen filled up fast.
Meow. Meow. Meow. Meow. Meow. Meow. Meow. Meow. Meow.Meow.Meow.Meow.Meow.Meow.Meow.Meow.
The computer fans got very loud, and then… everything stopped. The whole system was frozen.
Nini sighed. He pushed the power button to reboot the computer.
“That,” Nini said, “was a fork bomb. You didn’t get rid of the dogs. You just crashed our computer.” eLearn link of the video lecture 懷疑人生的時候,玩一下 cowsay. Recall that there are many cats and cows on Linux, but not many dogs (and Tom Cat wants zero dog). If you have time, read through the textbook chapters this week after watching the video. This will help you understand the concepts covered in the video deeper. If you struggle to set up a proper programming environment in lab 1, make sure you read this before proceeding to lab 2: xv6 environment setup. Lab 2: xv6 F0rk B0mbVideo Lecture
_________________________________________
( Wa CoW! OS is lazy smart ... put off )
( work until necessary. eh? I won't study )
( until there's a quiz. If the quiz )
( suddenly gets canceled, then I will )
( save a full copy of my weekend! How )
( smart. Saves a lot of brain memory. )
-----------------------------------------
o ^__^
o (oo)\_______
(__)\ )\/\
||----w |
|| ||Readings
Programming Lab
Learning Objectives
fork() system call fast.