ossu / computer-science

:mortar_board: Path to a free self-taught education in Computer Science!
MIT License
165.81k stars 20.97k forks source link

RFC: Add less rigorous options for Operating Systems #1083

Closed riceeatingmachine closed 1 year ago

riceeatingmachine commented 1 year ago

Problem: The current recommendation for Operating Systems is really long. Students are required to learn C, x86, and then Read OSTEP.

This probably comes out to 200 hours if you solve some C problems and implement the code in OSTEP? If someone studies 10 hours per week, this is 20 weeks dedicated to just one topic.

Duration: 60 Days.

Background: Operating systems is a topic that you either use all the time, or barely use at all. In this case, some people might benefit from a shorter, less rigorous alternative if they are relatively sure they will go in a field that doesn't depend too much on OS knowledge.

I've been scouring the internet and I found NPTEL (National Programme on Technology Enhanced Learning) which contains a lot of computer science courses from The Indian Institute of Technology - the highest tech universities in India. Think of it like OCW for the IITs. They are generally though to be high quality courses in India, and this is the best university here. The downside is that there are not many practical assignments on NPTEL unlike their university counterparts.

NPTEL has a few operating systems courses that are video only (the big downside of which is that there are not programming assignments.) However they are short and appear to be self-complete.

Operating System Fundamentals [30 hours] and Real Time Operating Systems [10 hours] by IIT Kharagpur can be used as less rigorous options for Operating Systems for students who do not wish to devote 200 hours to C+x86+OSTEP.

Proposal:

  1. Give students both options - one extremely rigorous: C+x86+OSTEP (our current recommendation) and one less rigorous: Operating System Fundamentals + Real Time Operating Systems by IIT Kharagpur (we list both courses).

Alternatives:

  1. We can use the NPTEL courses in the core section, and move C+x86+OSTEP to the advanced section.
  2. We can keep the current recommendation as is and ignore the NPTEL courses.
spamegg1 commented 1 year ago

My view on the issue

I'm totally on board with making Operating Systems less rigorous.

The main length/difficulty comes from the OSTEP projects. Otherwise learning so much in-depth C/x86 is not necessary.

History/background

Back when I suggested replacing Hack the Kernel in my original RFC, my intention was to replace it with just the OSTEP book and its textbook homeworks (optionally supplemented by lecture videos) and nothing else. This was merged in, but later someone else also added the instructor's university website which has the OSTEP projects. I would consider this to be a significant change, but it was added without an RFC if I remember correctly. (Can't find the commit right now.)

Later in the Update OSTEP prerequisites RFC I tried to argue that OSTEP book + textbook homeworks were enough to fulfill the curriculum requirements. But I was a bit encouraged by the roadmap that was being drawn (though still had my doubts), I was also kind of tired of the whole situation, so I did not push my point too much and went along with it. Palladian had put so much work into it, it felt a bit wrong to reject it.

Curriculum requirements

There are many universities whose operating systems courses don't require lab assignments. There are also some whose do. Usually the most prestigious ones (Stanford, MIT, Harvard etc.) I don't believe that lab/programming assignments are necessary to fulfill our curriculum requirements. I've read through the OS section of the CS 2013 guidelines (page 135) and the only part that requires implementing or programming something is "Implement a simple device driver" which is an elective.

The other courses

Now I don't really have a big issue with these NPTEL courses on the surface. They seem fine.

My concern is adding yet another operating systems course that nobody had gone through and completed fully to report on it. This was the main problem with Hack the Kernel (almost nobody had done it until me, most were quietly skipping over it). Operating systems is a super tricky subject, where the lack of quality in a resource is exposed only by going through it properly. I took 2 different OS resources and spent well over 6 months on them, so I have some experience. The "Real Time Operating Systems" course mentions "C programming" as a prerequisite. So we don't really know how much time this entails, without taking the course ourselves.

On the surface the NPTEL courses look OK, but a bit low quality (mostly a video-dump). The "textbook" they have seems to be poorly thrown together, with slides copy-pasted into the document. The "assignments" are screenshots of multiple-choice quizzes from the website pasted together into a PDF. OSTEP is of much higher quality.

Another potential issue is that these NPTEL courses have no assignments at all, except a few multiple choice questions. I think that's too un-rigorous. The OSTEP textbook homeworks make you at least write some super basic code or run code that the author wrote for you. It's mostly Python code that simulates operating system concepts or fake/pretend assembly code, but also some basic C code as well. It gives you at least a sense that you're doing something.

My suggestion

I think the solution is extremely simple: we make OSTEP projects entirely optional. (Moving them to Advanced would beef up the Advanced section too much. The 3 Advanced Systems courses are quite long and difficult in their own right.) This side-steps all the complicated C/x86 issues, yet all the hard-work put into the projects is also preserved.

