Page 1 of 2

DOS format or unformatted sectors?

Posted: Wed Jan 16, 2008 3:14 am
by 01000101
After completing my bootloader, I found that it was WAY easier to just dump the compiled binaries (boot + kernel) to the sectors of a floppy without formatting it. I used rawwrite to literally dump my bootsector in the first sector, and then continue dumping my kernel at sector 2->n.

is there a real difference by using the FAT12 formatting and then conforming your code to read that?

Posted: Wed Jan 16, 2008 3:18 am
by AJ
Yes - there is a difference.

If you plan to just have your kernel and boot loader on the floppy and not use it for anything else, fine. As soon as you start adding other things like driver files, you need to have some kind of file format so that your kernel can keep track of what is where.

There is also the issue of accessing the disk with another OS. At the moment, adding a new driver to my OS is as simple as just dropping that file to the disk from within Windows. If I just had a flat binary system, I would have to re-write the whole disk and keep track of where each individual file started.

Cheers,
Adam

Posted: Wed Jan 16, 2008 3:22 am
by 01000101
In my case, it is a one-time deal with the floppy. Pop it in, boot, it writes itself to memory then to a hdd to continue operating. Also, the floppy will (in the near future) be partly encrypted, so I'm not so worried about writing back to the file or having it readable on other OS's.

Posted: Wed Jan 16, 2008 3:24 am
by JamesM
Where's my ext2 option, dammit?!

Posted: Wed Jan 16, 2008 3:27 am
by 01000101
sorry, I didn't even come accross a single ext2 tutorial/documentation so it slipped my mind lol. I'm primarily concerned with the DOS FAT12 fs.

Posted: Wed Jan 16, 2008 4:15 am
by JamesM
My floppy is ext2 formatted (although it's only read by GRUB), and so is my HDD image.

Posted: Wed Jan 16, 2008 7:39 am
by jgraef
Hi,

I also use ext2 and I also use Grub for booting my OS.

Posted: Wed Jan 16, 2008 7:42 am
by Brynet-Inc
You should really extend your poll... At least put an "Other - Specify" option, not everyone uses FAT.

Posted: Wed Jan 16, 2008 8:05 am
by Ready4Dis
I stick with FAT. I can easily drag/drop files onto a floppy disk under windows, linux, *insert OS here*, makes development and copying files back and forth between easy. I do not use the floppy much, most of my development is done on the hard drive, which I use Fat16/Fat32 for (depending on it's size) for the same reason. I can drag and drop my kernel + drivers from windows straight to the hard-drive, reboot and test the updated kernel. My OS is not restricted to a specific file format howerver, I just chose to implement Fat first since it's widely supported. I could easily implement a custom file format (which I did as well, but don't typically use it, more for learning than anything), or ext2, or *insert format here*. Like I said though, I started with Fat due to its wide support.

Posted: Wed Jan 16, 2008 1:35 pm
by 01000101
ok seriously, I just want to know the difference between raw dump of data on a floppy and FAT12. Unless there is something significantly better about ext on the floppy disk, i see no need for it in the poll as it is not what i am asking about.

Posted: Wed Jan 16, 2008 1:51 pm
by Combuster
01000101 wrote:ok seriously, I just want to know the difference between raw dump of data on a floppy and FAT12. Unless there is something significantly better about ext on the floppy disk, i see no need for it in the poll as it is not what i am asking about.
Your poll simply asks how people write their OS to floppy. Therefore Ext2, and many other existing filesystems are valid replies that are not accomodated.

Posted: Wed Jan 16, 2008 1:57 pm
by 01000101
not exactly.
is there a real difference by using the FAT12 formatting and then conforming your code to read that?

Posted: Wed Jan 16, 2008 3:10 pm
by jgraef
The question for the poll is
Your floppy format?
If yo do not care about the filesystem you could also ask: "Do you just put your OS on the floppy by writing raw sectors on it or do you use a file system?"

Re: DOS format or unformatted sectors?

Posted: Wed Jan 16, 2008 4:06 pm
by Brynet-Inc
01000101 wrote:is there a real difference by using the FAT12 formatting and then conforming your code to read that?
There certainly is.. hard drives and floppy drives aren't tape drives, they deserve a file system that allows people to access files consistently. (Without needing to manually memorize where one file begins, and another ends.).

If you ever expect anyone to use your OS, You'll need to implement support for a file system.. nobody will just dump raw bytes on their drive in an unorganized fashion just because you personally think it's "easier".

(BTW, Re-phrase your question next time if "non-FAT" file systems aren't important to you.. :roll:)

(You'll also avoid embarrassments like: This. :lol:)

Posted: Wed Jan 16, 2008 8:49 pm
by Jef
It depends on what you want to do with your OS, and how small it will be.

for example,
if you want to make a personal firewall and you will keep it ONLY for you, raw format is fine.
if you want to make an OS with GUI and be like "every-day" OS, you need a really good/fast format.

When i start writing my OS, i start with 16-bit real-mode.
Then i realize that i am loosing my time on this.
Then i rewrite all in 32-bit protected mode, and of course i wrote a FDC driver for it.
Now i am thinking that it was waste of time to write a FDC driver because is obsolete. But,... you must start from somewhere.