Vague boot error.
Posted: Tue Jan 15, 2008 3:09 pm
hi, I am running into a problem with my bootloader ( i think ). The basic workings of this is that the bootloader loads a binary kernel to 0x100000 and jumps to it. Bochs makes it into 32-bit PMODE but then goes into a continuous reset, as it does on real PC's as well. I will post my bochs debugging and part of the boot code. Any help would be much appreciated, I just can't seem to figure this one out.
BOCHS Output:
start of PMODE in boot.asm:
and the above jumps to init.asm:
I have already put an __asm__ ("hlt"); in the beginning of the C code that this goes to. but it still reboots which means it is not making it that far right?
It is near impossible to search around for similar lock prefix issues as they are so unique.
Thanks. If you NEED to see anything else, just ask and it will be posted.
BOCHS Output:
Code: Select all
00001796618i[BIOS ] Booting from 0000:7c00
00002595114i[CPU0 ] LOCK prefix unallowed (op1=0xff, attr=0x0, mod=0xc0, nnn=7)
00002595114i[CPU0 ] CPU is in protected mode (active)
00002595114i[CPU0 ] CS.d_b = 32 bit
00002595114i[CPU0 ] SS.d_b = 32 bit
00002595114i[CPU0 ] EFER = 0x00000000
00002595114i[CPU0 ] | RAX=0000000000000010 RBX=0000000000002210
00002595114i[CPU0 ] | RCX=0000000000000000 RDX=00000000000003f2
00002595114i[CPU0 ] | RSP=000000000000ffff RBP=0000000000000000
00002595114i[CPU0 ] | RSI=00000000ffff7c5e RDI=0000000000087c5e
00002595114i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00002595114i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00002595114i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00002595114i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00002595114i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00002595114i[CPU0 ] | SEG selector base limit G D
00002595114i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00002595114i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00002595114i[CPU0 ] | MSR_FS_BASE:0000000000000000
00002595114i[CPU0 ] | MSR_GS_BASE:0000000000000000
00002595114i[CPU0 ] | RIP=0000000000100000 (0000000000100000)
00002595114i[CPU0 ] | CR0=0x00000011 CR1=0x0 CR2=0x0000000000000000
00002595114i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00002595114i[CPU0 ] >> lock (invalid) : F0FFFF
00002595114e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
Code: Select all
cli
mov eax,cr0
or al,1
mov cr0,eax
;load gdt
lgdt[GDTR]
jmp CODESEL:FLUSH ; set cs to CODESEL
[bits 32]
FLUSH:
mov eax,DATASEL
mov ds,eax
mov es,eax
mov fs,eax
mov gs,eax
mov ss,eax
mov esp,0xffff
;jump to init.asm
jmp CODESEL:0x100000
hlt
Code: Select all
[bits 32]
[global start]
[extern _main]
start:
cli ; disable interrupts
call _main ; jump to main() in C code
hlt
It is near impossible to search around for similar lock prefix issues as they are so unique.
Thanks. If you NEED to see anything else, just ask and it will be posted.