Below is the code for openO system call in the user program. open: push dword mo
ID: 3716982 • Letter: B
Question
Below is the code for openO system call in the user program. open: push dword mode push dword flags push dword path mov push eax int eax, 5 80h 1. What is the purpose of the first threeinstructions (push)? 2. What is the significance of number 5? 3. What is the use of 80h? 4. Where will register eax be used? 5. How will register eax be used? 6. How does instruction int affect the mode? 7. What is the problem caused by the instruction int for VMM? 8. Why is the TLB entries not useful when the OS memory is virtualized?Explanation / Answer
1. Purpose of the first three instructions :
dword is the type specifier ( with 4 bytes addressed)
To open some file - push the mode first ,the flags and then the address at which path is stored.
2. Significance of number 5
It represents the system call number i.e. in this case calling system call 5 which represents the kernel function OPEN.
3. Use of 80h
int 80h is the assembly language opcode for interrupt 80h . It allows application program to obtain system services from the unix kernel ( i.e. to call kernel)
4. Where willl register eax be used
eax is a 32 bit data register which is used as an accumulator .mainly used in input output and most arithmetic instructions.
5 How eax will be used
for arithmetic calculations .eg in multiplication ,one operand is stored in eax or ax or al according to the size of operand
For rest of the parts ,i am not sure about the answers.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.