CS208 Introduction to Computer Systems Monday, 11 September 2023 + Hi! - Welcome back - Jeff Ondich; call me Jeff; Olin 301A; jondich + Today - What's the course about? - Logistics - Using Visual Studio Code & mantis.mathcs.carleton.edu - A few C sample programs + Layers of abstraction - What's going on when I run a python program? ("python3 hello.py") user program (hello.py) application (python3) C code for python3 assembly code compiled from C machine code assembled from assembly operating system services (print, open file, etc.) data path... ...made out of digital logic gates... ...made out of transistors classical electromechanics & quantum mechanics who knows what's down here? - This course 1991-2019: "how can you make a device that computes?" or "how do you organize a large pile of very simple electronic components into a computing device?" (a "computer architecture" course) - This course 2019-present: what underlying computer system structures enable us to use a mid-level programming language (C), with typed local and global variables, dynamic memory allocation, function calls, etc.? (a "systems" course, higher on the diagram, closer to your day-to-day experience as a programmer) - Benefits of the new version of the course - Closer to the concerns of day-to-day programming life - Insight into computer security - Insight into performance issues - Like the old version, this stuff is super-cool - General goal: tell the story of what happens when you compile and run a C program - Persistent theme: how is computer memory structured and used? - Other general goal: strong foundation for studying operating systems and networks + Rough plan - The C programming language, including pointers - Data representation how are integers, real numbers, and characters stored in memory and on disk? - x86_64 assembly language - what is the assembly layer mental model? what operations are available? - how do C structures get implemented in assembly language? - debugging assembly code with gdb (the "GNU debugger") - reverse engineering compiled code - buffer overflow attacks - the process and threads models; how the OS supports multi-programming (and why it turns out to be painful) - TCP/IP networking with the sockets model + Logistics - Course website - Upper-right menu on course website - Info (general information about the course) - Resources - SAMPLES <---------- !!!! - Office Hours - Jeff (my Carleton home page) - Moodle: homework submission and quizzes - Slack (#announcements, #questions, etc.) - VS Code, mantis, remote editing, integrated Unix terminal - First assignment: a couple small C programs - Second, bigger assignment: implementing queues + Compiling a C program - CS251 vs. CS208 - hello.c go to the samples page in a browser connect to mantis create hello.c and cop g++ -g -Wall -Werror -o hello hello.c + A couple more samples - character_counter.c (template for the first assignment, part 1) loops, conditionals, functions, comparison to Java types: char, int, float, double file I/O - strings.c - arrays2d.c (template for the first assignment, part 2) + Coming up next - More C, focus on pointers - Queue implementation assignment (lotsa pointers!) - Integer notations: binary (0b), octal (0), decimal, hexadecimal (0x) - Data representation: integers, characters, real numbers, strings