Skip to content

OccupyMars2025/Operating-Systems-Three-Easy-Pieces

Repository files navigation

start 2024/3/5

Simple is Powerful

The proper OS response to errant process behavior is to kill the offending process!

The common reaction of the OS will be one of hostility: it will likely terminate the offending process. The OS should be highly protective of the machine it is running, and thus it does not take kindly to a process trying to access memory or execute instructions that it shouldn’t. Bye bye, misbehaving process; it’s been nice knowing you.

When you want to learn sth, spend 3 days trying different textbooks and courses to find the one that fits your ability level. It is worth it !

find every excuse you can to write some code and see how it works. Spend the time, and become the wise master you know you can be.

Student: I really liked the notion of gaming the scheduler; it seems like that might be something to look into when I’m next running a job on Amazon’s EC2 service. Maybe I can steal some cycles from some other unsuspecting (and more importantly, OS-ignorant) customer!

ask questions, if they are good questions, and you have actually put a little thought into them


  • 2024/9/3 22:10- 9/4 16:00: chapter 2: introduction
  • 9/4 16:00 - 9/6 14:10 : chapter 4: processes
  • 9/6 14:10 - 9/11 19:50: chapter 5: Process API
  • 9/11 19:50 - 9/12 22:55: chapter 6: Direct Execution
  • 9/12 22:55 - 9/14 10:30 : chapter 7: CPU Scheduling
  • 9/14 10:30 - 9/25 21:20: chapter 8: Multi-level Feedback
  • 9/25 21:20 - 10/22 14:30: chapter 9: Lottery Scheduling
  • (TODO)chapter 10: Multi-CPU Scheduling (As this topic is relatively advanced, it may be best to cover it after you have studied the topic of concurrency in some detail)
  • 10/22 14:30 - 10/23 20:11: chapter 13: Address Spaces
  • 10/23 20:11 - 10/25 20:15: chapter 14, Memory API
  • 10/25 20:15 - 10/27 15:40: chapter 15 Address Translation (it's so darn simple!)
  • 10/27 15:40 - 11/2 18:15: chapter 16 Segmentation
  • 11/2 18:15 - 11/3 20:50: chapter 17 Free Space Management
  • 11/3 20:50 - 11/6 16:48: chapter 18 Introduction to Paging
  • 11/6 16:48 - 11/12 21:50: chapter 19 Translation Lookaside Buffers
  • 11/12 21:50 - 11/15 21:00: chapter 20 Advanced Page Tables
  • 11/15 21:00 - : chapter 21 Swapping: Mechanisms

To study Operating Systems effectively, focus on understanding core concepts, experimenting with code, and reviewing case studies of different operating systems. Here’s a suggested approach and some valuable textbooks and resources:

Approach

  1. Understand core concepts: Focus on processes, memory management, file systems, and concurrency.
  2. Experiment with code: Practice by working with an actual operating system kernel, like Linux, or using a simple OS emulator.
  3. Study real-world examples: Explore case studies or implementations to see how different OS principles are applied in practice.

Recommended Textbooks

  1. "Operating System Concepts" by Abraham Silberschatz, Greg Gagne, and Peter B. Galvin – A comprehensive book that covers a wide range of OS topics, suitable for beginners.
  2. "Modern Operating Systems" by Andrew S. Tanenbaum and Herbert Bos – Known for its clarity, this book provides an in-depth look at modern OS principles.
  3. "Operating Systems: Three Easy Pieces" by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau – An open-source book that explains complex OS concepts in a simple and digestible format.
  4. "The Design and Implementation of the FreeBSD Operating System" by Marshall Kirk McKusick – A more advanced, specialized book focused on the FreeBSD OS for students who want to dive deeper.

Additional Resources

  • Linux From Scratch – A project that guides you through building a Linux OS from scratch, giving hands-on experience.
  • MIT OpenCourseWare: Operating System Engineering (6.828) – A free MIT course with lectures, readings, and assignments.
  • Online OS Simulators – Websites like JOS (an educational OS) and MINIX 3 allow you to experiment with a simple OS environment.

This combination of theoretical study, practical application, and exploration of real-world OS examples will give you a well-rounded understanding of operating systems.


debug in vscode: https://github.com/vadimcn/codelldb, search "CodeLLDB" Extension in vscode marketplace

ASIDE: GREAT ENGINEERS ARE REALLY GREAT

Engineers like Jeff Bonwick (who not only wrote the slab allocator mentioned herein but also was the lead of an amazing file system, ZFS) are the heart of Silicon Valley. Behind almost any great product or technology is a human (or small group of humans) who are way above average in their talents, abilities, and dedication. As Mark Zuckerberg (of Facebook) says: “Someone who is exceptional in their role is not just a little better than someone who is pretty good. They are 100 times better.” This is why, still today, one or two people can start a company that changes the face of the world forever (think Google, Apple, or Facebook). Work hard and you might become such a “100x” person as well! Failing that, find a way to work with such a person; you’ll learn more in a day than most learn in a month.