**Lecture 01: Computer Systems** Anthony J. Clark # First - Survey - Administrivia # About the course - Linux heavy (ask about Windows and I'll try my best) + Student side project + Historical cruft + BSD / Unix / Linux - Hardware (first) and Operating Systems (second) # Drawing **von Neumann machine** - Drawing: Program running on your computer + CPU (registers, ALU, status) + Memory buss * Stack (down from `0x00007fffffffffff`) * heap (up) * bss * data * code (`0x0000000000000000`) - CPU Lies + pipelining + branch prediction + speculative execution + hyperthreads + data flow analysis + instruction level parallelism # Programs and Memory ~~~c long myfunc(long a, long b, long c, long d, long e, long f, long g, long h) { long xx = a * b * c * d * e * f * g * h; long yy = a + b + c + d + e + f + g + h; long zz = utilfunc(xx, yy, xx % yy); return zz + 20; } ~~~ ![Stack Frame](https://eli.thegreenplace.net/images/2011/08/x64_frame_nonleaf.png) - Locals and Globals - Pointers / References + arithmetic - [Compiler Explorer](https://godbolt.org/) # Server Use - Demo server access (might wait until practice day) # Resources - [Where the top of the stack is on x86 - Eli Bendersky's website](https://eli.thegreenplace.net/2011/02/04/where-the-top-of-the-stack-is-on-x86/) - [The Memory Layout of a 64-bit Linux Process](https://simonis.github.io/Memory/)