Jump to another file with bootloader

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.
Post Reply
Ziddia
Member
Member
Posts: 38
Joined: Sat Nov 05, 2011 6:28 pm

Jump to another file with bootloader

Post 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?)
Ziddia
Member
Member
Posts: 38
Joined: Sat Nov 05, 2011 6:28 pm

Re: Jump to another file with bootloader

Post by Ziddia »

Nevermind, I figured it out. However, my question about the GDT (and really, and descriptor table) still stands.
Synon
Member
Member
Posts: 169
Joined: Sun Sep 06, 2009 3:54 am
Location: Brighton, United Kingdom

Re: Jump to another file with bootloader

Post 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).
Ziddia
Member
Member
Posts: 38
Joined: Sat Nov 05, 2011 6:28 pm

Re: Jump to another file with bootloader

Post 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.
Post Reply