Session 3 : Computer System Architecture




Computer System Architecture 

Q?What does Computer System Operation contains
/>During this I/O devices and CPU execute concurrently
/>each device controller is in charge of particular device type and
each has a local buffer. 
/> In CPU the data is moved to/from main memory from/to localbuffers
/> I/O occurs form device to local buffer of controller 
/> then device controller informs CPU that it has finished its 
operation by causing an interrupt

Q?what is this interrupt 
/>Interrupt contains the addresses of all the service routines
and that transfers control to the interrupt service routine. 
/> the OS function by interrupt 


Q?how do we handle interrupt 
/>the interrupt architectures must save the address of the interrupted 
instruction.
/>we can determine the type of interrupt by polling or vectored 
interrupt system
/>different actions are performed in case of each type of interrupt and
this action is declared in seperate segments 
/>incomming interrupt are disabled while another interrupt is being
processed to prevent a lost of interrupt 

Q?I/O structure
/>After I/O starts we receive two kind of mechanism in returing the
control of the system. 
Case 1/>Synchronous method: the control will return to user program 
only if I/O completes 
: (wait instruction idles the CPU until the next interrupt)
Case 2/>Asynchronous method: control will return to user program even 
without I/O completion 

Q?How do we manage I/O interrupt 
/>we use Direct Memory Access(DMA) structure in which only one 
interrupt is generated per block, rather than the one interrupt 
per byte. 
/>device controller transfers blocks of data from buffer storage
directly to main memory without cpu intervention 

Q?Types of Storage Structure 
/1>Main Memory : large storage which CPU can access directly 
/2>Secondary Storage :extension of main memory : non volatile storage capacity 
/3>Magnetic disks : consisting of magnetic recording materials 

Note*:Storage Hierarchy are based on speed, cost, volatility 

Top-Registers- cache- main memory – electronic disk – magnetic disk –
optical disk – magnetic tapes – Down (descending order)

Q?what kinds of operations are performed with the view of Hardware
Protection
/1>Dual-Mode Operation
/2>I/O Protection 
/3>Memory Protection 
/4>CPU Protection 

Q?How Dual-Mode Operation protects hardware 
/> We share the system resources so we have to always be careful that one
operation do not affect the other which might lead to execution
error. 
Thus Two mode of operation are defined: 
/1>User Mode : execution done on behalf of a user 
/2>Kernel Mode : execution done on behalf of a System. 
There is also a Mode Bit which clearly indicate in which mode we are running 
on. Kernel(0) and user (1) while some previledge instructions
can only be issued in kernel mode
 

Q?How I/O protection is done
/> all the i/o instructions are privileged instruction so we must insure that 
user program cannot gain control of kernel mode 
ex: user program cannot store a new address in the interrupt vector 

Q?How Memory Protection is done
/>we add the following register: 
/1>Fence Register (divides size among monitor and user)must hold the
smallest legal physical memory address
/2>Base Register : determines the range of legal addresses a program
may address 
/3>Limit register : contains size of the range 

Q?How Cpu Protection is done
/>To perfom this we use Timer :this interrupts computes after specific
 period of time
/>timer is decremented on every tick 
/>when timer reaches value 0 the interrupt occurs
/>timer is also used for time sharing

Q?how does the user program perform I/O, given that I/O instructions
are privileged i.e. is there any method for a user program to call a
kernel function
/> In this situation we use System call:usually takes the form of a trap
to a specific location in the interrupt vector: 
/> the control passes through the
interrupt vector to a service routine in the OS, and we change the
mode bit to 0(kernelmode)
/> now monitor verifies their parameters and executes the request


Note:*Trap is an interrupt generated in software created by error or a user 
request 
ex:Division by zero, memory access violation 

YouTube
https://www.youtube.com/watch?v=Dwj5buo7rXM&feature=youtu.be

Comments

Popular Posts