Tech Support > Computers & Technology > Programming > How to boot your own kernel?
How to boot your own kernel?
Posted by Q on February 5th, 2004


Hi!

I'm new at this developing your own OS thing.

I managed to create my own kernel.exe, kernel.bin, setup.bin and
bootsect.bin.

Now my problem is how to make this boot in my computer?

If I copy all this to a Floppy and restart the computer with the disk in,
shouldn't it just boot?

What am I missing?

I'm developing this in Windows XP.

Please help!




Posted by xbunny on February 5th, 2004


Q wrote:
You might be get better responses in alt.os.development

You dont say what your kernel, boot loader and setup actually do.
Especially significant is how complicated they are!

My very limited understanding is that if for example your bootsect.bin
is your boot loader then that needs to go in the boot sector of your
floppy (which is just a a few sectors after some other required data
structures). I think that would be then need to actually load the kernel
image from whereever and however its stored on the floppy and then jump
to that which can then take over. You might get better luck using a
ready made boot loader like say grub or lilo. These are already able to
boot and have some mechanism to load up the kernel code and jump to it.


Posted by Q on February 5th, 2004


Ok..

The thing is that I'm really new at this and I'm trying to understand how
everything works.

If bootsec.bin is my boot loader..how do I put it in the boot sector of the
Floppy? Is there any software that can do this for me?

I'm developing under Windows XP.

thanks!


"xbunny" <xbunny@eidosnet.co.uk> wrote in message
news:4hoUb.8433$%i5.742@news-binary.blueyonder.co.uk...


Posted by TLOlczyk on February 5th, 2004


On Thu, 5 Feb 2004 12:00:45 +0100, "Q" <news@hotmail.com> wrote:


Basically you create an image file of a floppy, then you wite the
bootsector code in that image at the appropriate location.
Then you add everything else to empty parts of the image.
Then copy the whole thing to floppy.

Another thing to look for, are toolkits for making bootable
CD's and bootable floppies as recover disks. Since these are
toolkits, you need to be able to create a bootable disk.
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,

**
Thaddeus L. Olczyk, PhD

There is a difference between
*thinking* you know something,
and *knowing* you know something.

Posted by xbunny on February 5th, 2004


Q wrote:
Writing Your Own Toy OS (Part I)

http://www.linuxgazette.com/issue77/krishnakumar.html

might help. Its for linux but I think the tools mentions will all run
under cygwin ( http://www.cygwin.com/ ) or be available as native
windows ports.

You know I think you might be trying to get a bit ahead of yourself
here. What exactly are you trying to learn?

More generally dd is one tool you could use to put bootsec.bin in the
boot sector on your floppy. Probably you would do something like

dd if=bootsec.bin skip=Xn of=/dev/fd0

where Xn is the number of bytes you have to reserve at the very
beginning of the floppy for the bios parameters. I think the boot sector
is the second sector on the disk but I didnt really look around too
much. You will need to.

If you cant dd directly to your floppy (ie of /dev/fd0 doesnt work). You
could dd to a file (ie of=floppy.img) and then use rawrite to write the
floppy.img to the floppy.



Similar Posts