Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Get bochs to dump all registers at the start of your kernel, and post the result here. You will probably need to compile bochs to include the debugger for that.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
<bochs:2> registers
eax: 0x2badb002 732803074
ecx: 0x00000000 0
edx: 0x00000000 0
ebx: 0x00010000 65536
esp: 0x02107218 34632216
ebp: 0x02107318 34632472
esi: 0x00000000 0
edi: 0x00000000 0
eip: 0x00100015
eflags 0x00200006: ID vip vif ac vm rf nt IOPL=0 of df if tf sf zf af PF cf
I inserted a:
loop:
goto loop;
at the start of the kernel_main C function. Was this right?
The eax register contains the multiboot magic number.
But I have no clue what the other registers should contain.
That moment's way too late. Besides, you can set a breakpoint by address instead
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
<bochs:3> info cpu
eax: 0x2badb002 732803074
ecx: 0x00000001 1
edx: 0x00000000 0
ebx: 0x0002c560 181600
esp: 0x00067f30 425776
ebp: 0x00067f40 425792
esi: 0x0002c6b8 181944
edi: 0x00000000 0
eip: 0x001002fd
eflags 0x00000046: id vip vif ac vm rf nt IOPL=0 of df if tf sf ZF af PF cf
status word: 0x0000: b c3 TOS0 c2 c1 c0 es sf pe ue oe ze de ie
control word: 0x0040: inf RC_NEAREST PC_32 pm um om zm dm im
tag word: 0x5555
operand: 0x0000
fip: 0x00000000
fcs: 0x0000
fdp: 0x00000000
fds: 0x0000
=>FP0 ST0(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP1 ST1(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP2 ST2(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP3 ST3(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP4 ST4(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP5 ST5(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP6 ST6(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
FP7 ST7(0): raw 0x0000:0000000000000000 (0,0000000000) (ZERO)
MM[0]: 00000000_00000000
MM[1]: 00000000_00000000
MM[2]: 00000000_00000000
MM[3]: 00000000_00000000
MM[4]: 00000000_00000000
MM[5]: 00000000_00000000
MM[6]: 00000000_00000000
MM[7]: 00000000_00000000
The CPU doesn't support AVX state !
I'm trying now grub 0.95.
That is CPU halted at the kernel loader entry point.
I think that is what you wanted?
It's good to know that you can at least use a debugger. The next thing you do is determine what mbt should have been, and then test for every step where that value goes and why it doesn't end up in the mbt variable - or on screen.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
What programming environment are you using? You may be best to either build from source or use your package manager and then use Grub's own image utilities.