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.
I'm reworking my boot loader, and have run into a probably simple problem. I'm working on some code to setup my long mode paging tables in real mode. (I'm using Brendan's shortcut.)
This is supposed to identity page the first mg of RAM for my entrance into long mode. However, it loops continuously. In the Boch's debugger, it goes from the 'mov dword' line to an iret, back to the mov dword, and likewise for infinity.
I'm not sure why Boch's is popping an iret command in there....
Perhaps it's one of the default interrupt handlers that Bochs installs at boot? Some of those are just dummy ISRs with only an IRET opcode, so if something is faulting in that code then you'll be pointed to a dummy ISR.
Maybe look at the bochs log and see what happens (or change the config and turn on debug mode in bochs, it'll print out in the bochs log all sorts of information about the run).
I meant, via the config dialog box when bochs is actually running, turn on full debugging in the log for all devices. Then you can step through and when the first IRET comes up quit bochs and look at the log for any information about exceptions and the like.
I'm reworking my boot loader, and have run into a probably simple problem. I'm working on some code to setup my long mode paging tables in real mode. (I'm using Brendan's shortcut.)
This is supposed to identity page the first mg of RAM for my entrance into long mode. However, it loops continuously. In the Boch's debugger, it goes from the 'mov dword' line to an iret, back to the mov dword, and likewise for infinity.
Perhaps because it is performing an INT.
Alboin wrote:
I'm not sure why Boch's is popping an iret command in there....
;The 32-bit Protected Mode code you wrote...
mov dword [ecx * 8 + TABLE], eax
;How it equates to the CPU in 16-bit Real Mode...
add [bx+si],al
mov [si],ax
int 0
I've come to believe that the segment for the abs. address of 0x9a000 is 0x9000. (eg. 0x9000:0xa000) Am I correct here? (0x9000 * 16 + 0xa000 = 0x9a000)
I think the underlying reason is here that you aren't in Unreal Mode and segments are limited to 64k, while your first snippet did expect 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 ]