After many hours of work and many drops of sudor... i stick.
I have a bootloader loads kernel from raw-data floppy, unblock A20, setts primitives stack and GDT and jump to C coded kernel.
There I set new GDT and IDT tables, reroute hardware ISR (in source generated by nasm macor) for IRQs, set IRQ1 and enable it (and disabling IRQ0 and IRQs 2-15).
After that I 'sti' and for( ; ; ) ;
To this point all seems to be OK.
But when I press any key, the kernel is rebooting, with bochs log listed below.
I try all things i could invent or find over the Inet.
I googled all Internet, i think (-;
What am I doing wrong??
If someone could look up my code it's all in attachment. It is prepared to compile on FreeBSD by typing 'sh make.sh'.
I just can’t look anymore at Vi with asm/c mash (-;
Help! (-:
The Bochs reboot log:
Code: Select all
00091058500i[CPU0 ] CPU is in protected mode (active)
00091058500i[CPU0 ] CS.d_b = 32 bit
00091058500i[CPU0 ] SS.d_b = 32 bit
00091058500i[CPU0 ] EFER = 0x00000000
00091058500i[CPU0 ] | RAX=0000000000000000 RBX=0000000000000010
00091058500i[CPU0 ] | RCX=0000000000000008 RDX=0000000000000007
00091058500i[CPU0 ] | RSP=0000000000007fd0 RBP=0000000000000000
00091058500i[CPU0 ] | RSI=00000000ffff88ca RDI=0000000000080001
00091058500i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00091058500i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00091058500i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00091058500i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00091058500i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df IF tf sf zf af pf cf
00091058500i[CPU0 ] | SEG selector base limit G D
00091058500i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00091058500i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00091058500i[CPU0 ] | MSR_FS_BASE:0000000000000000
00091058500i[CPU0 ] | MSR_GS_BASE:0000000000000000
00091058500i[CPU0 ] | RIP=0000000000011130 (0000000000011130)
00091058500i[CPU0 ] | CR0=0x00000011 CR1=0x0 CR2=0x0000000000000000
00091058500i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00091058500i[CPU0 ] >> jmp .+0xfffffffe (0x00011130) : EBFE
00091058500e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00091058500i[SYS ] bx_pc_system_c::Reset(SOFTWARE) called
00091058500i[CPU0 ] cpu software reset