Nickolas wrote:I have heard of a way of using a .flp file containing your bootloader which you write to the boot section of a cd-rom, and that way you can boot. I am willing to sacrifice rewritability in order to get compatibility. How can I do this?
cd-roms use the el-torito standard. there's a couple of ways to boot, harddisk emulation, floppy emulation, no emulation. harddisk emulation is buggy, the best way is no emulation which is what isolinux uses. for max compatibility floppy emulation is the thing you want to use. you can use a cd-burning tool and instruct it to use a raw floppy image to boot from. .flp is probably not a raw 1:1 copy. Anyways... using the floppy emulation method it boots just as it would boot from a floppy.
to avoid burning a lot of cd-rs you can create a bootable iso image and load it using virtualbox to test your code.
Secondly, I need a tutorial for writing my bootsector to a floppy disk (I can simply copy the rest of the files and kernel, right?).... (This is just for testing... I still prefer the first way...)
well, one linux i used the dd tool to write directly to the disc. if you have a binary .BIN or .COM file you can just write it to the start of the floppy or use it as a raw floppy image. though some tools might object if you feed it an image that's not floppy-sized. you'll have to search yourself i guess.
Also do you know of any good site or book about fundamental x86 knowledge? After all, I seem to be missing a lot of important stuff....
from here:
http://ftp.lanet.lv/ftp/mirror/x2ftp/ms ... index.html
grab faqsys18, the inter* files, pcgpe, and whatever strikes your fancy. there's a lot of other interesting and useful stuff there.
more in-depth stuff such as intel assembly docs and the el-torito standard can be get from other sources.
Lastly I recomend OS programming to everybody (as a hobby, of course..). The task is daunting but it is great fun.
it is a lot of fun, but it takes a lot of patience too. hours and days spent drinking coffee with your head deep in technical manuals.
P.S. 1 Can I still buy floppy disks? (Will the guy at my local electronics shop think I am crazy, if I ask?)
you don't need floppy disks. a virtual computer is fine with disc images, and when your want to install the loader you can burn it to an usb stick or a cd-rom. IIRC it was sony who was the last manufacturer to stop production of floppy disks. but there are used ones available still. you can ask but don't blame me if people in white coats come to take you away.
So you suggest that I write a bootloader which will function on a hard drive to load my current bootloader (which functions on a floppy but hopefully will work here, too) which will load my kernel?
There's no big difference booting from floppy than booting from a harddisk. The first sector of either disc is read by the BIOS and the code is executed. This is only 512 bytes so you can't do much except for loading more data. On harddisks the MBR loads in the first sector from the partition so you can write your existing loader here and it should work. But as I said it's only 512 bytes so besides writing "hello world" to the screen, you'll need it to load in more sectors from disk to do something useful. Your bootloader can read a whole kernel at this point. If you put the bootloader at the start of the kernel binary, it can make things simpler, but you'll need to pad the data so that the kernel data starts on the second sector.
"If you have specific questions ... don't hesitate to ask as the more generic the question is the more philosophic the answer will be" - PSPWizard