220 likes | 314 Views
COMP1214 Systems & Platforms: Operating Systems Concepts. Dr. Yvonne Howard – ymh@ecs.soton.ac.uk Rikki Prince – rfp@ecs.soton.ac.uk. Lessons from last session s. The main concerns of an OS Providing application developers with an interface to use system resources
E N D
COMP1214Systems & Platforms:Operating Systems Concepts Dr. Yvonne Howard – ymh@ecs.soton.ac.uk Rikki Prince – rfp@ecs.soton.ac.uk
Lessons from last sessions • The main concerns of an OS • Providing application developers with an interface to use system resources • Managing the system resources • How can devices communicate with the OS? • The separation of concerns among • I/O devices, I/O device controllers (hardware), Device drivers & OS
Plan • Identifying OS concepts • Discuss individual concepts • Establish relevance to OS concerns OS concepts Files Processes Memory mgmt System calls Relating concepts
Discussion • Are you familiar with the following OS concepts? What are they? • Files • Processes OS concepts Files Processes Memory mgmt System calls Relating concepts
Files OS concepts Files Processes Memory mgmt System calls Relating concepts
Files • path name • root directory • working directory • special files • pipes OS concepts Files Processes Memory mgmt System calls Relating concepts
Discussion • Have you seen the list of processes running on: • A windows environment? • A UNIX environment? • What types of processes can you see? • Is it one process per application? • What is the life-cycle of a process? OS concepts Files Processes Memory mgmt System calls Relating concepts
Processor modes • Processors can be running in • Kernel mode • User mode • The processor enters kernel mode: • At start-up, interrupt, error.... • The processor enters user mode: • By an instruction (which sets the respective register in the CPU) • Certain instructions can only be executed in kernel mode (privileged instructions) • Accessing CPU registers • Memory used by the kernel • I/O OS concepts Files Processes Memory mgmt System calls Relating concepts
Kernel mode-User mode in Win NT OS concepts Files Processes Memory mgmt System calls Relating concepts SOURCE: support.novell.com
Processes • Multiprogramming • More tasks than processors • Processors switching between tasks • Illusion of parallelism • Scheduling • Which task is next? • One application requires one or more such tasks (processes) OS concepts Files Processes Memory mgmt System calls Relating concepts
Processes • Each task/process can access system resources • Illusion of exclusive use of • Memory (Address space) • Storage • … • Can be notified of events by the OS or other processes (signals) OS concepts Files Processes Memory mgmt System calls Relating concepts
Discussion • What is the use of each type of memory in the hierarchy below? • How is memory shared among processes? • What if a program needs more memory than available in RAM? OS concepts Files Processes Memory mgmt System calls Relating concepts
Memory layout & Processes Memory available per process? ADDRESS SPACE Memory needed larger than RAM? VIRTUAL MEMORY OS concepts Files Processes Memory mgmt System calls Relating concepts Process Table Process Address Space …
Discussion • Which concerns of an OS does each of the following concepts relate to? • Process • Files • Memory management • How can the OS provide a clean interface to the resources it manages? OS concepts Files Processes Memory mgmt System calls Relating concepts
Accessing system resources • An OS provides applications with APIs/libraries to access system resources • System calls can be invoked by applications in user mode • And are executed in kernel mode • It is important that these are stable or else applications have to be re-written each time they change OS concepts Files Processes Memory mgmt System calls Relating concepts
System calls OS concepts Files Processes Memory mgmt System calls Relating concepts
OS concept map Main Memory IODevices OS concepts Files Processes Memory mgmt System calls Relating concepts AddressSpace Virtual Memory p1 AddressSpace p2 CPU p3 AddressSpace pN OtherFile System Other System File System AddressSpace
Other online resources • CPU components and animation • http://courses.cs.vt.edu/~csonline/MachineArchitecture/Lessons/CPU/Lesson.html • Computer architeture resources (advanced) • http://williamstallings.com/COA5e.html
Lessons learned • We are aware of the importance of OS • We have introduced basic OS concepts • We are familiar with the following concepts • Processes • Address space • Files • Processor modes: Kernel mode/User mode • System calls • The UNIX Shell • Textbook: sections 1.5-1.6 OS concepts Files Processes Memory mgmt System calls Relating concepts
next OS lectures: • How can we deal with system resources competing for CPU and Memory? • Process scheduling • Memory management • File system • Virtual memory • How can processors/computers be combined? • How can a file system be reliable and secure? • WHAT ABOUT SPECIFIC OPERATING SYSTEMS?