0% found this document useful (0 votes)
27 views

Lecture 3 Os

The document discusses the operation of computer systems and operating systems. It covers topics like booting, the bootstrap program, interrupts, traps, I/O protection, memory protection, and CPU protection. The bootstrap program initializes the system and loads the operating system kernel. The operating system then waits for events like interrupts or system calls. Interrupts are used to protect different parts of the system from each other through hardware mechanisms.

Uploaded by

Ashna Omed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Lecture 3 Os

The document discusses the operation of computer systems and operating systems. It covers topics like booting, the bootstrap program, interrupts, traps, I/O protection, memory protection, and CPU protection. The bootstrap program initializes the system and loads the operating system kernel. The operating system then waits for events like interrupts or system calls. Interrupts are used to protect different parts of the system from each other through hardware mechanisms.

Uploaded by

Ashna Omed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

[ operating system ] November 3, 2016

Lecture 3
Computer System Structures

Computer System Operation:


A modern, general-purpose computer system consists of CPU and a number of
device controllers that connected through a common bus that provides access to
shared memory system, CPU other devices can execute concurrently competing
for memory cycles.

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.

Bootstrap software: it is an initial program and simple it is stored in read-only


memory (ROM) such as firmware or EEPROM within the computer hardware.

Jobs of Bootstrap program:


1- Initialize all the aspect of the system, from CPU registers to device controllers
to memory contents.
2- Locate and load the operating system kernel into memory then the operating
system starts executing the first process, such as “init” and waits for some event
to occur.

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).

Note: all modern operating system are “interrupt driven”.

Msc. Ozlem A.MAhmmod Page 1


[ operating system ] November 3, 2016

Trap (exception): it is a software-generated interrupt caused either by an error


(ex: division by zero or invalid memory access) or by a specific request from a user
program that an operating system service be performed.

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.

Interrupt Service Routine: is it a routine provided to be responsible for dealing


with the interrupt.

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 .

In multiprogramming system, where one erroneous program might modify the


program or data of another program, or even the resident monitor itself. MS-DOS
and the Macintosh OS both allow this kind of error.

A properly designed operating system must ensure that an incorrect (or


malicious) program cannot cause other program to execute incorrectly.

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.

Msc. Ozlem A.MAhmmod Page 2


[ operating system ] November 3, 2016

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.

I/O Operation Protection:


A use program may disrupt the normal operation of the system by issuing illegal
I/O instruction we can use various mechanisms to ensure that such disruption
cannot take place in the system.

One of them is by defining all I/O instructions to be privileged instructions. Thus


users cannot issue I/O instructions directly they must do it through the operating
system, by execute a system call to request that the operating system performing
I/O in its behalf. The operating system, executing in monitor mode, check that the
request is valid, and (if the request is valid) does the I/O requested. The operating
system then returns to 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.

Base register hold the smallest legal physical memory address.


Limit register: contains the size of the range.

This protection is accomplished by the CPU hardware comparing every address


generated in user mode with the registers. Any attempt by a program executing in
user mode to access monitor memory or other users’ memory results in a trap to
the monitor, which treats the attempts as a fatal error.

Msc. Ozlem A.MAhmmod Page 3


[ operating system ] November 3, 2016

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.

This procedure is known as a context switching, following a context switch, the


next program continues with its execution from the point at which it left off.

Msc. Ozlem A.MAhmmod Page 4

You might also like