CSC369 Final Study Notes.doc

45 Pages
Unlock Document

Computer Science
Angela Demke Brown

CSC369 Final Exam Study NotesBy Dimitri NMain memory is only storage other than registers CPU can access directlyCPU and memory use virtualization to present physical resources as more powerful then they are more cores memory etc then actually existsHardware Support for OSProtection domains user mode and system modemode bitInterruptsTimersMMU Memory Management UnitOther hardwareProtection by adding mode bit to hardware and make some instructions privileged oIf user mode tries to use privileged instrprotection faulttrap to OSInterrupts a hardware signal that causes CPU to jump to predefined instruction called interrupt handler 1 OS fills in Interrupt Table at boot time2 CPU execution loop fetch instruction at PC Decode instr execute instr3 Interrupt occurs signal from hardware4 CPU changes mode disables interrupts5 Interrupted PC value is saved6 IDTRinterrupt number is used to set PC to start interrupt handler7 Execution continues saves additional state as first stepHardware Interrupts Allow device controllers to signal the CPU that some event has occurred eg disk IO complete network package arriveSoftware Interrupts Are used to signal errors eg div by 0 or request for OS services form a user program a system calloThese types of instructions are called traps or exceptionsHardware starts in system mode to run OS code immediately oFirst process created is initoThen switch to user mode and run first processFirst 512 bytes of physically memory for OS161 are reserved for exception vector codeA process contains all of the states of a program in executionVirtual Memory Layout OS161Process State and State ChangesPCB generally includes Process state ready running blocked Program counter address of the next instructionCPU registers must be saved at an interruptCPU scheduling information process priorityMemory management info page tablesaccounting information resource use infoIO status information list of open files OS data about a process is stored in a process control block PCBAs a process changes states its PCB is unlinked form one queue and linked into anotherEvery process has its own PCB Forking creates and initializes a new PCBexit releases all resources but OS cant discard everything immediately oStop running processcontext switch to diff processold process becomes zombie until parent accepts its return valueexitdoesnt cause all data to be freed it doesnt destroy pidinfo structZombie waiting for parent orotherThe processs pidinfo struct is still there until everything waiting for its exit status is gone The last thing waiting for the process it will destroy itChild process gets its parents privilegesexecoStops the current processoLoads program into process address spaceoInitializes hardware context and args for the new programoPlaces the PCB onto the ready queueoNote it does not create a new process return on failureInterprocess communications IPCoPassing arguments to newly execd programsexecoReturning exit status from child to parentwaitpid and exitoSending signalskilloShared file systemoMessage passing shared memory synchronization primitivesSystem handler figures out which system call is needed and calls a routine for that operationEvery process has its own process counter PC so it knows where to start offcontinue when executed or after an interruptContext switchswitch the CPU to another process byoSaving the state of the old processoLoading the saved state for the new process
More Less

Related notes for CSC369H1

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.