Lecture 3 Os
Lecture 3 Os
Lecture 3
Computer System Structures
Booting:
It is the operation of bringing operating system kernel from the secondary storage
and put it in main storage to execute it in CPU. There is a program bootstrap
which is performing this operation when computer is powered up or rebooted.
The operating system then waits for some event to occur Types of events are
either software events (system call) or hardware events (signals from the
hardware devices to the CPU through the system bus and known as an interrupt).
Interrupt vector (IV): it is a fixed locations (an array) in the low memory area (first
100 locations of RAM) of operating system when the interrupt occur the CPU
stops what it’s doing and transfer execution to a fixed location (IV) contain
starting address of the interrupt service routine(ISR), on completion the CPU
resumes the interrupted computation.
Hardware protection:
when we have single user any error occur to the system then we could determine
that this error must be caused by the user program ,but when we begin to dealing
with spooling ,multiprogramming, and sharing disk to hold many users data this
sharing both improved utilization and increase problems .
Many programming error are detected by the hardware these error are normally
handled by the operating system.
Dual-Mode Operation:
To ensure proper operation, we must protect the operating system and all other
programs and their data from any malfunctioning program.
The approach taken by many operating systems provides hardware support that
allows us to differentiate among various modes of execution.
A bit, called the mode bit is added to the hardware of the computer to indicates
the current mode: monitor (0) or user (1) with mode bit we could distinguish
between a task that is executed on behalf of the operating system , and one that
is executed on behalf of the user.
Memory Protection:
To insure correct operation, we must protect the interrupt vector and interrupt
service routine from modification by a user program. This protection must be
provided by the hardware, we need the ability to determine the range of legal
addresses that the program may access, and to protect the memory outside that
space. We could provide the protection by using two registers a base register and
limit register.
CPU Protection:
In addition to protecting I/O and memory we must insure that the operating
system maintains control. We must prevent the user from getting stuck in an
infinite loop or not calling system services, and never returning control to the
operating system. To accomplish this goal, we can use a timer.
Timer can be set to interrupt the computer after a specified period. The period
may be fixed (for example, 1/60 second) or variable (for example, from 1
millisecond to 1 second) A variable timer is generally implemented by a fixed rate
clock and a counter.
We can use the timer to prevent a user program from running too long Simple
technique is to initialize a counter with the mount of time that a program is
allowed to run.
Amore common use of timer is to implement time sharing. In the most case, the
timer could be set to interrupt every N millisecond, where N is the time slice that
each user is allowed to execute before the next user get control of the CPU. The
operating system is invoked to perform housekeeping tasks.