I did nothing with interrupt (IDT not loaded,8259A not reprogrammed) after my kernel startup,
but bochs restart automatically after 2 or 3 seconds though I use a while(1); loop.
After reboot for 4 or 5 times ,Bochs told me something like "too many timers registed".
Should timer be set or IDT be filled immediately after setup?
If I tured off interrupt using cli , this problem will not ocurr.
What is wrong?
Interrupt problem
Re:Interrupt problem
If interrupts are enabled and there isn't an IDT, the moment an interrupt occurs, the CPU will look it up in the [non-existant] IDT, realise the entry is missing and double fault but then realises it can't look that up either so triple faults (crash reboot).
The "timers registered" thing is more likely a bug with Bochs in relation to the host operating system.
The "timers registered" thing is more likely a bug with Bochs in relation to the host operating system.
Re:Interrupt problem
Bochs give follow outputs:
00001105357i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
repeated handreds of times .......
00001105359i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105361i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105363i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105365i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105367i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367i[CPU0 ] push_32(): push outside stack limits
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367e[CPU0 ] exception(): 3rd (12) exception with no resolution, shutdown status is 00h, resetting
00001105367i[SYS ] bx_pc_system_c::Reset(SOFTWARE) called
00001105357i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
repeated handreds of times .......
00001105359i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105361i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105363i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105365i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105367i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367i[CPU0 ] push_32(): push outside stack limits
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367i[CPU0 ] can_push(): expand-up: esp < N
00001105367e[CPU0 ] exception(): 3rd (12) exception with no resolution, shutdown status is 00h, resetting
00001105367i[SYS ] bx_pc_system_c::Reset(SOFTWARE) called
Re:Interrupt problem
The "LOCK prefix" thing is usually caused by jumping to a NULL pointer, you should verify any code that uses function pointers.
Re:Interrupt problem
That's your tripple fault .00001105367e[CPU0 ] exception(): 3rd (12) exception with no resolution, shutdown status is 00h, resetting