Computer Systems: A Programmer's Perspective (3rd Edition)

Category: Computer Science
Author: Randal E. Bryant, David R. O'Hallaron
4.0
This Year Hacker News 2
This Month Reddit 3

Comments

by todd8   2022-01-07
What a nice set of tutorials. I want to thank the author for putting it together.

I rarely write or look at assembly language anymore because of three factors:

* Hardware is so fast that I don't need register level control of my code.

* Compilers are so good that I don't optimize the actual machine instruction use any better than the compilers produce.

* I'm now using Intel/AMD architecture machines almost exclusively. (But I am typing this on a M1 based system right now!) Our PC instruction sets have become more and more complex, full of features that may or may not be present on machines that are the intended target for execution. Programming at the assembly level is less tractable than it was in the past.

However, like vitamins, understanding assembly language is good for you, and many software developers will find assembly language useful as their careers develop. OS kernels, security and vulnerability work, high performance programming, device drivers, and the ubiquitous IOT all use into assembly language at least some of the time. These are generally not areas where new CS majors will be working professionally, but those with the goal of becoming a senior developer should learn assembly language.

I find that after a bit of practice with the instruction set, assembly language programming is fun because with only a (relatively) small set of atomic building blocks, the registers and the instructions, the programmer builds a solution. No scouring StackOverflow, no reading the latest Pragmatic Press book on a new framework, and no searching through packages and standard libraries for the proper use of some zipped iterators.

I have a few tips for autodidacts setting out to learn assembly language. First, take a look at the article. It's a very nice introduction to assembly language. Second, pick some simple projects. Don't sit down to write a chess program in ASM. Third, learn how to use a good debugger like GDB or DDD; being able to single step through your assembly language and seeing what is going on is essential.

My forth tip is the best. Read and do exercises from R. Bryant and D. O'Hallaron's book Computer Systems: A Programmer's Perspective 3rd Edition, see [1].This is on my short list of best books for CS students. Unfortunately, this book is $150 new, but you should be able to buy a good condition used copy from a university bookstore. I would never sell my own copy, it is just great. This book, and the required course for CS and ECS majors at CMU it was written for, is the inspiration for the notorious and wonderful Binary Bomb Lab exercise.

