ossu / computer-science

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

RFC: Update OSTEP prerequisites #926

Closed palladian1 closed 2 years ago

palladian1 commented 2 years ago

Problem: The prerequisites listed for OSTEP do not reflect the background knowledge needed for the course.

Duration: 1 month

Background: The current listed prerequisites are "algorithms, familiarity with C is useful".

I took all of Core Theory before returning to OSTEP, but I found that none of the material from the algorithms courses was necessary to understand the course. I know real-world operating systems make heavy use of data structures and algorithms, but that's not the case in OSTEP. The lectures and homework assignments treat operating system concepts very generally, and the projects (where those concepts get applied) do not require any algorithms knowledge to complete them.

I recommend removing algorithms from the list of prerequisites. One advantage would be that students could now move through the OSSU curriculum from top to bottom as listed instead of jumping around between Core Systems and Core Theory. It might also make it easier for students to finish Core Systems sooner, as an integrated unit. One disadvantage I can think of is that the algorithms sequence might provide additional coding maturity needed before tackling OSTEP.

On the other hand, OSTEP has other prerequisites that aren't listed on the OSSU page. The OSTEP instructor explicitly states some of them in one of the early lectures: he assumes that students have taken a course on x86 architecture, are comfortable reading (but not necessarily writing) x86 assembly, and have some experience using systems programming tools like Makefiles, gcc flags, linker scripts for ld, and the objcopy and objdump utilities. I think it's possible for students to get by if they've taken Nand2Tetris, but familiarity with the above prerequisites would certainly make the course much easier.

The course also assumes deep knowledge of C, which is not reflected in the phrase "familiarity with C is useful". For example, the instructor identifies the initial-utilities project (where you implement shell utilities like grep, cat, zip, and unzip) as an indicator of a student's readiness to take the course; he even recommends that students (at UWisconsin, where the course was originally taught) who take longer than 60 minutes to complete it should schedule an appointment with him if they want to continue in the course.

Overall, my solutions to the assignments required C features like #pragma directives, bit-field structs (and bitmasks and bitwise arithmetic in general), POSIX threads and locks, function-like macros, function pointers, extern/inline/static keywords, C preprocessor directives in assembly files, etc. Students are expected to identify some C standards (e.g., that signed integer overflow is undefined behavior while unsigned integer overflow is defined and just wraps around back to zero). None of these were covered in the course or book (except for threads and locks, but the assignments assumed experience using them before the lectures or book discussed their implementations). They also weren't covered in CS 50. I found most of these features in the "advanced" chapters of C books I had read before taking this class, and I don't believe I would have been able to finish the course if I didn't already have a good amount of experience in C.

That said, it's definitely not my intention to say that OSTEP is a poor course for OSSU. It's still the best online OS course I've seen so far (and much easier than Hack the Kernel), with a complete set of lectures, a free textbook, and complete assignments (though admittedly, the tests are occasionally buggy and the assignments repo isn't maintained).

But I do believe the listed prerequisites should reflect the additional knowledge the course requires, especially since that knowledge isn't provided by other courses in OSSU, so I would recommend adding language identifying these prerequisites. One obvious drawback is that acquiring the required knowledge might add to the time it takes for OSSU students to complete the curriculum, but I think that's outweighed by the advantage of being frank with students up-front about the prereqs. I think that once students have met those prereqs, OSTEP should be about as challenging as any other OSSU course; without them, it becomes overwhelmingly difficult. (To my knowledge, only one other OSSU student has completed the OSTEP course, compared to the dozens who have completed Nand2Tetris.)

One last note: I definitely agree that OSSU shouldn't add courses to the curriculum just to teach a specific language, but I don't think the prerequisites should link students to hackr.io either. That might be great for other languages, but I think C is sort of unique due to its many pitfalls and the ease with which one can introduce serious bugs and security vulnerabilities in C code. I've found errors and insecure coding practices in the C tutorials listed on hackr.io as well as websites like GeeksforGeeks and TutorialsPoint. I recommend either removing the link altogether, or alternatively, pointing it to a list of recommended C resources that we know are (relatively) good/safe.

Proposal:

