21 January 2002 Operating Systems Read: Nutt, Chapter 2, 3 User Level View of OS ------------ What a programmer perceives: processes - unit of computation files - unit of info storage resources - other, specialized components Resources: managed by the OS - meaning that a user must request access before using it e.g., file files - often the foundational model for other resources open,close,read,write,seek similar interface as for pipes other resources: processor, memory, tape drive, keyboard, display, pipes how they are allocated is up to the OS what if allocated poorly? synchronization/deadlock - chapters 8-10 Processes: components: code/data/resources/status management: fork: create new addres space copy text/data/stack to new addr space child has access to open files what if created in same address space? child could corrupt parent separate spaces allow isolation/protection of processes quit: terminate process join - merge two or more processes Threads: lightweight process share program share resources thread scheduler: sometimes part of user program, someteims part of OS simple to switch among threads, more simple than process switch ex. in Java, gui management done in separate thread which raises events Will come back to the OS perspective of processes/threads in a couple weeks (Chapter 6) ---------------- OS Organization Basic functionality --- device management handling generic devices (disks, tapes, terminals, printers) os manages allocation, isolation, sharing device drivers need to be inside the OS so if you need to add a device, do you need the OS source code no: can add device drivers on the fly to a running OS More in ch 5 process and resource management process is a special resource resources: elements of computing environment needed by a process so that it can execute mechanisms for sharing the processor - scheduling how to share resources (policies) more in ch 6-10 memory management sharing according to a policy - isolation or sharing virtual memory - abstract resource, make system mem look bigger memory can also be distributed among multiple machines w/ network more in ch 11, 12, 17 file management non-volatile storage how to store efficiently for retrieval? take into consideration the way a disk works distributed file systems (e.g., NFS) ch 13 and 16