I would also recommend reading Computer Systems: A Programmer's Perspective, 3rd Edition.
The book was written for a CS course (15-213) at Carnegie Mellon University, course materials here (supplement, but no replacement for the book): https://www.cs.cmu.edu/~213/