Page 1 of 1

Interrupt problem

Posted: Sat Aug 27, 2005 1:23 am
by raywill
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?

Re:Interrupt problem

Posted: Sat Aug 27, 2005 1:28 am
by AR
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.

Re:Interrupt problem

Posted: Sat Aug 27, 2005 2:08 am
by raywill
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

Re:Interrupt problem

Posted: Sat Aug 27, 2005 4:17 am
by AR
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

Posted: Sat Aug 27, 2005 10:26 am
by Cjmovie
00001105367e[CPU0 ] exception(): 3rd (12) exception with no resolution, shutdown status is 00h, resetting
That's your tripple fault :).