The 1.44MB FAT32 floppy disk

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: The 1.44MB FAT32 floppy disk

Post by onlyonemac »

SpyderTL wrote:Not sure about Linux. Never tried to format a floppy with FAT32, or EXT4. Anyone know if this is possible?
I once tried to format a floppy as ext3, because firstly I wanted a modern filesystem on my floppy, secondly I wanted to make a bootable Linux disk and ext3 seemed like an obvious choice (I didn't know better at the time) and thirdly I wanted a journaling filesystem on the floppy in case I accidentally ejected the disk halfway through a filesystem operation (lol, I do that a lot even today - I used to forget to look at the drive LED before ejecting the disk, and now I forget to check if the drive noise has stopped before ejecting - I remember that the LED and the noise didn't always even tie up, and I think I used to have to wait a few seconds after the LED went off before ejecting the disk, otherwise the drive motor was still turning and I would damage the disk when I ejected it - the pressure placed on the disk when ejecting it while it's turning tends to scratch the disk inside).
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: The 1.44MB FAT32 floppy disk

Post by onlyonemac »

Kazinsal wrote:This is still a bad hack. A clever hack would be adding support for DMF or XDF.
Are those open, documented, and/or reverse-engineerable formats?
Kazinsal wrote:Or something actually useful, like giving MikeOS the ability to use subdirectories.
lol

The point of putting FAT32 on a floppy, MikeOS, OSdev, and messing around with computers in general, is because it's fun. We like to do things so that we can say "it can be done" or "I managed to do something new" or "I managed to make something work in a way that it wasn't intended - bonus points if I can get it to work reliably". There may be those who do these things with the hope of some other benefit, financial or otherwise, but for most of us it's about having fun. As I like to quote, "just for fun".
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Octocontrabass
Member
Member
Posts: 5517
Joined: Mon Mar 25, 2013 7:01 pm

Re: The 1.44MB FAT32 floppy disk

Post by Octocontrabass »

onlyonemac wrote:Are those open, documented, and/or reverse-engineerable formats?
DMF and XDF are supported by fdutils, so you can use that as your documentation.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: The 1.44MB FAT32 floppy disk

Post by SpyderTL »

After playing around with Arch Linux a little today, I found that it would happily format floppy disks with ext2, ext3, ext4 (with a warning), fat and vfat. It may also format xdf, but I could not figure out the parameters that it wanted.

None of the Linux distros seem to run the floppy module by default any more, so I had to run it manually... :roll:
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: The 1.44MB FAT32 floppy disk

Post by onlyonemac »

SpyderTL wrote:After playing around with Arch Linux a little today, I found that it would happily format floppy disks with ext2, ext3, ext4 (with a warning), fat and vfat.
I remember that ext3 apparently wouldn't fit on a floppy, but perhaps there was a configuration option that I missed. Are these properly formatting floppies (i.e. reported capacity of ~1.44MB and able to function correctly) or are they floppies with large reported capacities and loads of bad sectors?
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Octocontrabass
Member
Member
Posts: 5517
Joined: Mon Mar 25, 2013 7:01 pm

Re: The 1.44MB FAT32 floppy disk

Post by Octocontrabass »

SpyderTL wrote:After playing around with Arch Linux a little today, I found that it would happily format floppy disks with ext2, ext3, ext4 (with a warning), fat and vfat. It may also format xdf, but I could not figure out the parameters that it wanted.
DMF and XDF are just FAT12 with specific parameters. What makes them special is that they physically use more of the floppy disk's surface for storing data. On a 3½-inch high density floppy disk, DMF increases the physical capacity from 1440 KiB to 1680 KiB, and XDF increases it to 1836 KiB.

The physical format for DMF is very simple, so you can easily put whatever filesystem you want on a DMF-formatted disk. The same is not true for XDF; you typically need special utilities to access an XDF-formatted disk, and those utilities will expect a very specific filesystem.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: The 1.44MB FAT32 floppy disk

Post by Kazinsal »

XDF is not FAT. XDF is a different low level format on the floppy disk entirely and is totally separate from FAT.

It's more like a layer 2 change, where the filesystem is a layer 3 change.
Octocontrabass
Member
Member
Posts: 5517
Joined: Mon Mar 25, 2013 7:01 pm

Re: The 1.44MB FAT32 floppy disk

Post by Octocontrabass »

DMF and XDF describe both the physical sector layout and the filesystem written to those sectors. If you change the filesystem, it's no longer DMF/XDF. :wink:
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: The 1.44MB FAT32 floppy disk

Post by Kazinsal »

DMF does not use a different filesystem. A regular FAT12 driver can read a DMF-formatted floppy with a FAT12 filesystem on it provided the FAT12 driver isn't so daft as to presume there are 18 sectors per track on the floppy and instead reads the BPB, and so long as the floppy driver recognizes that there are 21 sectors per track on the floppy and adjusts its LBA-to-CHS calculations accordingly.

XDF is a specification for modifying the sector layout of floppy disk tracks, not for the filesystem on top of it. In fact, IBM floppies that were XDF-formatted can be read by a plain FAT12 driver so long as the underlying floppy driver also recognizes the layout of the tracks and the sector interleaving and adjusts its LBA-to-CHS accordingly.

Nothing about the filesystem on DMF and XDF formatted floppies changes outside of the information block that informs the driver of the parameters of the media itself, which is entirely within the base FAT12 specifications. Hell, you can even read a FAT12 filesystem on an image of an XDF-formatted floppy with a plain FAT12 image reader because FAT12 uses logical cluster numbering and it's all just a linear stream of ones and zeroes if the "floppy disk" is just a block of RAM.
Octocontrabass
Member
Member
Posts: 5517
Joined: Mon Mar 25, 2013 7:01 pm

Re: The 1.44MB FAT32 floppy disk

Post by Octocontrabass »

Kazinsal wrote:DMF does not use a different filesystem. A regular FAT12 driver can read a DMF-formatted floppy with a FAT12 filesystem on it provided the FAT12 driver isn't so daft as to presume there are 18 sectors per track on the floppy and instead reads the BPB, and so long as the floppy driver recognizes that there are 21 sectors per track on the floppy and adjusts its LBA-to-CHS calculations accordingly.
I never said the filesystem was different, just that it's specified along with the physical format. DMF uses FAT12 with 16 root directory entries and larger clusters (I think 1 KiB but I don't have any disks I can check at the moment). You can use different parameters, but then it's not DMF anymore.
Kazinsal wrote:XDF is a specification for modifying the sector layout of floppy disk tracks, not for the filesystem on top of it. In fact, IBM floppies that were XDF-formatted can be read by a plain FAT12 driver so long as the underlying floppy driver also recognizes the layout of the tracks and the sector interleaving and adjusts its LBA-to-CHS accordingly.
This is true, but only because a plain FAT12 driver will not try to read the second FAT and will not try to read sectors that are marked bad. The physical-to-logical mapping for XDF has two holes in it, where logical sectors don't correspond to any physical sectors. One hole is located in the second FAT, and the other is located at the start of the data area in clusters that are marked bad. According to fdutils and mtools, the mapping changes depending on the filesystem parameters, which means the disk must be formatted as FAT12 for those utilities to read the disk properly.