After these changes, the prerequisite list might look something like this: "Nand2Tetris, extensive C experience; familiarity with x86 assembly is useful".

Alternatives:

If either of these alternatives is preferred, I'd be happy to contribute the resources that I found useful for OSTEP.

spamegg1 commented 2 years ago

I disagree with the proposal, but completely agree with the general, overall ideas. The proposal will lead to even more confusion, and complaints. Learners will ask "how am I supposed to meet these prerequisites? They are not covered by the curriculum". Or "Am I supposed to learn all these other things before I can even take this course? How long would that take? Why does it say 12 weeks then?" and so on... I can't remember how many hundreds of "prerequisites" questions I must have answered. Obviously they are not going to find these RFCs and read them.

So it's not really this proposal's fault, it's the format we have itself that's the problem. The main issue with the "Prerequisites" column in the whole curriculum is that it's very short and creates a lot more confusion than it helps. I'd like us to do away with that column altogether and replace them with "course context" pages. @hanjiexi suggested this to me some time ago (I can't even find them on Github anymore). I can provide long, detailed explanations for many, if not most, courses.

OSTEP is probably the one course that requires detailed contextual explanation the most, out of all courses. I see learners just waltz in to this course all willy-nilly, like it's any other online course, and go like "oh look it's the first project! OK let's go!" then running into so many issues, wasting a lot of time and suffering pain. THIS COURSE IS NOT NORMAL. It's an exceptionally hard topic. Moreover, some of the tools and knowledge required is near impenetrable: you mentioned how hard it is to find a decent C learning resource, or learn all the "dark arts" and technical details for low-level code. Not to mention that it's basically cobbled together from bits and pieces here and there. We still don't have any idea how to do or test some of the projects, because the author does not maintain them. (Also for some reason, along with CS50 and Nand2Tetris, this course seems to attract people from all over the internet who never heard of OSSU before, or did any of the prior courses, to our Discord.)

As such, OSTEP would be the perfect starting candidate to take a crack at creating course context pages.

I think the best solution would be like this: @palladian1 write a long article, explaining all the details you listed here. I think you already have most of the relevant material written down. It should start by saying that this course is unlike others. It would have all the relevant information, with links to resources. You can say "this is the best we think there is" or "this is the best we could find/recommend so far". It can include a realistic discussion of how long it would take to learn all these things properly, and maybe suggest that there is no shame in just reading the textbook and doing the textbook homeworks and moving on, with the projects being more difficult and time consuming optionals, linking to your xv-annotated. You can mention the great benefits of doing the projects, and that the "prerequisites" are significantly lower if one decides not to do the projects.

Then we replace the "prerequisites" with a link to that article, which can be a Markdown file in a folder, like contexts. This can begin the slow phasing out of "prerequisites" and the phasing-in of "course context pages". Sorry if this feels like hijacking the issue and creating a lot more work for you, but I think this is the best choice. If we're gonna do it, let's do it properly.

palladian1 commented 2 years ago

I like the alternative proposal by @spamegg1 better overall!

My original proposal was trying to address the problem that the current OSSU curriculum doesn't fully prepare students for OSTEP; the biggest barrier is the C knowledge, but there's also a gap between OSSU's intro systems course (Nand2Tetris) and a systems course like CS:APP that covers all the other prereqs besides C that OSTEP expects students to know. But a "course context" page would let us explain that in more detail, plus we could add links to resources there. We could even host our own version of the OSTEP projects like @spamegg1 and I have been working on, with improved documentation and guides to running the tests on machines besides the UWisconsin lab computers.

I'd be super happy to start working on a "course context" page with all the notes and resources I've collected so far!

I do disagree on two points:

First, I actually don't think OSTEP is much harder than other OSSU courses, if the prerequisites have been met. At first, I found myself struggling with the x86-specific details, looking up hardware specs in old Intel manuals to try to make sense of what was happening in the code. I had to read manpages for objcopy and objdump, read Makefile tutorials... it was a lot to learn, and that was just the beginning in order to then be able to understand the actual topics being taught in the course. At the time, that was really frustrating, and it absolutely felt like OSTEP was significantly harder than any other OSSU course before it.

But my opinion changed completely when I found the CS:APP course: it turns out that every single one of those aspects I had struggled with were taught there, in a really clear way. It made me realize that the real problem isn't that OSTEP is impossible because you're expected to figure out x86 assembly function call conventions on your own; the problem is just that OSTEP expects you to have already taken a systems course like CS:APP that would have taught you that. I really wish I'd found CS:APP earlier; that would have saved me so much time. In retrospect, taking OSTEP right after Nand2Tetris without CS:APP in between them feels kind of like if someone tried to take Algorithms right after Py4E; yeah, you can probably figure it out, but it's gonna be a struggle. But once I found the right resources to learn the prereqs, the rest of OSTEP didn't really feel any harder than, say, Programming Languages, Nand2Tetris Part 2, or the Algorithms courses.

There is a caveat: the poorly-documented and unmaintained projects did cause some additional frustration when I couldn't figure out how to run the tests, or when the tests were buggy. But I think @spamegg1 and I have more or less ironed out most of the big issues there, at least for Linux systems. We could document that in a course context page, but we will have to figure out how to run them on Windows and macOS as other students take the course. Still, while it is annoying, I don't think it's too bad -- after all, the Programming Languages courses have similar issues with SML/Emacs in PL A and Ruby versions in PL C, and I definitely had my fair share of problems running the Nand2Tetris tests on Linux. So I think we can handle that either in the course context page or as problems arise,

Second, I disagree about skipping the projects. The course uses the projects as its primary assignments for a reason: the homework questions are just short "reading comprehension"-type questions, similar to the questions that pop up in the middle of videos on Coursera or edX. Many of them are simple demos for you to just watch. I'm a big fan of learning by doing, so I think it's important for OSSU courses to include programming exercises. I think doing OSTEP without projects is comparable to doing the multiple-choice questions in Algorithms without the programming exercises, or doing the in-video questions in How to Code or Programming Languages without any of the problem bank questions or homeworks. Plus, the ability to see the actual implementation of a simple Unix-like OS in xv6 is, for me, a big attraction of the course.

In addition, although I do agree that skipping the projects would shorten the time required, I don't think it's that big of a difference. It would remove some of the prerequisites like Makefiles and some of the x86-specific details (at the expense of losing the opportunity to understand how paging, context switches, interrupts, locks, etc. are implemented). But I think the biggest time sink by far is getting the required C knowledge, and that's actually just as important for the course as it is for the projects: without knowing C well, the vast majority of the material would be inaccessible. So I don't think removing the projects cuts down on the prereqs by much; if students have indeed learned enough C to understand the code examples in the lectures, then it wouldn't cut down on the time by much more than the normal amount of time it takes to do any assignment.

Completing the prereqs will take significant time, mostly spent learning C. Since this is the only course in the curriculum that requires C (although Computer Graphics requires C++), I think we can definitely expect that students in a time crunch (or students who aren't particularly interested in systems development) might decide not to do the projects, or might even skip OSTEP altogether, and I agree -- there's no shame in that.

The difference in my mind is that by affirmatively recommending the projects, the official OSSU curriculum will still meet the CS 2013 guidelines, especially for the Core-Tier2 hours, which I don't believe would be met with the homeworks alone. Then students can make their own decision about whether to stick with the official curriculum to meet the CS 2013 guidelines, or to cut out some parts of it.

spamegg1 commented 2 years ago

Alright, I think those are good points.

I've probably built up the difficulty too much in my head, and the course should be easier with our contributions and your roadmap through the projects. That is true.

I still think the book and homework alone cover the curriculum requirements, but I might have to do a deeper look into it. If the projects are doable and not too time consuming, there is no need to fight over this point.

Taking your disagreements as valid, could you make an accompanying pull request @palladian1 ? If you put fixes #926 in the title, Github will automatically pick it up and link it to this issue. It can give a better idea to other commenters. No rush, take your time.

spamegg1 commented 2 years ago

@palladian1 will be offline for a few days, but worked very quickly and very hard to provide me with an early draft of the context page. I think it looks great. Here it is for other commenters to see:

Context page early draft (click to expand) # 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 course we've found so far, but it does have some issues. 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). 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). 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. In order to satisfy OSSU's curricular guidelines, 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. * Read chapters 1 and 2 of the OSTEP textbook or 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 or 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 or 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) or 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 through 14 (and optionally, the second review lecture) or 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-arpacidduseau/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 ``` ## 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*](https://modernc.gforge.inria.fr), which is freely available online. 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 *`.) * [comp.lang.c FAQs](c-faq.com): answers to all of your questions about C minutiae. * [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/readings/pcasm-book.pdf): a short book on x86 assembly. * [GCC Inline Assembly HOWTO](https://wwww.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. ### 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.
waciumawanjohi commented 2 years ago

This looks like a well reasoned deep dive that should assist students in being successful in the course. I like the idea of having this as a linked page in the repo, which gives future students the ability to make pull requests as needed.

A breadcrumb for other readers of this RFC: the CS:APP course that palladian1 refers to as very helpful above is the same as the Computer Systems: A Programmer's Perspective course/textbook in the context draft.

byanofsky commented 2 years ago

The context draft is great!

Suggestion regarding the “Running the projects” section. Right now, the draft provides some guidance for running projects on a Mac or PC, with a mention that some students use VMs. Have you considered primarily recommending a cloud VM (such as GCP Compute Engine or AWS EC2)? Along with the recommendation, a setup script could be provided to configure and install necessary dependencies.

The benefit: students will start with similar environments. This mimics the original college course where students were provided with preconfigured VMs. I assume this eliminates issues and questions related to unique setups.

The 2 downsides: cost (although It should be less than $10 a month); those unfamiliar with cloud computing concepts may have difficulties (although some simple guides could help).

riceeatingmachine commented 2 years ago

For C: The instructor's website lists this book for learning C.

spamegg1 commented 2 years ago

@riceeatingmachine It's included in the draft under Resources/C/Additional(optional) resources. @palladian1 and I discussed it for a while, and we anticipated a lot of people mentioning K&R like you just did :) K&R is highly revered for obvious historical reasons (some people get upset if it's not the default recommendation) but it's old and outdated, not free and it can be hard to find a copy. We noticed there are too many options, and the "best resource" debate can go on forever, so we decided to reduce the options to two: one great free resource, and one arguably best non-free resource. (This idea is similar to how the curriculum had "Learn You a Haskell For a Great Good!" and "Haskell Programming from First Principles" back in the day.)

waciumawanjohi commented 2 years ago

That tracks with a quick check: K.N. King's C Programming: A Modern Approach has hundreds of ratings on both Amazon and Goodreads, which should give us fair confidence that they are a valid signal. Those ratings are almost equal to K&R's ratings on Amazon and Goodreads. And A Modern Approach was published about 20 years after K&R's most recent revision.

riceeatingmachine commented 2 years ago

Srivastava's C In Depth (Amazon, Goodreads) has great reviews too and costs 1/20th as much as KN King.

riceeatingmachine commented 2 years ago

I had an idea. There are 3 courses in Advanced Systems:

  1. Digital circuits
  2. Computer Architecture
  3. Computer Organization

Digital circuits covers:

How to efficiently and reliably encode information using bits The basics of digital signaling, combinational logic, CMOS technologies The principles of sequential logic and finite state machines Performance measures and design tradeoffs

Computer Architecture covers:

Instruction Set Architectures: datapaths and FSMs, programmable datapaths, the von Neumann model, storage, ALU instructions, constant operands, memory access, branches, jumps.
Assembly Language: from assembly language to binary, symbols and labels, instruction macros. Models of Computation: computability, universality, uncomputable functions. Compilers: interpretation vs. compilation, compiling expressions, compiling statements, compiler frontend, optimization and code generation. Procedures and Stacks: procedural abstraction, activation records and stacks, stack frame organization, compiling a procedure, stack detective. Building the Beta: circuit building blocks, ALU instructions, load and store, jumps and branches, exceptions. The Memory Hierarchy: memory technologies, hierarchical memory systems, the locality principle and caching, direct-mapped caches, block size, cache conflicts, associative caches, write strategies. Labs: simple assembly programming, Quicksort procedure, designing the 32-bit Beta processor.

Computer Organization covers:

Pipelined Beta: pipelined execution of instructions, data and control hazards, resolving hazards using bypassing, stalling and speculation. Virtual Memory: extending the memory hierarchy, paging using hierarchical page maps and look-aside buffers, contexts and context switching, integrating virtual memories with caches. Operating Systems: processes, interrupts, time sharing, supervisor calls. Devices and Interrupts: device handlers asynchronous I/O, stalling supervisor calls, scheduling, interrupt latencies, weak and strong priority systems. Processes, Synchronization and Deadlock: inter-process communication, bounded buffer problem, semaphores for precedence and mutual exclusion, semaphore implementation, dealing with deadlock. Interconnect: the truth about wires, point-to-point vs. shared interconnect, communication topologies. Parallel Processing: instruction-, data- and thread-level parallelism, Amdahl’s Law, cache coherency. Labs: optimizing your Beta design for size and speed, emulating instructions, extending a simple time-sharing operating system.

This stuff is covered by a book called Computer Organization and Design (much of) which I read last year. We could replace these courses with that book (I haven't read CS:APP but I think it would overlap as well).

We can replace these courses by either of these books and make that a prerequisite for OSTEP.

Note that the CO&D book requires the student to have completed Nand2Tetris 2 (because it assumes that you know how stacks etc work - it would be really difficult to understand the book if you haven't done Nand2Tetris before).

These books are also in the recommendations of teachyourselfcs.com and they recommend them as prerequisites.

Our favorite introductory book is Computer Systems: A Programmer's Perspective

Once you feel comfortable with the content of Nand2Tetris, we suggest either returning to CS:APP, or considering Patterson and Hennessy’s Computer Organization and Design, an excellent and now classic text.

The most significant “pre-requisites” in our opinion are: computer architecture before operating systems or databases, and networking and operating systems before distributed systems.

riceeatingmachine commented 2 years ago

If we add a C book to the curriculum, it can be listed as a pre-requisite to the Compilers course, which mentions:

An optional course project is to write a complete compiler for COOL, the Classroom Object Oriented Language. COOL has the essential features of a realistic programming language, but is small and simple enough that it can be implemented in a few thousand lines of code. Students who choose to do the project can implement it in either C++ or Java.

Since it as an advance and elective course, I presume people taking it will want to the final project. If you know C then using C++ should not be so hard (I presume).

waciumawanjohi commented 2 years ago

There are 3 courses in Advanced Systems... We could replace these courses with that book... and make that a prerequisite for OSTEP

This seems like a bigger discussion (replacing multiple courses with a textbook). Great contribution to point out another book that may suit as prerequisite preparation for OSTEP. I'd suggest keeping that separate from replacing other courses in the curriculum (a topic that could become its own RFC).

waciumawanjohi commented 2 years ago

If we add a C book to the curriculum, it can be listed as a pre-requisite to the Compilers course, which mentions: An optional course project... implement it in either C++ or Java.

I'm wary of listing a C textbook as prerequisite because there is a project that students can do in a related language.

waciumawanjohi commented 2 years ago

@palladian1 Lots of great comments on this RFC. Can you open a pull request with the changes you've envisioned, incorporating any changes you feel are right based on the feedback above?

My hypothesis is that it will be more maintainable to have a single context page, that is meant to provide context for any course that needs it, with only the single entry for OSTEP in it. When later contributors wish to add context for another class, they can add an entry in that one file. (An alternate approach would be a folder for context files, and each course gets its own context file). Either way, I recommend against creating empty entries/files for the other courses in the curriculum (which would be a maintenance headache when a course in the curriculum changed).

riceeatingmachine commented 2 years ago

I'd suggest keeping that separate from replacing other courses in the curriculum (a topic that could become its own RFC).

I don't mind making the RFC but I'm haven't taken the 3 advanced courses yet to do a full comparison.

waciumawanjohi commented 2 years ago

It's been many months since a PR based on the discussions here was invited. And there is now another RFC around the idea of adding context to courses (including OSTEP). https://github.com/ossu/computer-science/issues/976

In light of those facts, I'm closing this issue.