>On 2001-11-13 13:44:28, A. W. Soukup wrote:
>>On 2001-11-13 11:36:08, Chase wrote:
>>>On 2001-11-12 23:58:23, A. W. Soukup wrote:
>>>>On 2001-11-12 23:52:22, A. W. Soukup wrote:
>>>
>>>I have a few questions. I'm not that great at
>>>the hardware side of computers, so bear with me.
>>>Can the bootloader be written in C? I think I
Yes. I wrote my BING bootloader in Turbo C. A
graphical bootloader called XOSL is written in
Borland C. And GRUB is written in GNU C.
>>>heard something about it once, but haven't found
>>>much information about. Second, if the kernel is
>>>placed at the 1Mb mark, then where do you put the
>>>bootloader?
In conventional memory...? Below 1 Mb.
>>>Also, how do you offset the memory on
>>>the disk?
I don't know what that means. If you write
a bootloader, you must write your own
filesystem code, typically these functions:
stat(), opendir(), readdir(), open(),
read(), lseek()
>What exactly is the boot sector? I had the
>impression that the loader and the boot sector were
>the same.
The BIOS loads only sector 0 of the disk (the
boot sector) into memory at boot time. A
program compiled from C is too large to fit
into one disk sector (512 bytes), so you need
a separate assembly-language "first stage"
to load the C-language bootloader.
http://www.execpc.com/~geezer/osd/boot/index.htm