Page 4 of 4
Re:C os programming
Posted: Wed Aug 17, 2005 9:11 pm
by beyondsociety
The code you posted doesn't search for a file(for example kernel.bin), my bootloader doeas it.
I know. My bootsector just sets the BPB (Bios Parameter Block), and loads the raw sectors into memory. All I care about at the moment is allowing files to be stored on the floppy disk and nothing more. I will eventually add support for a fat12 filesystem driver in my kernel for backward compatibility with legacy devices.
Can i use my bootloader code for the bootloader AND a copy for the loader? (the loader copy will switch to pm, load gdt, enable a20, but first of all, will load a kernel.bin at FFFF:0010).
Yes as long as you change it to load at 1MB. The bootsector is limited to 512 bytes, whereas your second-stage loader is not, so you can put as much code as you want in the second-stage.
Re:C os programming
Posted: Fri Aug 19, 2005 4:27 am
by SpiglerG
I'll try to use grub, as bootloader.
i'll post here if i'll have problems.
Re:C os programming
Posted: Fri Aug 19, 2005 4:32 am
by Solar
SpiglerG wrote:
PS: FFFF:0010 is 1mb? isn't it 1000F
Remember to multiply the segment register with 16 (<< 4) before adding the offset:
0xFFFF << 4 = 0xFFFF0
0xFFFF0 + 0x0010 = 0x100000
Re:C os programming
Posted: Fri Aug 19, 2005 4:54 am
by SpiglerG
yes.
PS: does grub set pmode, too?
i havn't read all the documentation yet.
Re:C os programming
Posted: Fri Aug 19, 2005 4:58 am
by AR
GRUB starts protected mode, provides the memory size, the memory map if it's available, a list of additional "modules" loaded along with the kernel, APM and VBE2 configuration data, the name of the bootloader and the drives detected in the machine.
Re:C os programming
Posted: Fri Aug 19, 2005 5:04 am
by SpiglerG
So, it's the best choice!
Ok. i think i'll use it.
i'll try it as soon as possible.
i found a good tutorial on osdever.net. it's simple and easy to implement.
Re:C os programming
Posted: Sat Aug 20, 2005 3:35 am
by Pype.Clicker
note that we have
http://www.osdev.org/osfaq2/index.php/GRUB,
http://www.osdev.org/osfaq2/index.php/BareBones (our small GRUB-based kernel for demonstration purposes) and plenty of
related pages
sorry if we (administrator) seems to be spamming you with the FAQ, but what you've been asking all along this thread _are_ frequently asked questions and they _are_ for most of them answered in the FAQ.
e.g.
One major advantage of GRUB (or more precisely, a multiboot standard bootloader) is that the kernel will be entered in a known state, which includes the A20Line having been enabled, and ProtectedMode having been entered
creating your own GRUB bootdisk requires a unix-like environment. If you're working under MS Windows (or don't feel like setting up a GRUB disk with linux), check out our Disk Images Under Windows page to get a ready-to-use image.
etc. And even if you don't start with any of our BareBones, consider checking the BareBones pages wich contain troubleshooting info you'll probably need to quickly decode GRUB's error messages, etc.