Summary for Midterm:  it’s open book, open notes, can bring posted solutions and your own hw.

Note practice midterm, solutions linked to class web page.

 

Is there a theme connecting all the things we’ve covered so far?  I think so, as follows.  We have concentrated on the transitions, or handoffs, between the three major players, the user code, kernel code, and hardware.  A major concern is user-kernel separation, needed to keep the system well-understood and secure.  This separation is implemented by being very careful about transitions.  The user code is kept “bottled up” in its virtual machine.  System calls communicate a small amount of information (the syscall # and arguments, return value) across the user-kernel boundary and back.

Note that the CPU is running in kernel mode or user mode at each point in time (or each CPU, for multiprocessors).  It will continue to run that way until a particular event takes place: an interrupt, or execution of a system call, or execution of iret (or equivalent), or some exception (including page faults, which we will study later).

 

Hardware-user code relationship

 

Hardware-kernel code relationship

 

 

User-Kernel relationship

 

Hardware/Software terms that sometimes cause confusion on exams

 

instruction:  like mov, push, in, out, etc., belong to “instruction set”, used in assembly language

register:  array of hardware bits, part of CPU, memory, i/o devices, holds a value in its bits

CPU register:  like eax, ecx, esp, etc. for x86.

device register:  like UART’s transmit register, receiver reg, LSR

port or i/o port: 16-bit number providing an address for various device registers, in x86 architecture.  Ex: 0x2f8 for COM2’s transmit register.

memory address: 32-bit number of a byte of memory, in separate space from i/o ports.

interrupt vector: the address of the interrupt handler, held in IDT[nn], and specifying the entry point of the assembler interrupt handler

command: string used to tell a program what to do, ex: “ls” is a shell command

system call: two meanings, system API call such as write(fd, buf, nbytes), certain instruction execution (int, ta)

user stack: one for each thread, holds execution state of user code.

kernel stack: one for each thread, holds execution state of current system call execution, or is empty

interrupt stack: we assume this is built on top of the kernel stack of the thread executing at the time of the int.

 

 

Midterm Reading: midterm is open books, open notes, handouts, open solutions—yours or mine or both.

 

Tan., Ch. 1, but light on history

Ch 2 to pg. 123, plus 132-146 (not explicitly covered in class, but most of the essential concepts have been covered)

Ch 5 to pg. 294. 

Ch. 10 (UNIX) to pg. 704, then sec. 10.7, UNIX Security

Ch. 11 (Windows): 11.2 Win32 API, skip registry, 11.3 to pg. 779, 11.4 to pg. 802 (processes, threads), 11.8 Windows Security

Lecture notes through today.

 

hw1 ideas:

 

hw2 ideas:

 

hw3—not yet!