7 ms·
Author here ... Yes as pointed out many times not "computer science" and I somewhat regret the name. However, it came out of me being a teaching assistant for
by delsarto 7y ago
Author here ...
Yes as pointed out many times not "computer science" and I somewhat regret the name. However, it came out of me being a teaching assistant for people doing computer science degrees. A surprising number of people got to 3rd year operating systems courses without realising things like 2^10 is a kilobyte, 2^20 is a megabyte, etc. Let alone how a program was linked and loaded. I hope for this to be helpful, there are plenty of similar resources but sometimes the way one person says something resonates more than another.
I deliberately wanted to avoid x86-only to illustrate for similar reasons. Unfortunately Itanium proved to be a poor choice, ARM would have been better, but it gives me something to update if I get time! However, much of the basic content still remains relevant many years on.
- dang 7y agoWhat year should we put up there?
- yellow_lead 7y agoLooks like someone has vandalized your guide. > Reordering > This bit is crap
- delsarto 7y agoYes, it has some rough edges. One lesson you can learn is probably not to write things like this, and just let what you have stand as it is, and incrementally improve it.
- yellow_lead 7y agoThanks for the guide nonetheless. Going to be refreshing myself on a lot of this.
- solidasparagus 7y agoIs there a mechanism to submit fixes? This is a wonderful resource, but the deeper I get, the more I find it needs a little proofreading. I'd be happy to open PRs/whatever with typo/grammatical fixes. Also, thanks for writing this - I've had to deal with more and more of these concepts recently and this is the first resource I've found that has helped me understand how the parts fit together and why they exist.
- acbart 7y agoIsn't it amazing how people pass courses, even perhaps demonstrate mastery at a point in time, but manage to get to later courses without fully understanding things? Students end up with a very strange mental framework by the time they graduate, and it seems like most students actually know shockingly little. I don't know that there's a solution, or even that it's an issue. To me, this is simply a reflection of how people learn. Regardless, this seems like a nice little document for those 20% of students who are still willing to read supplementary materials. Then again, this is short and clear enough that if it were properly chunked within a course and had graded assignments attached, many students would probably actually skim it. If you ever want to develop this some more, I hope you'll consider something like Runestone[0], in order to give it some auto-graded questions along the way! [0] https://runestone.academy/runestone/default/user/login?_next=/runestone/default/index https://runestone.academy/runestone/default/user/login?_next...
- henrikschroder 7y agoWhen I did my CS programme decades ago, we all started with Scheme, which is very high-level, and forced everyone to focus on the algorithms, the math of it, instead of what the hardware is doing, or how the Scheme interpreter is implemented. It gets you going, thinking about values and execution and iteration and recursion. Starting with bits and bytes and hardware would be pretty goddamn boring, I think. You'd lose a lot of students that way. That said, in the third year we had a course in analog electronics, which was basically transistors and logic gates. Following that course was one in digital electronics, where we all built our own little toy 8-bit computer, wiring the CPU ourselves, writing the microcode ourselves. I'll never forget the a-ha moment when you realize that your instruction set are just binary patterns representing which wires to put a current on, which units to toggle on and off. The instruction to move a value from a register to an address in RAM has to look like this, because you need to toggle the read input on the correct register, and the write input on the RAM unit, and everything else has to be off. Blew my mind at the time. The clock was manual if you wanted to, so you could step through and watch your little CPU run a program, or you could set it to like 1Hz and watch the thing go. And from there, you can sort of get how a modern computer works, it's just a matter of going from 1Hz to 1GHz, wider buses, wider instruction sets, but it's no longer "magic" how the CPU works, it's all ones and zeroes, for a reason, and you now know that reason.
- zelly 7y ago*kibibyte
- diego898 7y agoHello, thanks for releasing this! Are there any plans to release chapter 10?
- delsarto 7y agoIt is written in DocBook, which has become increasingly annoying to publish with and I think is, unfortunately, unmaintained now. I have been considering some parts on containers and virtualisation which isn't covered at all. The Itanium and PowerPC examples probably haven't aged well. There is no question that Itanium is a very interesting architecture with many interesting features, but now it is dead it's like deciphering hieroglyphs. I think I have to update these to ARM, or maybe even RISC-V to be more relevant moving forward. So that would be my plans, as they were :)
- userbinator 7y agoI actually think "bottom up" is more of a misnomer than "computer science" as a title for this material, since when I think of "bottom up" I think of things like nand2tetris and Petzold's book. This looks more like "selected topics in operating systems" with some review of computer architecture basics mixed in.
- delsarto 7y agoThis was really seeded for me when trying to teach people taking computer science courses who were trying to do practical things like integrate C libraries into their higher level projects, but didn't really understand how things were working under the hood and getting themselves into a mess. If they understood a little more about how their program was built and run ... from the bottom up, as it were :) ... they would have had less pain. Of course, it just shows as usual the hardest problem in computer science is indeed, naming! Edit: BTW you're right, "Code" by Petzold should be required reading http://www.charlespetzold.com/code/index.html http://www.charlespetzold.com/code/index.html
- absorber 7y agoPerhaps adding a "Prerequisites" chapter might further help in getting the intended audience across? I associate "from the bottom up" approach with something being explained by starting from the very basics and aimed towards someone completely unfamiliar with the subject.
- Exuma 7y agoHey, so this is a great work you did. One thing perhaps you can explain... I've stared at this example now for like 30 minutes... https://www.bottomupcs.com/chapter01.xhtml https://www.bottomupcs.com/chapter01.xhtml Section on "Masking" How do you get 0x09 or 0x90? I get how using <memory> & <mask> = <extracted data>... so: 10100101 & 11110000 = 10100000 But I have yet to see how this is 0x90 or 0x09, perhaps I'm misunderstanding. I'm trying to understand the 'shift' piece of it
- 314 7y agoIt’s a typo: he meant 0xa0 or 0x0a and the shift is the four positions to the right to extract the top nybble of the byte.
- Exuma 7y agoAwesome, thank you... I thought I was going insane. So you shift 4 times correct?
- delsarto 7y agoThanks, I believe this should be clearer with https://github.com/ianw/bottomupcs/commit/d8dfd3dc6be5795f4b0dc15147f24049eea28367 https://github.com/ianw/bottomupcs/commit/d8dfd3dc6be5795f4b...
- 314 7y agoGreat resource - very detailed and your style is clear and readable. I'd happily recommend this to anybody who is studying an OS course (and in fact emailed a link to some people who teach similar courses to see if they would use it as background reading).
- Exuma 7y agoIt appears this section might be incomplete: Branch Prediction pipeline flush, predict taken, predict not taken, branch delay slots