Saturday, 4 May 2013

CS609 Assignment No. 01 Solution

Question 1: Marks 10 

Answer the following questions precisely. Do not include irrelevant data in your answers. Any answer with more than three lines will neglect your marks. (2 marks for each)
Q1. Where are the interrupt vectors located in the microprocessors memory?
Q2. Which interrupt vectors are reserved by Intel?
Q3. Explain the operation of IRET instruction.
Q4. List the events that occur when an interrupt becomes active.
Q5. Explain the purpose of the trap flag (TF).

Question 2: Marks 10 

Write a C program that should write the value of 'k' in the keyboard buffer whenever the letter 'z' is pressed from keyboard.



Q1 (a)
interrupt reside in memory and supported by operating system reside in kernal in case of Dos kernal is io.sys and in case of window kernal is kernal 32.dll

q1(b)
the first 32 vector 0-31 are reserved by intel for processor generated exceptionIn Real Address Mode, iret pops CS, the flags register, and the instruction pointer from the stack and resumes the routine that was interrupted. In Protected Mode, the setting of the nested task flag (NT) determines the action of iret. The IOPL flag register bits are changed when CPL equals 0 and the new flag image is popped from the stack.


iret returns from an interrupt procedure without a task switch if NT equals 0. Returned code must be equally or less privileged than the interrupt routine as indicated CS selector RPL bits popped from the stack. If the returned code is less privileged, iret pops SS and the stack pointer from the stack.
iret reverses the operation of an INT or CALL that caused the task switch if NT equals 1. The task executing iret is updated and saved in its task segment. The code that follows iret is executed if the task is re-entered.





Q1(c)
In Real Address Mode, iret pops CS, the flags register, and the instruction pointer from the stack and resumes the routine that was interrupted. In Protected Mode, the setting of the nested task flag (NT) determines the action of iret. The IOPL flag register bits are changed when CPL equals 0 and the new flag image is popped from the stack.
iret returns from an interrupt procedure without a task switch if NT equals 0. Returned code must be equally or less privileged than the interrupt routine as indicated CS selector RPL bits popped from the stack. If the returned code is less privileged, iret pops SS and the stack pointer from the stack.
iret reverses the operation of an INT or CALL that caused the task switch if NT equals 1. The task executing iret is updated and saved in its task segment. The code that follows iret is executed if the task is re-entered.

Some Day You'll Cry For Me........Like I Cried For You
Some Day You'll Miss Me............Like I Missed You
Some Day You'll Need Me...........Like I Needed You,

--
Need Your Comments.....!

-- 

For University of Pakistan Study Material Sharing, Discussion, etc, Come and join us at http://4e542a34.linkbucks.com
You received this message because you are subscribed to the Google
Groups "Study" group.
To post to this group, send email to http://ca13054d.tinylinks.co
For more options, visit this group at
http://004bbb67.any.gs

No comments:

Post a Comment

Note: only a member of this blog may post a comment.