Page 2 of 2
Re: How to load karnel from a bootloader?
Posted: Tue Sep 08, 2009 1:48 pm
by ClarionCoder51
It is possible, but I couldn't tell ya. I program my OS exclusively in ASM. I recommend writing the bootloader in ASM for now if you don't get an answer fast enough, since the only thing that you'll be messing with most of the time is the kernel, which I suppose is written in C, correct?
Besides, the only thing you need to change is how many sectors the loader reads.
Re: How to load karnel from a bootloader?
Posted: Tue Sep 08, 2009 2:22 pm
by Combuster
Please, if you suggest something especially promoting bad practice, please tell why. Especially when someone else says otherwise.
Re: How to load karnel from a bootloader?
Posted: Tue Sep 08, 2009 3:10 pm
by ClarionCoder51
And what would be "bad practice" that I am telling electritwist? (hope I spelled that right)
Re: How to load karnel from a bootloader?
Posted: Tue Sep 08, 2009 4:54 pm
by neon
Hello,
Thank you all for the answers, but they didn't help me out, I'm trying to figure it out with a friend.
What is it that you are having trouble with? Just read up on your boot file system and have your bootloader parse it and load the kernel into memory.
off topic: Can anyone give me an easy and short example of how to write boot loader written with C language? Is it even possible?
What I do in my bootloader is prepend an assembly program to my PE program (my bootloader written in C). The assembly program does basic tasks such as going into protected mode, enabling paging, etc and is responsible for relocating the PE program and executing it. It is possible to create an interface that will allow the C program to interact with the BIOS via RMode as well if needed.
This method is a little tricky, but works quite well. Perhaps a method like this can help? There are other methods, so keep your options open
