Download presentation
Presentation is loading. Please wait.
1
Operating System Architecture
Lecture 7
2
Software hierarchy
3
Operating System components
User interface Older systems: shell – text based Newer systems: GUI, e.g. Window system Kernel File manager - groups files into directories collection of device drivers - programs that let the OS communicate with the computer hardware (E.g. Graphic card, Sound card, Computer printer) Memory manager - coordinates the machine’s use of main memory. Scheduler and dispatcher scheduler determines which activities are to be considered for execution, and the dispatcher controls the allocation of time to these activities.
4
Kernel A kernel is the central part of an OS.
It manages the tasks of the computer and the hardware A computer user never interacts directly with the kernel. It runs behind the scenes and cannot be seen, except for the text logs that it prints.
5
Kernel types Two types of kernels:
Microkernel, which only contains basic functionality; (e.g. MINIX) Monolithic kernel, which contains many drivers. (e.g. Windows, MacOS, Linux and etc) Hybrid
6
Issues with kernels Reliability – for expl: micro kernels are more reliable since services run separate address space Performance – for expl: since services run sharing the same address space making communication between them easy monolithic kernels are more performant Portability- can be ported from one machine to another Layered and extensibility(can be extended easily)
7
Kernel: File manager maintains records of all the files stored in mass storage File location which users are allowed to access the various files, which portions of mass storage are available for new files or extensions to existing files. directory or folder directory path - A chain of directories within directories WIUT/Semester2/FIT
8
Kernel: Device drivers
Device drivers communicate with the controllers (or directly with peripheral devices) to carry out operations on the peripheral devices attached to the machine. Each device driver is uniquely designed for its particular type of device (such as a printer, disk drive, or monitor) and translates generic requests into the more technical steps required by the device assigned to that driver.
9
Kernel: Memory manager
In multiuser or multitasking environments many programs and blocks of data must reside in main memory concurrently. Memory manager must find and assign memory space for these needs and ensure that the actions of each program are restricted to the program’s allotted space. Moreover, as the needs of different activities come and go, the memory manager must keep track of those memory areas no longer occupied.
10
Issues with memory management
Single Contiguous Memory Management entire application program is loaded into one large chunk of memory. Partition Memory Management fixed partitions- main memory is divided into a particular number of partitions. dynamic partitions- the partitions are created to fit the need of the programs. Paged Memory Management main memory is divided into small fixed-size blocks of storage called frames. A process is divided into pages
11
Kernel: scheduler and dispatcher
scheduler - determines which activities are to be considered for execution, dispatcher - controls the allocation of time to these activities.
12
Coordinating the Machine’s Activities
Process - The activity of executing a program under the control of the OS Process state - current status of the activity, OS manages these processes so that each process has the resources (peripheral devices, space in main memory, access to files, and access to a CPU) that it needs, that independent processes do not interfere with one another, and that processes that need to exchange information are able to do so.
13
Interrupts Each time the dispatcher awards a time slice to a process, it initiates a timer circuit that will indicate the end of the slice by generating a signal called an interrupt When the CPU receives an interrupt signal, it completes its current machine cycle, saves its position in the current process and begins executing a program, called an interrupt handler, which is stored at a predetermined location in main memory. This interrupt handler is a part of the dispatcher, and it describes how the dispatcher should respond to the interrupt signal.
14
Thus, the effect of the interrupt signal is to preempt the current process and transfer control back to the dispatcher.
15
File Systems File - a named collection of data, used for organizing secondary memory File system - the operating system’s logical view of the files it manages Directory - a named group of files File type - the specific kind of information contained in a file, such as a Java program or a Microsoft Word document File extension - Part of a file name that indicates the file type
16
File Systems You can name a file anything you want (as long as you use the characters that the operating system allows for file names). You could give any file a .gif extension, for instance, but that doesn’t make it a GIF image file. Changing the extension does not change the data in the file or its internal format. If you attempt to open a misnamed file in a program that expects a particular format, you get errors.
17
File operations Create a file. Delete a file. Open a file.
Close a file. Read data from a file. Write data to a file. Reposition the current file pointer in a file. Append data to the end of a file. Truncate a file (delete its contents). Rename a file. Copy a file.
18
File Access Sequential file access - the technique in which data in a file is accessed in a linear fashion Direct file access - the technique in which data in a file is accessed directly, by specifying logical record numbers
19
File Protection In multiuser systems, file protection is of primary importance. That is, we don’t want one user to be able to access another user’s files unless the access is specifically allowed. It is the operating system’s responsibility to ensure valid file access. Different operating systems administer their file protection in different ways.
20
Directories A directory, in most operating systems, is represented as a file. The directory file contains data about the other files in the directory. For any given file, the directory contains the file name, the file type, the address on disk where the file is stored, and the current size of the file. The directory also contains information about the protections set up for the file. It may also contain information about when the file was created and when it was last modified.
21
Directories: path names
Path - a text designation of the location of a file or subdirectory in a file system Absolute path - path that begins at the root and includes all successive subdirectories Relative path - path that begins at the current working directory Linux/Unix Windows /etc/samba.smb.conf /boot/grub/grub.conf C:\Program Files\Microsoft Office\Office12\VISSHE.DLL D:\MyFolder\FIT\Lecture7.pptx Linux/Unix Windows ../samba.smb.conf ../grub.conf ..\Office12\VISSHE.DLL ..\FIT\Lecture7.pptx
22
Windows directory tree
23
Unix directory tree
24
Disk Scheduling Disk scheduling - technique that the operating system uses to determine which requests to satisfy first is called Seek time is the time it takes for the heads to reach the appropriate cylinder. Latency is the additional time it takes the platter to rotate into the proper position so that the information can be read or written. Seek time is the more restrictive of these two, and therefore is the primary issue dealt with by the disk-scheduling algorithms.
25
Disk Scheduling
26
Disk-scheduling algorithms
First-Come, First-Served Disk Scheduling (FCFS) one of the easiest to implement, though not usually the most efficient. we process the requests in the order they arrive, without regard to the current position of the heads. Shortest-Seek-Time-First Disk Scheduling (SSTF) moves the heads the minimum amount it can to satisfy any pending request. Starvation could be the issue - it is possible for some requests never to be serviced because requests closer to the read/write heads keep being issued. SCAN Disk Scheduling the read/write heads move in toward the spindle, then out toward the platter edge, then back toward the spindle, and so forth. Employs the same strategy as an elevator, sweeping from one end of the disk to the other.
27
Bibliography Dale, Computer Science Illuminated, Chapter 10, 11, end of the book exercises J. Brookshear, An Overview of Computer Science 11th ed (intro txt) - (Pearson, 2012) BBS Randy Wang, Operating Systems, System Calls, and Buffered I/O
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.