XDF also has an 8-sector compatibility area, which can be read on systems without XDF support. This compatibility area contains another FAT12 filesystem in order to alert the user that the disk is formatted as XDF. These sectors are mapped to the first 8 sectors of the second FAT when the disk is read using an XDF driver. If you want to use them for their intended purpose, the main filesystem must avoid them.
Kazinsal wrote:Nothing about the filesystem on DMF and XDF formatted floppies changes outside of the information block that informs the driver of the parameters of the media itself, which is entirely within the base FAT12 specifications. Hell, you can even read a FAT12 filesystem on an image of an XDF-formatted floppy with a plain FAT12 image reader because FAT12 uses logical cluster numbering and it's all just a linear stream of ones and zeroes if the "floppy disk" is just a block of RAM.
You can write a DMF disk with an ordinary FAT12 driver, but not an XDF disk.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: The 1.44MB FAT32 floppy disk

Post by BenLunt »

onlyonemac wrote:The point of putting FAT32 on a floppy, MikeOS, OSdev, and messing around with computers in general, is because it's fun. We like to do things so that we can say "it can be done" or "I managed to do something new" or "I managed to make something work in a way that it wasn't intended - bonus points if I can get it to work reliably". There may be those who do these things with the hope of some other benefit, financial or otherwise, but for most of us it's about having fun. As I like to quote, "just for fun".
I one-hundred percent agree.

Ben
Profvip
Posts: 1
Joined: Sun Dec 18, 2016 9:32 pm

Re: The 1.44MB FAT32 floppy disk

Post by Profvip »

Is it an open source as I can't see any links to the project?
I'm working on modifying the FAT 12 Based boot loader to work with NTFS and FAT32.
Thanks a lot
Post Reply