Operating system operations:-
Modern operating systems are interrupt-driven. If there is no process execute, No input/output devices to services and no users to whom to respond, An operating system will sit quietly waiting for something to happen. Events are always signaled by the occurrence of an interrupt or a trap.
A trap(an exception) is a software-generated interrupt caused either by an error 10, Invalid memory axis (or) by a specific request from a user program that and operating system is service to be performed. Without protection against some sort of errors, either the computer must execute only one process at a time (or) output must be suspect.
1.Dual-mode and multimode operations:-
To ensure proper executions of the operating system. The system must be able to distinguish between the execution of the operating system code and user-defined code.
The System needs two separate modes of operation. They are:-
- User mode.
- Manual mode.
a bit, called the mode bit is added in the hardware of the computer to indicate the current mode.
Kernal (0) (or) user (1).
When the computer is executing the user application the system is in user mode. When a user application requests from the operating system(via a system call).The system must be a transition from user to kernel mode to fulfill the request. At system boot time the hardware starts in kernel mode. The operating system is then loaded and starts user applications in user mode.
Whenever a trap (or) interrupt occurs the hardware switches from user mode to kernel mode(Changes the state of the mode bit to 0).
We must ensure that the operating system maintains control over the ce3ntral processing unit(CPU). We cannot allow a user program to get stuck in an infinite loop. To accomplish this we can use a timer.A timer can be set to interrupt the computer after a specified period. The period may be fixed or variable.
A variable timer is generally implemented by a fixed rate clock and a counter.
The operating system sets the counter every time the clock clicks the countrols decreasement. When the counter reaches zero an interrupt occurs.
a process needs certain resources including CPU time, memory, files, and io devices to complete its taste. These resources are given to the processor when it is created or allocated to be while it is running. When the process terminates the operating system will reclaim any reusable resources.
A program by itself is not a process/A program is a passing entity like the contents of a file stored on disk. Whereas a process is an active entity.
The executing process must be sequential. The CPU executes one instruction of the process after another Until the process completes. The operating system is responsible for the following activities in collaboration with process management.
- Schedule process and threat on the CPU.
- Creating and deleting user and system process.
- Suspending and reusing process.
- Providing a mechanism for process synchronization.
- Providing a mechanism for process commnication.
Main memory is central to the operation of a medium computer system. Main memory is a large array of bytes remain increase from thousands to billions. Each byte has its own address-main memory is a repository of quickly accessible data shared by the CPU and input-output devices.
The central processors read instructions from the main menu during the instruction fetch cycle and read, Writes data from main memory using during the letter cycle.
Keeping track of which part of memory or currently being used and who is using them. Deciding which process and data to move into an out of memory. Allocating and reallocating memory space as needed.
File system management:-
File management is one of the most visible components of operating systems can store information on several different types of physical media. Magnetic disk, optical disk, and magnetic tape are the most common. Each medium is controlled by a device such as a disk drive (or) tape drive.