Page 1 of 1

Jump to another file with bootloader

Posted: Sat Mar 24, 2012 12:03 pm
by Ziddia
Hello,

I've been working on a hobby OS for a while, and, although I know probably enough C to make it work to an extent once I'm able to run C code, I'm relatively new to Assembly. The tutorials on the wiki seemed geared towards people who know a fair amount of assembly. I was wondering how I could 'jump' to another .bin file on the floppy disk.

I have the following line in my assembly file, which seems to indicate that I need to load the file at address 10000h: jmp 8:10000h

I'm just curious about this - it would probably help to be able to split up my bootloader, at least.

Thankyou for your time.

(P.S.: Is it necessary to create a GDT in real mode with my bootloader, or can I do that in my (protected mode) kernel?)

Re: Jump to another file with bootloader

Posted: Sat Mar 24, 2012 1:11 pm
by Ziddia
Nevermind, I figured it out. However, my question about the GDT (and really, and descriptor table) still stands.

Re: Jump to another file with bootloader

Posted: Sat Mar 24, 2012 1:48 pm
by Synon
Ziddia wrote:Nevermind, I figured it out. However, my question about the GDT (and really, and descriptor table) still stands.
You need to have the GDT already loaded before you enable protected mode; so yes, you'll probably need to put that in your bootloader and then load a new one in your kernel... unless you come up with a way of having the kernel tell the bootloader what it expects to have in the GDT and then have the bootloader create and load that GDT (and then pass the kernel a pointer to it).

Re: Jump to another file with bootloader

Posted: Sat Mar 24, 2012 6:10 pm
by Ziddia
Synon wrote:
Ziddia wrote:Nevermind, I figured it out. However, my question about the GDT (and really, and descriptor table) still stands.
You need to have the GDT already loaded before you enable protected mode; so yes, you'll probably need to put that in your bootloader and then load a new one in your kernel... unless you come up with a way of having the kernel tell the bootloader what it expects to have in the GDT and then have the bootloader create and load that GDT (and then pass the kernel a pointer to it).
Okay, thanks.