add a function to read the instruction pointer
This commit is contained in:
parent
136afedbda
commit
cf078ec359
2 changed files with 20 additions and 1 deletions
|
@ -119,6 +119,8 @@ static inline void tlb_flush(void)
|
|||
write_cr3(val);
|
||||
}
|
||||
|
||||
void read_eip(void);
|
||||
|
||||
/*
|
||||
* invalidate (not flush!) lines in L1 that map to MPB lines
|
||||
*/
|
||||
|
|
|
@ -106,6 +106,12 @@ idt_load:
|
|||
lidt [idtp]
|
||||
ret
|
||||
|
||||
global read_eip
|
||||
read_eip:
|
||||
pop eax ; Get the return address
|
||||
jmp eax ; Return. Can't use RET because return
|
||||
; address popped off the stack.
|
||||
|
||||
; In just a few pages in this tutorial, we will add our Interrupt
|
||||
; Service Routines (ISRs) right here!
|
||||
global isr0
|
||||
|
@ -141,6 +147,7 @@ global isr29
|
|||
global isr30
|
||||
global isr31
|
||||
global isrsyscall
|
||||
global jump_to_child
|
||||
|
||||
; 0: Divide By Zero Exception
|
||||
isr0:
|
||||
|
@ -446,6 +453,17 @@ isrsyscall:
|
|||
pop ebp
|
||||
iret
|
||||
|
||||
jump_to_child:
|
||||
add esp, 4
|
||||
mov eax, 0 ; child got always zero as return value
|
||||
pop ebx
|
||||
pop ecx
|
||||
pop edx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
iret
|
||||
|
||||
global irq0
|
||||
global irq1
|
||||
global irq2
|
||||
|
@ -791,7 +809,6 @@ apic_svr:
|
|||
push byte 127
|
||||
jmp irq_common_stub
|
||||
|
||||
|
||||
irq_common_stub:
|
||||
pusha
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue