Advertisement
MichaelPetch

Untitled

May 24th, 2017
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. diff --git a/drivers/cpu/idt.c b/drivers/cpu/idt.c
  2. index 05016e1..39ccefb 100644
  3. --- a/drivers/cpu/idt.c
  4. +++ b/drivers/cpu/idt.c
  5. @@ -19,7 +19,7 @@ static struct idt_entry {
  6. static struct idt_ptr {
  7. uint16_t limit;
  8. uint32_t base;
  9. -};
  10. +} __attribute__((packed));
  11.  
  12. extern void idt_load(struct idt_ptr *);
  13.  
  14. diff --git a/drivers/cpu/idt_load.asm b/drivers/cpu/idt_load.asm
  15. index e1ce160..979036c 100644
  16. --- a/drivers/cpu/idt_load.asm
  17. +++ b/drivers/cpu/idt_load.asm
  18. @@ -1,8 +1,7 @@
  19.  
  20. [GLOBAL idt_load]
  21.  
  22. -idt_load:
  23. - mov eax, [esp]
  24. - lidt [edi]
  25. - mov eax, [esp]
  26. +idt_load:
  27. + mov eax, [esp+4]
  28. + lidt [eax]
  29. ret
  30. diff --git a/drivers/cpu/interrupt.asm b/drivers/cpu/interrupt.asm
  31. index e168aeb..0b712d2 100644
  32. --- a/drivers/cpu/interrupt.asm
  33. +++ b/drivers/cpu/interrupt.asm
  34. @@ -314,13 +314,13 @@ service_interrupt:
  35. mov fs, ax
  36. mov gs, ax
  37.  
  38. - push edi
  39. - push esi
  40. - push ebp
  41. - push edx
  42. - push ecx
  43. - push ebx
  44. - push eax
  45. + pop edi
  46. + pop esi
  47. + pop ebp
  48. + pop edx
  49. + pop ecx
  50. + pop ebx
  51. + pop eax
  52.  
  53. - add esp, 16
  54. + add esp, 8
  55. iret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement