290 likes | 344 Views
This PowerPoint outline covers the fundamentals of operating systems, including definitions, types, structures, functions, and goals. It also introduces related topics like system calls and OS structure. Access additional materials on the provided website.
E N D
Overview • This and the other PowerPoint files represent an outline only. Each student is responsible for additional details specified in the book or in class
The web site [http://www.os-book.com/] has a collection of practice problems and solutions. At the end of each chapter, you should download the exercises, write the solutions and then check them against the published solutions.
Chapter 1: • What is an OS? • Coordinate access to resources • Make hardware usable • Allocate resources • Schedule activities • Control flow of information among hardware components. • Traffic cop
What actually constitutes an OS is not that simple (see author’s comments on the second paragraph on page 6)
Overview of a computer system: Fig 1.2 • Machine Language instruction format (von Neumann architecture). • Fetch-analyze-execute cycle. • Fetch an instruction and store in the Instruction register • Analyze it • Execute it, if possible • Registers: general, program counter, instruction register.
Types of environments • Batch • Time-sharing • Interactive • Real-Time • Single-processor • Multiprocessor
Multiprocessor • Asymmetric (master-slave model) • Symmetric (processors are peers) – most common • Clustered – like multiprocessor except consists of 2 or more entire systems coupled together. Clustered may mean different things to different people.
Types of OS • Single tasking • Multitasking (sometimes called timesharing) • Multiuser
Interrupts vs. traps (exceptions). • Interrupt: Occurrence of an event that requires that the CPU be interrupted from what it is doing in order to execute an interrupt handling routine (e.g. completion of an I/O or a hardware failure) • Trap: an event typically caused by the CPU such as an attempt to divide by 0, numeric overflow, or illegal memory reference. Requires execution of a trap-handling routine.
Dual modes (user mode; monitor, kernel, or supervisor mode) – defined by an internal CPU bit; privileged instructions. • Process: an entity capable of requesting and using computer resources. E.g. a program in execution.
OS responsibilities • Process management: • Creating/deleting processes. • Process synchronization. • Interprocess Communication. • Suspending/resuming processes. • Deadlock handling:
Memory management: • Allocation/deallocation of memory • What processes go into memory and where • What part of memory is occupied/available. • Static/dynamic allocation
Caching (paging, hardware caching). • Security: protect memory from other processes.
Scheduling • Which processes run? • For how long? • Which have higher priority? • Are they waiting for something?
File management: • Create/delete files • Maintain directories • Storing files on secondary storage • File access • File security • Manage disk space (auxiliary storeage management)
Goals • Consistency • Scalability • Ease of use • Efficiency • Throughput • Responsiveness
Above goals are often contradictory. Ease of use often implies guis which are NOT efficient. Linux is known to be stable and efficient, but not easy to use. • Best throughput may be obtained by ignoring certain activities, which means bad response times for them.
Examples • DOS • Various windows flavors • Various Unix flavors • VMS • MVS • Mac
Distributed systems: collection of processors, each with its own local memory, connected by high-speed lines. • Embedded systems: Most common – embedded in consumer devices (cars, DVDs, robotic arms, cell phones, ipods, etc)
Client-server computing • Peer-to-peer computing. • Can skip this stuff.
Chapter 2: • Shell/command interpreter. Commands are really files (e.g. ls, rm, cat, etc.) • Interface: command line or gui. • Linux flavors have various shells: Bourne shell, C shell, Korn shell. They look alike but there are small differences. • We use the 2nd version of the Bourne shell. It’s called bash (Bourne Again Shell).
System Calls: interface to service made available by the OS • API (Application programmer interface): set of functions available to the programmer. • Examples: fopen, read, write, close, fork, wait, exec, etc. • Linux command handout has those we will use in this class.
Types of calls: fig 2.5 • Can skip most of the stuff on system calls – not needed for this stage of the course
OS structure • Simple structure: eg - DOS allowed programs to access routines that write directly to display and drives. Vulnerable to crashes. Fig 2.10 • Kernel: most critical components; like to keep resident in memory • Layered design: Fig 2.11 and 2.12 • Basic design principle to insulate the needs of a layer from the details of the next lowest layer
Microkernel: • As systems evolved, kernels grew larger. • Removes all nonessential components from the kernel and implements as system or user level programs. • Not always consensus on everything kernel should contain.
Linux and Mac OS use a modular kernel. See example in Fig. 2.13 • Windows XP is a layered system of modules (Figure 22.1)
Virtual machine: • Abstraction of hardware components. • Illusion of having your own machine. • Can be useful for testing OS changes/enhancements. • More secure (each application runs on it's own "machine") • IBM's VM operating system. • Server virtualization.
Java – more than just a language • Language spec - the stuff you learned • API – support for graphics, I/O, database connectivity, networking, server apps, support for telephones, pagers, etc. • Virtual machine spec. Java Virtual Machine (JVM) – Fig 2.17