Re: What's problem with this code?
Posted: Mon Sep 22, 2008 5:41 am
I haven't used GRUB, but what I gather from the Multiboot specification is that GRUB initializes a protected-mode environment, loads your code (be it a kernel or another bootloader) at an address that you specify (which however needs to be above the 1M mark), and executes it. You are required to load a new GDTR and IDTR, and provide a Multiboot header somewhere in the first 4096 bytes of the image to be loaded, if you don't use the ELF file format.InsightSoft wrote:This descriptor definition are made at C 32 code, right?
What I'm trying to do (maybe in a wrong way) is create the correct environment to execute the C code...
the tutorial: it seems to me that grubs bring the machine to the PM with simplest (or necessary) 32 bit descriptor to fit next 'to be loaded' 32 bit code (at 0x0010000)... (and the asm+c are compiled to start at that address [definition at link.ld script file])
This code, after jumped will set a new descriptors... (the real kernel specification)
I'm completely wrong?