Figure 2 shows the structure of a process controller, which is implemented as a linked-list of process blocks.
In order to achieve high efficiency, process controller is usually implemented as a global variable that can be accessed by both the kernel modules and nonkernel modules. For example, any time a new process (task) is created, the module that created this process should be able to access the process controller to add this new process. Therefore, process controller – the data object that controls the current active process – is usually implemented as a category-5 global variable. This means, both the kernel modules and nonkernel modules can access process controller to change its fields and these changes can affect the uses of process controller in kernel modules.
- Keep track of which parts of memory are currently being used and by whom.
- Decide which processes to load when memory space becomes available.
- Allocate and deallocate memory space as needed.
Another strategy for managing memory is the virtual memory, which allows programs to run even when they are only partially in main memory. The basic idea behind this strategy is that the combine size of the program, data, and stack may exceed the amount of physical memory available for it. The operating system keeps those parts of the program currently in use in main memory, and the rest on the disk.
Virtual memory can also work in a multiprogramming system, with bits and pieces pf many programs in memory at once. While a program is waiting for a part of itself to be brought in, it is waiting for I/O and cannot run, so the CPU can be given to another process, the same way as for any other multiprogramming system. Most virtual memory systems use a technique called paging.
File Management
Also referred to as simply a file system or filesystem. The system that an operating system or program uses to organize and keep track of files. For example, a hierarchical file system is one that uses directories to organize files into a tree structure.
- File creation and deletion.
- Directory creation and deletion.
- Support of primitives for manipulating files and directories.
- Mapping files onto secondary storage.
- File backup on stable (nonvolatile) storage media.
I/O System Management
The I/O system consists of:
- A buffer-caching system
- A general device-driver interface
- Drivers for specific hardware devices
Secondary Storage Management
Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory.
Most modern computer systems use disks as the principle on-line storage medium, for both programs and data.
The operating system is responsible for the following activities in connection with disk management:
- Free space management
- Storage allocation
- Disk scheduling
Protection System
Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources.
The protection mechanism must:
- distinguish between authorized and unauthorized usage.
- specify the controls to be imposed.
- provide a means of enforcement.
Command Interpreter System
Many commands are given to the operating system by control statements which deal with:
- process creation and management
- I/O handling
- secondary-storage management
- main-memory management
- file-system access
- protection
- networking
The program that reads and interprets control statements is called variously:
- command-line interpreter
- shell (in UNIX)
Its function is to get and execute the next command statement.
0 comments:
Post a Comment