To be clear, R. Bryant and D. O'Hallaron is not a book about assembly language programming. It is a book about computer systems from the programmer's perspective and specifically from a C system programmers perspective. This requires a realistic understanding of assembly language. If there was just one book that I would like my hires to be familiar with it would be this book. The book covers so many important systems programming concepts that it is hard to summarize (unfortunately, I'm not at home with my copy) but some of the the subjects are bit representations, hardware architecture, assemblers, compilers and linkers, buffer overflow vulnerabilities, calling conventions, network programming, concurrency, shells (fork, signals, process control), the impact of hardware memory hierarchy on performance, and virtual memory implementations.

[1] https://www.amazon.com/Computer-Systems-Programmers-Perspect...?

by lanzaio   2021-12-10

Definitely C. It's closer to the computer and lets you see much more of what the computer is actually doing. Learn C then read this book: Computer Systems. This book will teach you the answers to the questions you want to ask but you don't even yet know about to even want to ask them.

by iamsidd2k7   2021-12-10

When you run Python it actually kicks of a VM {CPython}, think of it as a abstraction that will run on your machine. Finding "hotspots" in your code will allow you to make improvements independent of hardware.

On the other hand what I've seen is using SSD does improve reading performance, but there are lot of factors to consider: How big the file is, Are you using any Parser etc. Your best is to really gain a bit more of understanding of how things work under the hood.

If you're interested you might want to read Computer System a Programmer's Perspective, but be warned its pretty heavy.

by Zardov   2021-12-10

I second OSTEP; hands down the best introductory OS book.

Also, to learn systems programming from the ground up, Computer Systems: A Programmer's Perspective is a monumental work.

by conditi0n   2019-11-17

found this for anyone researching the same topic:

http://blog.stuffedcow.net/2014/01/x86-memory-disambiguation/

and https://www.amazon.com/Computer-Systems-Programmers-Perspective-3rd/dp/013409266X

chapter 5

In general, it looks like knowing common compiler optimizations and cpu instructions and architecture well helps with this.

by cjarrett   2019-11-17

I took a course from the authors of this book during my time at university. I highly recommend it and often go back and re-read chapters: http://csapp.cs.cmu.edu/ (crazy amazon link: https://www.amazon.com/Computer-Systems-Programmers-Perspective-3rd/dp/013409266X). Dense, technical, but absolutely fantastic for understanding computers.

For instance, the labs denoted here (http://csapp.cs.cmu.edu/3e/labs.html) are directly related to the very difficult labs I had to do as a student at CMU nearly a decade ago, and likely are variations on projects that students have done there for quite a long time.

Note: Do not buy the 'international edition'. If you can get a used copy from a local university, it's well worth the money.

by Himmelswind   2019-07-21

Some resources I found useful:

  • This Github repository is a really good overview. Although it doesn't exactly give a deep understanding of any particular topic, it's a really good way of understanding the system design "landscape". After reading this, I had a much better idea of what I needed to study more.
  • Designing Data-Intensive Applications is an awesome and thorough book that covers just about everything you need to know for a system design interview.
  • Maybe a bit obvious, but CTCI's system design chapter is useful (although not enough on its own).
  • It's in some ways a bit orthogonal to system design, but Computer Systems: A Programmer's Perspective gave me a much better idea of how the hell this machine I touch all day works. I think learning the things covered in here helped me speak with more confidence on system design.
by Himmelswind   2019-07-21

There's little backend stuff in CTCI besides the parallelism/concurrency chapter, unfortunately. You may have heard of them, but I'm a big fan of Computer Systems: A Programmer's Perspective and Designing Data-Intensive Applications.

by deepaksurti   2019-05-07
One of the best ways would be to build a computer yourself. For that I haven’t found anything better than ECS [1]. Please try to build your own extensions to ECS and don’t forget to burn your computer to FPGA.

Follow that up with Computer Systems A programmers perspective.[2]

My review of ECS [3]

[1] https://www.amazon.com/Elements-Computing-Systems-Building-P...

[2] https://www.amazon.com/Computer-Systems-Programmers-Perspect...

[3] https://www.amazon.com/gp/customer-reviews/RZ4ME4QH22JML/ref...

by throwaway_7718   2019-05-02
CS:APP is hands down THE book that every person interested in the low-level stuff in computer systems should own. But heads up, anyone who is considering to buy the book - please get the North American Edition, NOT the global edition.

I made the mistake of getting the Global edition, because of its considerably less cost, and because I couldn't afford the North American one - it was only after that I checked out the book site, where the authors mention that the global edition is chock full of errors [0].

I don't blame the authors, nor even the people who were responsible for 'the generation of a different set of practice and homework problems'. I can get printing the book in B&W, reducing paper quality, and publishing as a paperback to cut costs, but it's baffling why the publishers compromise on the actual quality of the content itself.

Amazon is full of similar 'PSAs' about not buying the global edition [1].

[0] https://www.amazon.com/Computer-Systems-Programmers-Perspect...

by mathieubordere   2019-01-14
A great resource to dive a bit deeper into the stack is https://www.amazon.com/Computer-Systems-Programmers-Perspect... and the accompanying labs found at http://csapp.cs.cmu.edu/3e/labs.html.

Just make sure you don't buy the `international edition` of the book, it's unreadable due to the amount of errors in the exercises.

by anonymous   2018-02-05
@AndrewHenle seeing how this was written 7 minutes ago, you were probably typing that comment when I was reading the same statement from [this](https://www.amazon.com/Computer-Systems-Programmers-Perspective-3rd/dp/013409266X) book :D.
by techjuice   2017-08-19
The following that I have on my bookshelf have helped:

Compilers Second Edition [0]

Engineering a Compiler, Second Edition [1]

Computer Systems: A Programmer's Perspective (3rd Edition) [2]

[0]https://www.amazon.com/Compilers-Principles-Techniques-Alfre... [1]https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo... [2]https://www.amazon.com/Computer-Systems-Programmers-Perspect...