Page 1 of 1
FAT booting
Posted: Sun Aug 27, 2006 8:24 am
by joke
Hi all,
i'm trying to implement fat12 in my little os. So i created a simple BPB structure and added some simple test routines below the bpb (THE BPB and the test routines are in the same file). The BPB and boot code are in absolute sector 1. dd if=kernel.bin of=/dev/fd0
After that my floppy is not recongnisable. So i reformated my floppy (i use fdformat and mkdosfs) . I've also read this thread
http://www.osdev.org/phpBB2/viewtopic.php?t=2781
So i went to fdisk to see my booting partition and there was no partition. i created one and added the fat12 and bootable flag. fdisk told me that the newly created partition started at sector 18. So i did
dd if=kernel.bin obs=512 seek=17 of=/dev/fd0 . I rebooted and the computer displayed " This is not a bootable disk "etc .
How can i boot my kernel and have fat12??????
Posted: Sun Aug 27, 2006 8:39 am
by matthias
Hi "KilledByDeath"
Why don't you use grub instead. Saves you a lot of trouble, I can give you a floppy image if you like or you could search google
Posted: Sun Aug 27, 2006 8:50 am
by joke
well i could but the point is to program it yourself
Posted: Sun Aug 27, 2006 5:20 pm
by chase
Don't partition your floppy unless you actually want to have mutliple filesystems on it.
Reformat the floppy, verify that the fat12 format progam you are using only makes one reserved sector and try putting your boot sector back on.
You can look at mine if it would help,
http://www.osdev.org/f12boot.asm
Posted: Sun Sep 03, 2006 11:54 am
by hailstorm
Hi Joke!
The best thing you can do is format the floppy and use the dd-command to write your own bootsector to the first sector on the disk.
(For the recognition of the filesystem by other operating systems, make sure the oem string in the bpb states MSWIN4.1. However, for booting the disk, this is not necessary ofcourse.)
You should now be able to copy your kernel onto the disk. If your bootsector works properly, the bootsector should be able to load you kernel and boot it.
Good luck.
Posted: Sun Sep 03, 2006 1:32 pm
by earlz
Don't partition your floppy unless you actually want to have mutliple filesystems on it.
It's possible to partition your floppy!!
Posted: Sun Sep 03, 2006 2:41 pm
by matthias
hckr83 wrote:Don't partition your floppy unless you actually want to have mutliple filesystems on it.
It's possible to partition your floppy!!
If Chase says so, it has to be, right? anyway wtf. But I think it should be possible indeed.
Posted: Sun Sep 03, 2006 7:33 pm
by SpooK
matthias wrote:hckr83 wrote:Don't partition your floppy unless you actually want to have mutliple filesystems on it.
It's possible to partition your floppy!!
If Chase says so, it has to be, right? anyway wtf. But I think it should be possible indeed.
Considering your posts, I think you need to spend more time doing reseach and less time attempting to answer the questions of others, especially when you obviously lack knowledge of the subject at hand. There are no brownie-points for sounding smart.
Posted: Mon Sep 04, 2006 1:43 am
by hailstorm
I think it doesn't matter anyways. Partitioning the floppy drive only makes the problem more difficult. It's also a waste of space I think...
Posted: Mon Sep 04, 2006 6:22 am
by SpooK
hailstorm wrote:I think it doesn't matter anyways. Partitioning the floppy drive only makes the problem more difficult. It's also a waste of space I think...
In these days where the TeraByte is standard, you are correct
Stick with a standard FAT12 format, and you will be fine.
Posted: Mon Sep 04, 2006 12:01 pm
by matthias
SpooK wrote:matthias wrote:hckr83 wrote:
It's possible to partition your floppy!!
If Chase says so, it has to be, right? anyway wtf. But I think it should be possible indeed.
Considering your posts, I think you need to spend more time doing reseach and less time attempting to answer the questions of others, especially when you obviously lack knowledge of the subject at hand. There are no brownie-points for sounding smart.
Uhm, I've seen such a floppy before, I'm not brabling something here. The only thing the BIOS does is load the bootsector if it finds the 0xAA55. So you could have a sort of MBR on your floppy that looks up the parition table instead of some fat table within the first sector and then loads the partition sector, so yes it is possible, the only thing will be that it's probably not supported by any other OS, but possible it is.
Posted: Mon Sep 04, 2006 4:43 pm
by chase
As far as partitioning on a floppy goes the only real issue is that most partitioning software such as MS fdisk won't install a MBR with partition table to a floppy. Reading actually works for most unix-type OSes. I ran across this a couple years back but don't remember what partitioning program I was using.
As most people are pointing out it's a waste of space for such a small media. Floppies are pretty much dead, there only benefit is that you can test OSes without fear of corrupting your hard drive. With the increase in hardware that can boot from usb thumb drives and most virtual machines being free now you'll see floppies being used less and less for OS development.
Just as you can have floppies with partitions you can also have hard drives without them. While I personally think that coding your own boot loader is great for learning I think more developers will start writting raw FAT16 hard drive images to be used by a VM if they want to test boot loaders.