Lecture notes for CSC 252, Thurs. Jan. 18, 2007 ice breaker what is systems? what all do we need to run a program? HW processor memory non-volatile storage I/O devices (keyboard, screen, mouse, network, ...) bus(es) to tie them together memory, backside, USB, PCI, FireWire, etc. SW compiler operating system process abstraction and scheduling, memory mgmt, file system, network protocol stack, ... libraries (math, data abstractions, OS wrappers, ...) GUI tools config mgr, version control, profiler, debugger, ... Computer organization is the study of how all that stuff fits together, with a particular emphasis on the interrelationship between hardware and software. -------- Typically organized as a hierarchy of layers: Applications (compiler, assembler, linker) Run-time libraries, user-level servers GUI, math, malloc/GC, data abstractions, buffered I/O, ... OS kernel (itself typically comprising multiple layers) provides processes, virtual memory, files --> ISA, I/O HW microarchitecture, system-level architecture digital logic circuits and solid-state physics Particular emphasis on the noted layer, where the interface between hardware and software typically occurs. Example ISAs of commercial importance today: x86 (ia32, amd64 = em64t = x86-64; includes 80286/386/486/Pentium/Opteron) Intel, AMD, formerly Cyrix ARM Intel, many others (ISA owned by ARM, Inc.) #1 architecture in the embedded world also used in Palm and other PDAs MIPS MIPS, SGI, NEC once big in the desktop and server world, now mainly embedded Power/PowerPC IBM, FreeScale (Motorola spin-off), formerly Apple Power has a few things PowerPC doesn't Apple G5 was essentially a single-core Power 4 new Cell processor (PlayStation 3) has a PowerPC front end Sparc Sun, TI, Fujitsu good size embedded market, too -- lots of vendors ia64 (Itanium) Intel, HP big gamble; trumped by AMD Opteron; not expected to survive Huge number of smaller current players; huge number of older, abandoned ISAs. ======================== How many declared or provisional majors? others? How many freshmen/sophomores/juniors/seniors? How many did/did not take 173? Who knows Assembler (any sort)/C/C++? ======================== Administrivia Web site -- all the administrative stuff I'm covering today is on-line www.cs.rochester.edu/u/scott/252/ Prerequisite: CSC 172 or equivalent. CSC 173 strongly recommended, but not required. Instructors MLS Luke Dalessandro -------- Luke will be here today for introductions -------- My office hours: by appointment (send email), or stop by if I'm in. Luke: TBA. WebCT forum. Resources Computers CSUG machines remote access available; see the web site -------- sign sheet for account/disk space if you are not a _declared_ CS major -------- Lecture notes on-line Book Projects will be mostly in C and x86 assembler. I will cover the latter in class. I won't spend much time on the former. If you don't know C you'll want to get a book and/or read some of the on-line resources; see the web site for suggestions. -------- ASSIGNMENTS for Tuesday: get/reactivate your csug account forward mail if necessary protect your director(ies) buy the book read chapter 1 pre-skim chapter 2 browse the web site visit the WebCT forum learn to use emacs info mode, or some other texinfo browser -------- Grading calculation (approximate) Assignments 10% "pre-assignments" 45% main assignments Exams 20% midterm 25% final Extra credit Course attendance and participation Please arrive on time Assignments seven projects planned trivia assignments NO LATE ASSIGNMENTS Academic honesty share ideas but not artifacts Advice attend all lectures ask questions in class read the book; answer all end-of-section questions start immediately on assignments visit the professor and TA out of class tools will not be adequately covered in lecture read the WebCT forum AT LEAST once a day ======================== Intro to Systems Software, via example: the "hello, world" program. How do we get it to run? Consider system layers application level use editor to create hello.c source file use shell to invoke editor and compiler, and to request that program be run compiler translation and linking (static, dynamic) translation typically implemented in Linux with three passes preprocessor compiler (may have multiple phases inside) assembler All driven by 'gcc' compiler driver. Intermediate steps (at least the ones inside translation) often invisible to programmer. OS receives requests (system calls) from shell moves data from disk to memory, creates and dispatches process(es) to execute compiler passes and hello program assembly-level architecture processor executes instructions from memory; instructions move data, do math, make choices (change program counter) data moves among disk, keyboard, screen, memory, and processor over busses in response to instructions -------- Intro to Computer Hardware Memory comes in hierarchy registers cache (usually multiple levels these days) "main" memory (almost always DRAM these days) I/O spans a huge range of devices keyboards, mice, tablets, joysticks, etc. screens, visors, speakers, etc. frame buffers additional levels of storage (memory) secondary storage (usually disk, may be flash RAM or something else exotic) tertiary storage (removable media: tape, floppies, CDs, DVDs) local-area networks (Ethernet, wireless, token ring, FDDI, etc.) wide-area networks (phone, cable modem, satellite, etc.) More detailed picture of a typical modern workstation components connected via hierarchy of busses faster --> higher intrinsic cost, higher connection cost, smaller physical size substantial variation from machine to machine; typical PC has processor(s) connected through cache(s) to "system" bus, connecting to I/O bridge memory bank(s) and graphics processor connected to I/O bridge over memory bus fast I/O devices and controllers for slower I/O busses connected to I/O bridge over PCI and ATA busses slower devices connected to slower busses (e.g. USB, Firewire) busses bandwidth PCI 2 - 40 Gb/s, depending on generation USB 12 or 480 Mb/s FireWire 400 or 800 Mb/s EIDE/ATA 128Mb/s (internal only) SCSI 320Mb/s Like processor speed and memory size, these are moving targets. Lots more detail later on what the processor looks like inside. To run hello program: keystrokes go to memory via the processor registers hello code goes from disk to memory directly instructions go from memory to the processor output string goes from memory to screen via processor registers -------- Instructional units in course/book: data formats, inc. computer arithmetic assembly level programs processor architecture factors influencing program performance the memory hierarchy, including caches and I/O devices (linking -- probably won't cover this) interrupts, signals, and process control measuring time virtual memory and storage management concurrency and networking Projects bit twiddling "binary bomb" "buffer bomb" comparing performance across systems performance measurement and tuning shell design dynamic memory allocation ********************************** Introduce TA Pictures Account sign-up **********************************