CS208 Introduction to Computer Systems Wednesday, 3 January 2024 + Hi! - Welcome back - Jeff Ondich; call me Jeff; Olin 301A; jondich - Prefect: Kaitlyn Peterson + Today: jumping into C programming - A few logistics - Using Visual Studio Code & mantis.mathcs.carleton.edu - character_counter.c + Very rough key questions for the course - How do various types of data and instructions get stored? - How do high-level language constructs (loops, functions, etc.) get translated into low-level language constructs that the hardware can execute directly? - What's going on when I run a program? + 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, #random) - VS Code, mantis, remote editing, integrated Unix terminal - Online textbook: Dive into Systems - First 3 weeks: five C programming assignments of increasing complexity - End of week 4: in-class exam on C and data representation + hello.c - go to the samples page in a browser - connect to mantis - create hello.c and copy the code over - g++ -g -Wall -Werror -o hello hello.c - ./hello + args.c - what's going on here? + character_counter.c [Didn't get here in class today] - how do you open a file? close a file? - how do you read one char from a file? - how can you tell if you have come to the end of the file? - how can you tell if you have come to the end of a line? - what other errors can happen, and what should you do about them? + Coming up next - Lots more C and Unix - Integer notations: binary (0b), octal (0), decimal, hexadecimal (0x) - Data representation: integers, characters, real numbers, strings