1 Operating Systems Ch An Overview
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer System l Loading instructions into MM l User interface l Storing, retrieving, manipulating files l Controlling peripheral devices Does not provide for:
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Solution Provide a set of programs that is an integral part of the computer system to: l Control the hardware l Load and start application programs l Provide file services l Provide a user interface
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, The Operating System is a collection of Programs that work together to act as a system manager, controlling both Hardware and Software and acting as a User Interface.
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Evolution of the Role of OS l Earlier systems required the user to know more about the hardware, file systems, and I/O devices to get work done, OS smaller l Trend is for the operating system to get bigger and provide more services so that the user has an easier time getting useful work done l The user is less likely to get bogged down with technical issues
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Services l Objectives –Convenience –Efficiency l Services –Manage, load and execute programs –Accept and execute commands from user and application programs –Provide interface for user and user’s programs –Manage hardware resources I/O support File support Interrupt handling Network services - such as, distributed processing Concurrent Processing Bootstrapping
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bootstrapping 1. Execution begins with bootstrap loader stored in ROM 2. Looks for OS program in a fixed location 3. Loads OS into RAM 4. Transfers control to starting location of OS 5. Loader program in OS used to load and execute user programs
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS Services
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS Parts l Resident Part –some OS services are critical to system operation and must be resident in memory at all times (user command handler, interrupt handler) –loaded into memory via bootstrapping –known as OS kernel l Non-Resident Part –loaded as needed, for example, disk formatting
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Degree of Activity (between user and system) l Online, interactive (conversational system) –user is connected directly to and interacting with system during execution of program (such as input) l Batch processing –program is executed in background mode applied to data contained in a file l Event driven
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Event Driven OS l An OS is usually idle until an event (interrupt or service request) occurs –File request –I/O request –Keyboard or mouse input –program memory request –clock interrupt signaling program scheduler for time slice –etc
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Operating System - Types l Single User, Single Tasking MSDOS l Single User, Multitasking Windows 95 or 98 l Multi-user, Multitasking Unix
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Single Job Processing l Simple l Memory resident components –Command interface shell containing commands that must remain resident –I/O routines that control each of the I/O devices –File management system for locating and maintaining files
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Single Job Processing 1. Program is loaded into memory. 2. Execution begins. Program runs w/o OS interference. 3. OS regains control: a. If the user’s program requests I/O b. The user wishes to stop the program execution via a keyboard interrupt c. System malfunction 4. When program is finished, control is transferred back to the command interpreter. Note - computer does not halt. OS just waits for command.
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Single Job Processing l System provides minimum memory management and no scheduling l Wasteful of system resources - CPU is idle most of the time l Nearly obsolete
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Concurrent Operations l Multitasking - multiple programs running on a single CPU l May be applied to a single user system or to multiple users sharing a single system
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, l Allocates memory, CPU time, I/O devices to multiple programs l Protects users and programs from each other and provides for inter-program communication l Provides feedback to the system administrators for tailoring and tuning the system for optimum performance Concurrent Processing
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS Services Concurrent Operations l User services to each user l Allocation of resources to each user and task –Memory –I/O –CPU time l OS periodically evaluates status of resources and reassigns them in order to meet needs of each task and user
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Achieving Multitasking 1. While one program is waiting for I/O to take place, another program is using the CPU to execute instructions
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Sharing CPU during I/O Breaks
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Achieving Multitasking 2. The CPU may be switched rapidly back and forth between different programs
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Time-Slicing
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Achieving Multitasking 3. Concurrency algorithms usually combine both approaches, taking into account such issues as - fairness to each program - priorities of the programs - quick response for critical needs, such as displaying cursor or keystroke - etc
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Concurrent OS Tasks l Dispatching - selecting program to execute l Keeping track of each program l Memory management for each program l I/O device scheduling to meet needs of each program l Suspending and restarting of all programs with environment remaining intact l Provide security and protection for all programs and users
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Concurrent OS Tasks l Control and measure performance of the system l establish and control communication between programs l Manage network communication l...
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Structure l User interface –CLI - Command Line Interface –GUI - Graphical User Interface (menus, icons, mouse-driven) l I/O control system –device drivers - programs for each device on the system, standard method for using each device –Plug and Play - ideally to add new hardware and have the OS take care of adding it to all relevant programs and change settings to reflect change
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Structure l Process control management –each executing program is a process –each process acquires and releases resources during execution –processes must be synchronized in order to facilitate sharing of resources –OS provides process control management to keep track of each process and its status - executing, waiting for an event, register content, PC value, etc
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS Structure l Memory Management –Each program is provided needed memory for execution –For each program, OS keeps track of memory allocated as well as free space, protects against writing outside allocated space, etc –Maintains programs waiting to be loaded into memory and allocates/deallocates space on loading
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS Structure l File Management –Mapping between a file’s logical name and the physical address - maintains directories for each device –Retrieval and storage of files –Info kept about each file (date, name, size, type, date last modified) –Copy, move, delete, rename, find
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Structure l Scheduling system –High level - jobs are placed in queue in some order and ultimately loaded into memory for execution –Dispatching - selection of process to be executed at a given point in time Mostly preemptive - that is, programs are multitasked based on time slicing Exception is for the OS itself in order to protect certain OS operations from being interrupted
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Structure l Secondary storage management –Many processes may have simultaneous I/O requests from secondary storage –Processing of requests affect progress of processes to completion –Secondary storage management reorganizes requests to optimize completion of I/O tasks (by minimizing track access)
Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, OS - Structure l Security and protection management –processes are limited to assigned memory space –file access is handled by OS l Support for system administration –configuring the system I/O device drivers, stack sizes, number of open files,... –adding/deleting users and passwords –providing backups –recovering lost data –installing/maintaining software –monitoring security and measuring performance