Operating SystemsChapter ObjectivesWhat is the Operating SystemComputer System StructureComponents of the Computer SystemOperating System StructureOperating System ModulesLayered Operating SystemFunctions of the Operating SystemExamples of Operating SystemsMS-DOSStructure of MS-DOSUnixStructure of UnixMac OS XProcess ManagementProcess Control Block (PCB)Slide 18Context SwitchCPU Switch from Process to ProcessCPU SchedulingScheduling AlgorithmsStorage StructureStorage-Device HierarchyMemory ManagementStorage ManagementFile ProtectionWindows XP Access ControlMass-Storage ManagementI/O Subsystem ManagementMS-DOS and WindowsWindows RegistryEditing the Windows RegistryBasic Unix CommandsOperating SystemsTerms and DefinitionsChapter ObjectivesAfter completing these slides you will:•You will have a better understanding of the role of the operating system.•You will have some familiarity with two of the most popular operating systems – Windows and Unix.What is the Operating System•A program that acts as an intermediary between a user of a computer and the computer hardware.•Operating system goals:–Execute user programs and make solving user problems easier.–Make the computer system convenient to use.•Use the computer hardware in an efficient manner.Computer System Structure•Computer system can be divided into four components–Hardware – provides basic computing resources•CPU, memory, I/O devices–Operating system•Controls and coordinates use of hardware among various applications and users–Application programs – define the ways in which the system resources are used to solve the computing problems of the users•Word processors, compilers, web browsers, database systems, video games–Users•People, machines, other computersComponents of the Computer SystemOperating System Structure•The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface.•With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layersOperating System Modules•Most modern operating systems implement kernel modules–Uses object-oriented approach–Each core component is separate–Each talks to the others over known interfaces–Each is loadable as needed within the kernel•Overall, similar to layers but with more flexibilityLayered Operating SystemFunctions of the Operating System•Process Management•Memory Management•Storage Management•I/O Subsystem•Protection and Security•Resource Allocation•AccountingExamples of Operating Systems•MS-DOS•Windows XP•Unix•Mac OS XMS-DOS •MS-DOS – written to provide the most functionality in the least space–Not divided into modules–Although MS-DOS has some structure, its interfaces and levels of functionality are not well separatedStructure of MS-DOSUnix•UNIX – The UNIX OS consists of two separable parts–Systems programs–The kernel•Consists of everything below the system-call interface and above the physical hardware•Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one levelStructure of UnixMac OS XProcess Management•An operating system executes a variety of programs:–Batch system – jobs–Time-shared systems – user programs or tasks•Process – a program in execution; process execution must progress in sequential fashion•A process includes:–program counter –stack–data sectionProcess Control Block (PCB)Information associated with each process•Process state•Program counter•CPU registers•CPU scheduling information•Memory-management information•Accounting information•I/O status informationProcess Control Block (PCB)Context Switch•When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process•Context-switch time is overhead; the system does no useful work while switching•Time dependent on hardware supportCPU Switch from Process to ProcessCPU Scheduling•Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them according to the following scheduling criteria:–CPU utilization – keep the CPU as busy as possible–Throughput – # of processes that complete their execution per time unit–Turnaround time – amount of time to execute a particular process–Waiting time – amount of time a process has been waiting to be run–Response time – amount of time it takes from when a request was submitted until the first response is producedScheduling Algorithms•Shortest-Job-First (SJF) – schedule the process that will take the shortest amount of time•Priority Scheduling – assign a priority with each process and schedule the one with the highest priority•Round Robin Scheduling – give each process in turn a fixed amount of CPU timeStorage Structure•Main memory – only large storage media that the CPU can access directly.•Secondary storage – extension of main memory that provides large nonvolatile storage capacity.•Magnetic disks – rigid metal or glass platters covered with magnetic recording material•Storage systems organized in hierarchy.–Speed–Cost–VolatilityStorage-Device HierarchyMemory Management•Transfer data to memory during processing•Transfer all instructions to memory in order to execute•Memory management activities–Keeping track of which parts of memory are currently being used and by whom–Deciding which processes (or parts thereof) and data to move into and out of memory–Allocating and de-allocating memory space as neededStorage Management•OS provides uniform, logical view of information storage–Abstracts physical properties to logical storage unit - file–Each medium is controlled by device (i.e., disk drive, tape drive)•Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)•File-System management–Files usually organized into directories–Access control on most systems to determine who can access what–OS activities include•Creating and deleting files and directories•Primitives to manipulate files and dirs•Mapping files onto secondary storage•Backup files onto stable (non-volatile) storage mediaFile Protection•File owner/creator should be able to control:–what can be
View Full Document