(Having said all that, I think I'm still fine with the NPTEL courses as the "easy quick" option.)

I was able to read the book and do the textbook-homework without learning C or x86 AT ALL. I did not watch any videos, I was unaware of their existence (I don't think his videos are very good, and many of the videos actually cover stuff related to the projects anyway). I still managed to have a solid grasp and understanding of all the operating systems concepts and I believe I met all the curriculum requirements. This took me about 1 month. Not quite as fast as the 40 hours of the NPTEL courses, it was around 80 hours. (Also it's 40 hours of just the videos themselves. If we add the NPTEL texts it adds up to more.)

We are currently saying this:

What this means for you is that if you're under a significant time crunch, or you're just not all that interested in systems programming and OS development, there's no shame in skipping this course and coming back to it later. You could also do only a part of the course (e.g. you might choose to skip the homework and/or projects).

So we just make this more prominent and more official. We say something like:

Reading through the OSTEP book and doing the textbook homework is sufficient to meet curriculum requirements. It should take you 8 weeks, 10 hours/week. Optionally you can watch the lecture videos if you prefer the video format to reading, but they are not as good, and will take more time. (Some of them are related to the optional projects below.)

If you are feeling adventurous and have a lot of time to spare (an additional 10 weeks), you can attempt the OSTEP projects, for which we did the best we could to draw you a roadmap below. They have a lot of prerequisites (very strong C programming and x86 knowledge). But there is absolutely no shame skipping them. If you plan to move on to Advanced Systems, you will have to learn these eventually.

riceeatingmachine commented 1 year ago

I was able to read the book and do the textbook-homework without learning C or x86 AT ALL.

Was your C background limited only to CS50? Did you find yourself googling the code? Can you tell me a bit more about your experience? I'm looking at the textbook and I find a lot of c programs in it.

Reading through the OSTEP book and doing the textbook homework is sufficient to meet curriculum requirements.

In this case, I do not see why the other things are in the curriculum. I think the big problem with the OSSU currently is that's it's far too long. We are approaching a situation that the courses are so many that they will dissuade people from even starting. If anything can be removed while still meeting the curriculum requirements, I support removing it.

spamegg1 commented 1 year ago

Was your C background limited only to CS50?

Yes.

Did you find yourself googling the code?

No, I did not use Google even once.

I'm looking at the textbook and I find a lot of c programs in it.

Yes, typing and running those programs was extremely helpful. They are fairly easy to understand. Moreover the book spends a few short chapters explaining the relevant C libraries such as the Thread API.

Also keep in mind that I'm quite strong in immutable/functional programming, and I struggle a lot with mutable/imperative programming. Throughout the curriculum I think I used a debugger maybe 3 times.

In this case, I do not see why the other things are in the curriculum.

After my Hack the Kernel RFC, it looked like this:

Courses Duration Effort Additional Text / Assignments Prerequisites
Operating Systems: Three Easy Pieces 10-12 weeks 6 hours/week Homework Lectures Supplement algorithms

It should be clear that the book and its homework is the intention here. I think the problem is the "Supplement" link... I should have never added that! :facepalm: Goddammit. It was pointed out during the RFC and others asked it to be included.

About a month after that, the links were replaced because someone found a different U Wisconsin course page with a more complete look that had everything in one place. After that commit it looked like this:

Courses Duration Effort Additional Text / Assignments Prerequisites
Operating Systems: Three Easy Pieces 10-12 weeks 6 hours/week - algorithms

I didn't notice this at the time.

After that, I guess people must have assumed that the OSTEP projects are mandatory (or decided to add the projects? or didn't check very thoroughly? or didn't understand how much more prerequisites are added by the projects?). I hadn't done the projects myself at that point. But some time later I noticed people asking for help on them. So I went along with it and decided to help out. So we wrote "all the other things."

All "the other things" are for the sake of enabling someone to do the projects. That's all. The book does not require them. Even with the calendar on Prof's course page, it's quite confusing how to go through the material, how to match the reading, videos and projects with each other, in what order. There are also many hidden requirements that U Wisconsin students have but our learners don't. So that's why we wrote up "all the other things." (Once again, it's extremely difficult for someone who hasn't personally gone through the material to understand why.)

In contrast, the book is completely self-contained, linear and straightforward. The book is free but also sold as hard-copy, and is intended to be used alone, without the projects. The book does not require any of "the other things."

I think the big problem with the OSSU currently is that's it's far too long. We are approaching a situation that the courses are so many that they will dissuade people from even starting. If anything can be removed while still meeting the curriculum requirements, I support removing it.

I agree overall. I'm also in favor of removing things. (For example when those Software Construction courses were discussed, I voted for "remove without replacement" but some replacements were added again later. The ones you recently opened up an RFC about.)

However our curricular guidelines are a huge document covering a ridiculous amount of stuff. I'm guessing that most universities don't cover a significant portion of it. We are probably covering way more than the average university. Looking into all the details of the guidelines, and all the details in online courses/resources, and making a sound judgment on what is covered, what is enough etc. takes a ridiculous amount of time and patience. Anyway, this is a broader, more general discussion. Let's stay on topic.

I don't have a problem removing the OSTEP projects from the curriculum. We can still link to the "projects guide" in some other way. Again, to be fair, we are currently saying "it's OK to skip this course and come back later." But I guess nobody reads it! Reading is super hard.

But there is a weird situation going on. You're probably not aware since you don't hang out on Discord much. Many people find OSSU and our Discord server through OSTEP alone, and they are primarily interested in doing the OSTEP projects. These learners usually don't go through the parts of the curriculum leading up to Operating Systems, and they are OK with spending time learning C and dealing with the difficult projects. (A somewhat similar thing applies to Nand2Tetris and CS50.)

riceeatingmachine commented 1 year ago

They are fairly easy to understand. Moreover the book spends a few short chapters explaining the relevant C libraries such as the Thread API. Also keep in mind that I'm quite strong in immutable/functional programming, and I struggle a lot with mutable/imperative programming. Throughout the curriculum I think I used a debugger maybe 3 times.

Hmm, in that case it would make sense to just have the textbook and get rid of projects or make them optional.

I think it would be best for learners if we meet the curriculum requirements with the minimum possible work. As you pointed out, most people were silently skipping HtK. Why? Probably because it was too long/hard.

Assuming the OSTEP book can be read without learning C from a textbook or spending time on x86, it would be a big upgrade to the course to just have the book (it's better than the NPTEL stuff, so we won't need a quick and dirty option).

All "the other things" are for the sake of enabling someone to do the projects. That's all. The book does not require them. Even with the calendar on Prof's course page, it's quite confusing how to go through the material, how to match the reading, videos and projects with each other, in what order. There are also many hidden requirements that U Wisconsin students have but our learners don't. So that's why we wrote up "all the other things."

I don't have a problem removing the OSTEP projects from the curriculum. We can still link to the "projects guide" in some other way. Again, to be fair, we are currently saying "it's OK to skip this course and come back later." But I guess nobody reads it! Reading is super hard.

I am in support of this change as well. I'm not certain that the projects belong in the curriculum in the first place. For all the computer science topics, we can find more indepth topics with lots of assignments, but we just want to meet the curriculum. We can move stuff to the advanced section (or build some kind of "degree with honors" section for people who want to go extra deep.)

However our curricular guidelines are a huge document covering a ridiculous amount of stuff. I'm guessing that most universities don't cover a significant portion of it. We are probably covering way more than the average university.

I agree. I think it distracts from core CS topics by having too many fringe topics (like haskell, prolog, etc). I asked some of my friends who are computer scientists from normal university and they aren't taught these things. I'm not saying we should do what other unis are doing, but there are many places where the curriculum can be cut while meeting all the core CS requirements.

As a sidenote, I took your advice on the Math for CS and I'm solving every problem in the textbook. I'm done with a third of the textbook - took about 180ish hours to get here. Should take about 300-400 hours to complete the rest of the textbook. I don't mind doing this if you think it's a good idea. Do you have any advice regarding this?

But there is a weird situation going on. You're probably not aware since you don't hang out on Discord much. Many people find OSSU and our Discord server through OSTEP alone, and they are primarily interested in doing the OSTEP projects. These learners usually don't go through the parts of the curriculum leading up to Operating Systems, and they are OK with spending time learning C and dealing with the difficult projects. (A somewhat similar thing applies to Nand2Tetris and CS50.)

I'm not sure if we should alter our curriculum to cater to non-OSSU students.

algorithms

I see this is a prerequisite for OSTEP. Is it actually required for the textbook? I'm not done with Algorithms (still doing math for cs). If it's not required (I read in one thread that it wasn't), I can extend the time for this RFC and read OSTEP now and see if I'm able to do it. Then we'll have some more empirical knowledge on whether learning C is necessary or not.

Alaharon123 commented 1 year ago

I think the solution is extremely simple: we make OSTEP projects entirely optional. (Moving them to Advanced would beef up the Advanced section too much. The 3 Advanced Systems courses are quite long and difficult in their own right.) This side-steps all the complicated C/x86 issues, yet all the hard-work put into the projects is also preserved.

Reading through the OSTEP book and doing the textbook homework is sufficient to meet curriculum requirements.

If you plan to move on to Advanced Systems, you will have to learn these eventually.

the book is completely self-contained, linear and straightforward

If the book is self-contained and sufficient for Core CS, but you need the projects for Advanced Systems, wouldn't it be better to put the projects in Advanced Systems? Since the idea is to do everything in Core CS, but not everything in Advanced CS

spamegg1 commented 1 year ago

Assuming the OSTEP book can be read without learning C from a textbook or spending time on x86.

Yes, that's what I argued in my Hack the Kernel RFC.

I'm not certain that the projects belong in the curriculum in the first place.

As I said, some universities have it, some don't. The universities that DO have it, don't have some of the other stuff in our curriculum. These choices are usually made based on historical or bureaucratic reasons, depending on the availability/interest of faculty to teach it.

But the guidelines do not absolutely require it (as far as I can read). Palladian's argument was that, OSTEP textbook homework was more of a "check your understanding" type and not good enough for proper mastery of OS subjects, and the projects were the real deal, and they were doable. I guess it could be argued back and forth. If you read the discussion here initially I was against it, but eventually I gave in. So I'm going back a bit again, after seeing people's difficulty with it. In his defense though he did write "feel free to skip it for now..." so I think that's fair. The main issue is that PEOPLE DO NOT READ! I feel like we could put a gun to people's heads and they still would not read. Reading is just too hard.

I see this is a prerequisite for OSTEP.

It's not. Someone must have written that there, to give some vague description (I loathe the "Prerequisites" column in general).

Is it actually required for the textbook?

There are a few scheduling algorithms but they are explained in the book. You don't need to have taken Core Theory.

I can extend the time for this RFC and read OSTEP now and see if I'm able to do it. Then we'll have some more empirical knowledge on whether learning C is necessary or not.

That's great! You do need to have some C understanding but it's not too bad. Consulting Modern C a bit here and there should do it.

The rest of your points go into more general curriculum-wide discussion so I'll hide them under a button not to distract from this topic:

Click to expand > I think it distracts from core CS topics by having too many fringe topics (like haskell, prolog, etc). I asked some of my friends who are computer scientists from normal university and they aren't taught these things. That's where we are in a unique position. Sometimes what the universities don't cover are actually *shortcomings*; we can cover things *better* than universities. Those courses (Haskell, Prolog, etc.) are not too time consuming or terribly difficult; moreover they are in the Elective section (Advanced). So I'd say, let's not throw the baby out with the bathwater. We don't need to trim everything just by looking at what universities cover. I think Operating Systems is just a particularly extreme exception that is **ridiculously difficult**. There is simply no way around spending hundreds of hours to learn C/x86 if you want to do kernel programming. Normally it's done in one semester with a class, prof, TAs, lectures, recitations and it's a subject that exposes the limits of self-learning. > I'm not saying we should do what other unis are doing, but there are many places where the curriculum can be cut while meeting all the core CS requirements. Ah OK... :smile: We can relax the elective section to be more "pick and choose based on interest and time". That should do it. > As a sidenote, I took your advice on the Math for CS and I'm solving every problem in the textbook. I'm done with a third of the textbook - took about 180ish hours to get here. Should take about 300-400 hours to complete the rest of the textbook. I don't mind doing this if you think it's a good idea. Do you have any advice regarding this? This seems like a personal question, let's talk elsewhere. I'm spamegg#3510 on Discord. (The short answer is that, you are trying to make up for YEARS OF MATH LEARNING that you should have done earlier in your life, so it's actually a small price to pay.) > I'm not sure if we should alter our curriculum to cater to non-OSSU students. Well I'm not sure if we should just refuse to help them either... What's an OSSU student anyway? People feel free to skip over things even earlier in the curriculum... there is no oath or covenant between us and the learners. We are also learners on the "same level".
spamegg1 commented 1 year ago

If the book is self-contained and sufficient for Core CS, but you need the projects for Advanced Systems, wouldn't it be better to put the projects in Advanced Systems?

Sorry I'm having difficulty explaining what I mean.

I meant that, the prerequisites for the OSTEP projects (like x86 assembly and lower-level C programming) will be covered in Advanced Systems. But it's not a simple, 1-1 replacement like: "move these prerequisites from here to there."

They will be covered in a different, more complicated context (not an old operating system like xv6 but more modern, and not specifically kernel programming), and in a more technical, demanding and difficult way, with TONS of other stuff going on. Whereas the context in the OSTEP projects presents you a much simpler, isolated version. (It's a bit like going from Nand2Tetris to OSTEP; if you haven't done N2T you'd have a much harder time in OSTEP.)

So it might be helpful to be familiar with them ahead of time. So for those who already plan on moving to Advanced Systems, it might be a decision to put in the work earlier and get the experience with OSTEP to make their time in Advanced Systems easier, or just do it all in Advanced Systems with more time spent and higher difficulty instead.

Also I meant to imply that, there might be people, who might want to to OSTEP projects but not Advanced Systems. There might be people who want something in between just reading OSTEP textbook and going all the way to Advanced Systems.

Also I meant that, it might be argued to move the OSTEP projects to Advanced Systems as a "we recommend you do this first" way, it can also be argued that it beefs up the Advanced Systems too much.

Systems is just too difficult!

:relieved: I think that explains it, I hope?

Alaharon123 commented 1 year ago

I think it makes more sense to move the projects to advanced than to make them optional in core. People can do as much or as little of Advanced stuff as they want. Moving the projects to Advanced puts them in the optional section where they probably belong, and then anyone who wants to do just that and not Computation Structures can, and anyone who wants to do both can, and anyone who wants to do neither can, and everything is consistent. And Computation Structures is technically just one university course anyway, Systems is just hard. And it's kind of just hiding it by putting it as optional in core and then telling people in advanced to do the optional core stuff

spamegg1 commented 1 year ago

Placing the projects in Advanced is not a good idea; it will create too much of a time gap between a learner's first encounter with OSTEP and their later encounter (if they go through the curriculum linearly). It would be best for them to do the projects while everything is fresh in their minds to solidify their learning and commit them to long term memory better. Advanced Systems will throw so much more new technical knowledge at them. It's best to keep it in the Core as optional for those who plan to move to Advanced Systems.

The other issue is that, it doesn't work as: "read the OSTEP book in its entirety, and do its textbook homeworks; then afterwards do the projects." (Sorry if that wasn't clear before.) If you look at our current guide, the book and the projects need to be matched week by week, chapter by chapter: you have to read some of the book, watch some of the videos, and do a project, and repeat. So a learner would pick only one of the two approaches: just the book+hw (if they don't plan on Advanced Systems), or start with the current guide from the very beginning (if they plan on Advanced Systems).

I hope that clarifies it.

spamegg1 commented 1 year ago

Just to give an idea of what I'm trying to say, here's a draft. This is basically a slight re-write of what we already have (which already says "feel free to do only the homework and skip the projects" but I guess NOBODY READS THE DAMN THING):

Operating Systems: Three Easy Pieces

First, we should be frank: it's really hard to find a good self-contained online course on operating systems. OSTEP is the best resource we've found so far. Taking the time investment and the high difficulty into consideration, we came up with 2 options for you.

If you don't have too much time, or you're just not all that interested in systems programming and OS development, then the first option is for you. It's around 80 hours, and covers all of our curriculum requirements (don't worry, you won't be missing out on anything!). This is the logical option for most people.

The second is significantly longer (around 200 hours) and challenging, but it's incredibly valuable if you plan to go seriously into Systems Programming and you plan on taking our Advanced Systems section later. This involves learning very serious C and x86 assembly, and delving deep into kernel programming.

If you don't plan to go into Systems/OS Programming (or don't have too much time): Read through the free online textbook [Operating Systems: Three Easy Pieces](https://pages.cs.wisc.edu/~remzi/OSTEP/) and do the homework questions [at the end of each chapter](https://pages.cs.wisc.edu/~remzi/OSTEP/Homework/homework.html). (There is an associated [Github repository](https://github.com/remzi-arpacidusseau/ostep-homework/) for the homeworks.) This should take about 8 weeks, 10 hours/week. That's all you need to do! You will need a Unix/Linux system, some basic command line tools, and a C compiler (such as GCC or Clang). On Windows, you can install Ubuntu in a virtual machine, or use WSL (Windows Subsystem for Linux). Mac OS is Unix-like, so it should be OK to use. **Question: I see some C code in this book. How much C do I need to know?** **Answer:** You'll need to read and understand some C code in this book. You'll need basic understanding of arrays, pointers and print formatting. You can consult the free book [Modern C](https://hal.inria.fr/hal-02383654/file/ModernC.pdf) by Jen Gustadt. The [CS50 Manual pages](https://manual.cs50.io/) are also helpful to look up functions. You shouldn't spend too much time on learning C. The code you'll read is fairly simple and presented in short fragments. The book helps you out quite a bit by manually introducing many C APIs such as the Process API, the Thread API, and so on. You can type, compile and run the code fragments, and read the corresponding explanations. The book explains them in great detail in a conversational style that's fun to read. You will also write *a little bit* of C code. Only a minority of the chapters (about 10 out of 50) ask you to write some C code (while the other chapters require you to run provided simulation code and answer questions). These are usually simple, short C programs that imitate the code that was presented in that chapter, with small modifications. If you are getting stuck on these, please don't spend too much time on them. There is a great solution set [here](https://github.com/xxyzz/ostep-hw). There is no honor code for this, so you are free to use the solutions. If you find yourself spending too much time, feel free to read and understand the solutions instead. Your main priority should be to gain understanding of operating systems concepts, not to master C coding.
If you plan to go into Systems/OS Programming, take Advanced Systems (and have a lot of time): Credit goes to [palladian](https://github.com/palladian1) ## Introduction If you've chosen this option, then this is the first course in the OSSU curriculum for which you'll need to learn some prerequisites on your own before starting it, in addition to the courses that come before it in the curriculum. You might also run into some issues running the scripts for homework demos and for testing your solutions to the projects (although we hope we've solved most of those by now). That said, if you're able to commit the time required for the prerequisites, we believe the reward is well worth the effort: this course is exciting, interesting, and quite useful for other fields of computer science and programming. One big attraction of this course is the opportunity to see a simplified but fully-functional Unix-like operating system in action and understand the concepts and design decisions that went into it as well as the low-level implementation details. You should either watch all the lecture videos or read chapters 1 through 47 in the textbook (don't worry, the chapters are usually just a few pages long) as well as finish the projects listed below. We also strongly encourage you to do the homework exercises as they're assigned on the course website or in the book chapters; think of these like the "check-your-understanding" questions that pop up in the middle of lecture videos on sites like Coursera or edX. ## Prerequisites This class requires a lot of experience programming in C. You should finish one of the C books listed in the ***resources below*** *before* starting this course; if you try to learn C at the same time as the course material, you're likely to feel overwhelmed. If you haven't used C before, you should expect to spend a lot of time on this; it's hard to predict how long it might take for each person, but a rough estimate might be 8-10 hours per week for 3-5 weeks. You can always learn C alongside another OSSU course or even redo the exercises for other courses in C to gain practice with it. You should also finish both parts of Nand2Tetris before starting this course. OSTEP focuses on the real-world x86 and x86_64 architectures, so you'll have to fill in some gaps in order to translate the concepts you learned in Nand2Tetris to a new architecture. You can do that with the x86 resources below, but note that they all assume you know C, so learn that first. This should take around 6-8 hours in total. ## Course Links * [Course website](https://pages.cs.wisc.edu/~remzi/Classes/537/Spring2018/) * [Book](https://pages.cs.wisc.edu/~remzi/OSTEP/) * [Lecture videos](https://pages.cs.wisc.edu/~remzi/Classes/537/Spring2018/Discussion/videos.html) * [Homework](https://pages.cs.wisc.edu/~remzi/OSTEP/Homework/homework.html) * [Homework repo](https://github.com/remzi-arpacidusseau/ostep-homework) * [Projects](https://github.com/remzi-arpacidusseau/ostep-projects) * [xv6](https://github.com/mit-pdos/xv6-public) ## Roadmap This course was originally taught as CS 537 at the University of Wisconsin by the author of the OSTEP textbook, so the projects are assigned in the course according to the best times to give UWisconsin students access to on-campus resources like recitation sections and office hours. That means they don't match up perfectly with the material being covered at that time in the lectures or textbook chapters. We recommend doing the course in the following order instead. [Reading order](Reading-order.md) * Read chapters 1 and 2 of the OSTEP textbook and watch the first half (the introduction) of lecture 1. * Do the `initial-utilities` project; it's intended as a litmus test for you to make sure you're comfortable enough with C before taking this class. You can watch discussion 1 for help. If it takes you more than 2 hours to write the code (not counting the discussion time and any time spent debugging), you should consider spending more time learning C before moving on in the course. (If you want more practice, you can do `initial-reverse` too, but it's not required.) * Watch lectures 1 through 5 and read chapters 3 through 24 of the OSTEP textbook. We recommend doing the homework assignments as they come up in the course calendar or book chapters. * Watch discussion 3 and reread chapter 5, then do the `processes-shell` project. * Read the annotated guide to xv6 linked in the resources section below, starting from the beginning and stopping after the `System Calls: Processes` section. * Watch discussion 2, then do the `initial-xv6` project. * Watch discussion 5, then do the `scheduling-xv6-lottery` project. * Watch discussion 7, then do the `vm-xv6-intro` project. * Watch lectures 6 through 9 (and optionally, the review lecture) and read chapters 25 through 34; again, you're encouraged to do the homework. * Watch discussion 10, then do the `concurency-xv6-threads` project. * Watch discussions 11 and 12, then do the `concurrency-mapreduce` project. * Watch lectures 10 through 14 (and optionally, the second review lecture) and read chapters 35 through 47; remember to do the homework along with the lectures or chapters. * Do the `filesystems-checker` project. ### Running the Projects This course was originally taught as CS 537 at the University of Wisconsin by the author of the OSTEP textbook, which means that the homework and projects were written with those students as a target audience and designed to be run on UWisconsin lab computers with specific software versions pre-installed for students. We hope this section fixes that so you can run them on other computers, but we haven't tested this on every computer, so if you run into other issues, let us know on the [Discord channel](https://discord.gg/MJ9YXyV) and we'll try to help out. In order to run the homework and projects on Linux or macOS, you'll need to have all of the following programs installed: * `gcc` * `gas` * `ld` * `gdb` * `make` * `objcopy` * `objdump` * `dd` * `python` * `perl` * `gawk` * `expect` * `git` You will also need to install `qemu`, but we recommend using the patched version provided by the xv6 authors; see [this link](https://pdos.csail.mit.edu/6.828/2018/tools.html) for details. On macOS, you'll need to install a cross-compiler `gcc` suite capable of producing x86 ELF binaries; see the link above for details as well. On Windows, you can use a Linux virtual machine for the homework and projects. Some of these packages are not yet supported on Apple M1 computers, and virtual machine software has not yet been ported to the new processor architecture; some students have used a VPS to do the homework and projects instead. Next, clone the `ostep-homework` and `ostep-projects` repositories: ```sh git clone https://github.com/remzi-arpacidusseau/ostep-homework/ git clone https://github.com/remzi-arpacidusseau/ostep-projects/ cd ostep-projects ``` You'll have to clone [the `xv6-public` repository](https://github.com/mit-pdos/xv6-public) into the directory for each xv6-related OSTEP project. You could use the same copy for all the projects, but we recommend using separate copies to avoid previous projects causing bugs for later ones. Run the following commands in *each* of the `initial-xv6`, `scheduling-xv6-lottery`, `vm-xv6-intro`, `concurrency-xv6-threads`, and `filesystems-checker` directories. ```sh mkdir src git clone https://github.com/mit-pdos/xv6-public src ``` ### Hints and tips for Projects - `initial-reverse`: the error messages that are needed to pass the tests were wrong! The provided text said `"error: ..."` but the tests expected `"reverse: ..."` so make sure to match the tests' expectations in your code. - [hints and tips for `processes-shell`](Project-2A-processes-shell.md) - [hints for Project 1B: `initial-xv6`](Project-1B-initial-xv6.md) - [hints for `scheduling-xv6-lottery`](Scheduling-xv6-lottery.md) - [hints for `vm-xv6-intro`](vm-xv6-intro.md) ## Resources ### C Please don't try to learn C from sites like GeeksforGeeks, TutorialsPoint, or Hackr.io (we're not even gonna link to them here). Those are great resources for other languages, but C has way too many pitfalls, and C tutorials online are often filled with dangerous errors and bad coding practices. We looked at many C resources for the recommendations below and unfortunately found *many* bad or unsafe ones; we'll only include the best ones here, so look no further! We recommend learning C by working through (the entirety of) Jens Gustedt's *Modern C*, which is [freely available online](https://hal.inria.fr/hal-02383654/file/ModernC.pdf). This book is relatively short and will bring you up to speed on the C language itself as well as modern coding practices for it. Make sure to do all the exercises in the footnotes! While the book above is our default recommendation, we also recommend K.N. King's [*C Programming: A Modern Approach*](http://www.knking.com/books/c2/) as a second, more beginner-friendly option. It has some disadvantages: it's much longer (almost 850 pages), it's not available for free (and copies can be hard to find), and it's not quite as recent as *Modern C* (but still relevant nonetheless). That said, it has more exercises if you want extra practice, and the Q&A sections at the end of each chapter are filled with pearls of C wisdom and answers to C FAQs. It also covers almost the entirety of the C language and standard library, so it doubles as a reference book. CS 50 doesn't quite cover enough C for OSTEP, but if you've already taken CS 50, you can supplement it with the books above. Additional (***optional***) resources include: * [CS 50 Manual Pages](https://manual.cs50.io): a great reference for looking up C library functions; most functions include both the usual manual as well as a beginner-friendly "less comfortable" option (just note that the "less comfortable" version uses `string` as an alias for `char *`.) * [cdecl](https://cdecl.org): a tool to translate C gibberish into English. * [C track on exercism.io](https://exercism.io/tracks/C): additional practice exercises. * [Secure Coding Practices in C and C++](https://www.amazon.com/dp/0321822137): if you want to understand why other C resources are so unsafe. * [*The C Programming Language*](https://www.amazon.com/dp/0131103628): the original book on C by its creators. Too outdated for OSTEP, but a good read if you manage to find a copy. ### x86 Architecture and Assembly Language Nand2Tetris has already introduced most of the concepts you'll need to understand systems and computer architectures, so now you just need to port that knowledge to the real-world (32-bit) x86 architecture. The easiest way to do that is by watching a subset of the lectures from the *Computer Systems: A Programmer's Perspective* course (or reading the matching chapters in the [textbook](https://www.amazon.com/dp/013409266X) of the same name). The lectures you'll need are: * [Machine-Level Programming I: Basics](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=6e410255-3858-4e85-89c7-812c5845d197) * [Machine-Level Programming II: Control](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=fc93c499-8fc9-4652-9a99-711058054afb) * [Machine-Level Programming III: Procedures](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=2994255f-923b-4ad4-8fb4-5def7fd802cd) * [Machine-Level Programming IV: Data](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=03308c94-fc20-40d8-8978-1a9b81c344ed) * [Machine-Level Programming V: Advanced Topics](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=3f0bf9ca-d640-4798-b91a-73aed656a10a) * [Linking](https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=0aef84fc-a53b-49c6-bb43-14cb2b175249) Additional (***optional***) resources include: * [CPU Registers x86](https://wiki.osdev.org/CPU_Registers_x86): good for looking up specific registers. * [*PC Assembly Language*](https://pdos.csail.mit.edu/6.828/2018/readings/pcasm-book.pdf): a short book on x86 assembly. * [GCC Inline Assembly HOWTO](https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html): a guide to writing assembly code inside a C program. * [*Intel 80386 Programmer's Reference Manual*](https://pdos.csail.mit.edu/6.828/2018/readings/i386.pdf): the official (and huge) resourcefrom Intel. ### xv6 You don't need to read anything about xv6 until after you start OSTEP; in fact, we recommend holding off on the xv6-related projects until you've finished the entire section on virtualization. After that, you'll need a guide to walk you through the source code. The xv6 authors provide a [book](https://pdos.csail.mit.edu/6.828/2018/xv6/book-rev11.pdf) that you can read alongside the source code. There's also a handy line-numbered [PDF version](https://pdos.csail.mit.edu/6.828/2018/xv6/xv6-rev11.pdf) of the code with an index to see exactly where each function or constant gets used. However, that book glosses over a lot of the details in the code that you might find challenging, including the advanced C features used, the x86 architecture- specific instructions, and the concurrency aspects (if you haven't finished that section of OSTEP before starting the xv6 projects). To solve this problem, we provide an [annotated guide to xv6](https://github.com/palladian1/xv6-annotated) that goes over the entire xv6 code and analyzes it line-by-line with explanations of the C features, hardware specs, and x86 conventions used. That means it's longer than the official xv6 book, so you don't have to read all of it (and you can probably skip the optional sections unless you care about device drivers), but you can use it as a reference if you're scratching your head about some part of the code. Also [here](https://www.youtube.com/playlist?list=PLbtzT1TYeoMhTPzyTZboW_j7TPAnjv9XB) is an excellent video series walking through much of the xv6 code. ### Miscellaneous You'll need a general sense of how Makefiles work in order to use the Makefile for xv6. [This tutorial](https://makefiletutorial.com) covers much more than you need; just read the "Getting Started" and "Targets" sections and come back to the rest later if you need to look something up (but you shouldn't have to). Additional (optional) resources include: * [GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Invoking-GCC.html#Invoking-GCC): a guide to command-line flags for the GNU C compiler `gcc`. * [Linker Scripts](https://sourceware.org/binutils/docs/ld/Scripts.html#Scripts): a guide to writing scripts for the GNU linker `ld`. * [OSDev Wiki](https://wiki.osdev.org): a great resource for all kinds of OS concepts and implementation details. * [*Linux Kernel Development*](https://www.amazon.com/dp/0672329468): if you want to apply your xv6 knowledge toward contributing to the Linux kernel, this is a great read after OSTEP.
riceeatingmachine commented 1 year ago

NOBODY READS THE DAMN THING

Hahahahah, maybe we should add a TLDR at the top.

Something like:

If you don't plan to go into Systems/OS Programming: Just read OSTEP and use [This C Book] for reference if you can't understand a C program. You need to do the first half of CS50 first or any other course to learn the basics of C.

If you plan to go into Systems/OS Programming: You need to read OSTEP, and learn Advanced C [NN King/Modern C] and x86 to solve the OSTEP projects.

Full Version:

...

spamegg1 commented 1 year ago

Yeah... giving LESS details might be better :rofl:

r0hitm commented 1 year ago

I really liked your draft @spamegg1 ! It's very detailed and informative. I don't think anyone will have any doubts what to do and what not. Personally I would like a rigorous course and I am looking forward to take this course. And this nice draft just makes my personal planning much easier. It also helps me prepare mentally for the upcoming material. I haven't really read the guidelines to comment on the issue, but if someone asked me, I would probably opt for a more rigorous version with projects. This is coming from a guy who is interested in systems though.

MartinOvington commented 1 year ago

The University of Wisconsin students taking the course that follows the OSTEP book will usually have already taken this computer systems course from what I understand: https://pages.cs.wisc.edu/~gerald/cs354/Spring18/

Their systems course follows K&R and then CSAPP, so they will have had a fair amount of exposure to C and some Assembly. The Wisconsin students are assigned the OSTEP projects in pairs and have TAs for support, neither of which OSSU students would have the benefit of.

The problem that I had with OSTEP was figuring out what study to undertake to have the C programming skills necessary to do the projects. In the end I did about 60hrs of work between K&R and Learn C the Hard Way. I attempted all the projects and found it challenging and there were a couple that I couldn't complete 100%. I did some past exams and the textbook homeworks for the course too. In the end I spent 215hrs on OSTEP excluding the time learning C. Taking this course was a big undertaking, but I do feel like I learned an enormous amount from taking it and consider it a core part of what I've learned from working through OSSU.

The textbook was excellent in my opinion. If there's one thing that had to be taken out to make it shorter, I'd vote for the xv6 projects. I think they're just quite difficult to do working solo on your own home setup.

spamegg1 commented 1 year ago

@MartinOvington Agreed, your experience seems to closely match the "long and difficult" option in my draft above, and your suggestion seems to reflect the proposal I am making here. Thanks for the useful comment.

waciumawanjohi commented 1 year ago

It's good to see convergence around a solution. Spamegg I like your proposal. I have some opinions on the exact language to clarify that skipping the xv6 projects should be the default. I'll be able to draft something next week.

johnwesely commented 1 year ago

I figured I would deposit my two cents as someone who finished OSTEP minus the file system checker XV6 project that didn't include the test images.

  1. The book is extremely well written and relatively easy to digest given the subject matter. The concepts learned from the book inform my decision making on a daily basis even though I don't do systems programming. This course, along with Nand2Tetris and CSAPP, formed the basis for how I conceptualize computers and therefore make me much better at programming them than I would be otherwise.

  2. Some of the projects are fairly brutal, but they also gave me critical experience working with a large and obtuse code base. Nothing else I encountered in the curriculum gives this, and I do think it is extremely valuable for professional development. These projects also helped cement the principles from the book in my brain. I imagine I wouldn't remember too much from the course without them.

  3. I looked back at my GH, and it seems like I started Modern C on August 25, 2021 and made my last commit to my OSTEP repo on Nov 30, 2021, so between learning C, doing part of CSAPP, and OSTEP, I spent roughly 300-360 hours working on this course total.

  4. From the discord, it seems like a lot of students get hung up on prepping for OSTEP, since most of the prerequisites are self guided.

  5. While I agree that the XV6 projects probably should be optional, the pre-XV6 projects are not that difficult, pretty fun, and highly educational. In addition, I have heard from multiple of my friends who are CS grads that they did similar projects in their coursework.

  6. I also want to thank Spam and Palladian for all the work they have done to make this course more accessible. It truly is appreciated.

riceeatingmachine commented 1 year ago

Update: End of 1 month period.

We are yet to receive drafts from @waciumawanjohi so increased the RFC period to 60 days.