Problems with Interrupts
Posted: Thu Mar 19, 2020 4:44 am
Good morning my dear friends.
I am trying to compile and run one of the many excellent toturials I have found out there about developing operating systems. However, I always face the same problem.
(the code can be found at <https://github.com/zecarlos1957/LearnOS>)
When an interruption occurs, the processor resets and the process restarts.
To confirm my prediction, I will unmask timer interrupt 0 in the idt.cpp file with the instruction
io :: outb (PIC_MASTER_DATA, 0x1). So it only restarts when I press a key.
This appears to be because the call to the interruption entry point does not jump to the correct address, but I cannot find the reason for this. Can you help me to solve this difficulty?
Thank you for your attention.
Along with the result of BochsDBG that executes all the code and when it is in the infinite loop after leaving kmain, there is an interruption that resets the processor.
========================================================================
Bochs x86 Emulator 2.6.9
Built from SVN snapshot on April 9, 2017
Compiled on Apr 9 2017 at 09:49:25
========================================================================
00000000000i[ ] reading configuration from bochsrc.txt
00000000000e[ ] bochsrc.txt:736: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
00000000000i[ ] installing win32 module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
<bochs:1> lb 0x100027
<bochs:2> c
(0) Breakpoint 1, 0x0000000000100027 in ?? ()
Next at t=63796793
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:3> s
Next at t=63796794
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:4> c
(0) Breakpoint 1, 0x0000000000100027 in ?? ()
Next at t=63796795
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:5> del 1
<bochs:6> c
(0).[65915658] [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
Next at t=65915659
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
<bochs:7>
I am trying to compile and run one of the many excellent toturials I have found out there about developing operating systems. However, I always face the same problem.
(the code can be found at <https://github.com/zecarlos1957/LearnOS>)
When an interruption occurs, the processor resets and the process restarts.
To confirm my prediction, I will unmask timer interrupt 0 in the idt.cpp file with the instruction
io :: outb (PIC_MASTER_DATA, 0x1). So it only restarts when I press a key.
This appears to be because the call to the interruption entry point does not jump to the correct address, but I cannot find the reason for this. Can you help me to solve this difficulty?
Thank you for your attention.
Along with the result of BochsDBG that executes all the code and when it is in the infinite loop after leaving kmain, there is an interruption that resets the processor.
========================================================================
Bochs x86 Emulator 2.6.9
Built from SVN snapshot on April 9, 2017
Compiled on Apr 9 2017 at 09:49:25
========================================================================
00000000000i[ ] reading configuration from bochsrc.txt
00000000000e[ ] bochsrc.txt:736: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
00000000000i[ ] installing win32 module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
<bochs:1> lb 0x100027
<bochs:2> c
(0) Breakpoint 1, 0x0000000000100027 in ?? ()
Next at t=63796793
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:3> s
Next at t=63796794
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:4> c
(0) Breakpoint 1, 0x0000000000100027 in ?? ()
Next at t=63796795
(0) [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
<bochs:5> del 1
<bochs:6> c
(0).[65915658] [0x000000100027] 0008:0000000000100027 (unk. ctxt): jmp .-2 (0x00100027) ; ebfe
Next at t=65915659
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
<bochs:7>