5 ms·
Many universities now offer a course using the Computer Systems: A Programmer's Perspective book (http://csapp.cs.cmu.edu/index.html http://csapp.cs.cmu.edu/ind
by larsberg 16y ago
Many universities now offer a course using the Computer Systems: A Programmer's Perspective book (http://csapp.cs.cmu.edu/index.html http://csapp.cs.cmu.edu/index.html). This is a fantastic book, focusing on nit-picky assembly and C-level work -- all the foundational stuff for an operating systems or compilers class, even if you never go on to one. Having TA'd this class the last few years, I find most students really enjoy it.
In fact, I think most of the HN crowd would greatly enjoy the "bomb lab" (http://csapp.cs.cmu.edu/public/1e/labs.html http://csapp.cs.cmu.edu/public/1e/labs.html -- you can read the writeup but not get the source). The idea is that you have a binary and have to use gdb and some nice dumping tools to "defuse" a bunch of stages of the program, each with increasing difficulty. It's a fabulous exercise, and really makes students pick up a deep appreciation for stepping through assembly and data structures that are just lying around in memory.
- hello_moto 16y agoI used that book 5 years ago (2nd year system course). I love it (except the part where it teaches some weird language called HL or something...) I love the bomb lab exercise! LOVE LOVE LOVE LOVE! At my university, we split the book into two courses if I'm not mistaken. We moved away from a typical OS book (Albert S., Andy T., Stalling, type of book) to this. There are side effects though. The MOS, OS Concept, OS Concepts + Internals book have a typical path of teaching OS while this book merged the OS and hardware knowledge.
- raffi 16y agoI really believe that hacking is a good way to get students excited about systems programming and working at the systems level. I also noticed a stack smashing lab. Good stuff.
- hello_moto 16y agoDefinitely, it's more like a game for me.
- swolchok 16y agoIDA Pro seems to make the bomb lab considerably easier (e.g., by showing the basic block structure of the assembly); I imagine that the Hex-Rays decompiler would be even more so. Students willing to torrent that software would probably have a much easier time with the lab...
- scott_s 16y agoI had never heard of IDA Pro before, so I just took a cursory look. I don't think it provides significantly more information than objdump does, which we explicitly tell the students to use.
- swolchok 16y agoAll the information is in the binary, sure, but IDA makes the process a lot less tedious. objdump doesn't give you the pretty "graph view," showing the basic block structure of the code. (In particular, this is really nice for switches and other jump tables.) It doesn't make it trivially easy to see where certain rather important-looking strings are referenced in the code. It doesn't show strings that are being referenced right next to the assembly instruction that references them, like changing push 0x8049808 to push offset aD ; "%d" It doesn't let you mark up mov eax, [ebp-0x4] to mov eax, [ebp-first_number_I_entered] and have that renaming automatically propagated through the entire function, so that you can easily track accesses to the same variable. In addition, the Hex-Rays decompiler (http://www.hex-rays.com/decompiler.shtml http://www.hex-rays.com/decompiler.shtml) produces C-like output. I don't have a license for it, but I imagine it would make short work of the bomb lab.
- scott_s 16y agoThe Hex-Rays decompiler would probably make short work of the bomb lab, but I don't think IDA Pro would make much of a difference. For disassembling a large program, sure, but the program and the functions themselves are relatively small. They already know the basic structure of the bomb because we give them a C skeleton that calls all of the functions. The string pointer fetching would probably be the most useful, but once they figure out how to do it once, they only need to do it four or so more times.
- scott_s 16y agoI'm also a TA for this class at my university, and I think it is excellent. In fact, I think many of our grad students would benefit from taking it - the course emphasizes understanding the whole system stack in ways that other courses (such as a classic OS course) do not. The bomb and buffer overflow labs are probably the most interesting to the HN community, but the shell project is what I consider the most important project in the course. (We have five projects: bomb, buffer overflow, shell, memory allocator, web server.) Our shell assignment is quite a bit different from the original in that we parse the command line for them (putting the commands and pipelines into appropriate data structures), but they have to do everything else, including pipes and I/O redirection. Email me if anyone is interested in learning more about how we do our course.
- tam7t 16y agoThe labs for that course look awesome. Seems like a great way to tie together OS and computer architecture material.
- ramidarigaz 16y agoI just did the bomb lab. I had a blast (pun intended). We're using that textbook, and I've learned tons this semester. The buffer overflow lab was also a ton of fun. This class takes the cake for the most difficult and fun homework assignments I've ever had.
- Locke1689 16y agoAt Northwestern this course is called "Introduction to Computer Systems." To this day it is the best class I've taken at Northwestern. I guess I'm glad the professor decided to take the course with him when he left CMU.
- harnhua 16y agoI'm guessing that the speed, convenience and ease of abstraction that a higher-level language like C++ or Java offers is a pull-factor for CS instructors. Apart from systems-level programming classes, of course. Someone mentioned "Why C when higher-level languages will suffice?" and I thought that's pretty much spot on. In a data structures class, it seems easier not to have to debug cryptic core dumps and segmentation faults too often, especially since the focus is on algorithms. At least, that's the impression I got when speaking with TAs and professors. Or perhaps there are less systems-level programming enthusiasts nowadays? I took the class you TA'd, way back when the textbook was still a draft and absolutely loved it! As an EE guy, it was great to be able to get at the bits and bytes and really understand what it meant to be fetching, executing, branching to, jumping to instructions, allocating memory etc. The transition from assembly language to C was natural and I loved/hated every single core dump / segmentation fault that came with it. That class helped tremendously in getting me my first job, but I guess there are plenty of jobs that don't require working knowledge of C.