disk: In "superfloppy" mode, create a fake partition entry

We normally create a table of the partition sizes/types present
on a drive.  Howeever, if the drive is set up as a "superfloppy",
where there is no partition table and a single filesystem starting
at sector 0, this "pinfo" table is not populated.

So now, populate the pinfo table with a single entry that matches
the filesystem type, start, and size.

Change-Id: Ifa8760909109d67ff96481b1fc7f26c64280a00a
This commit is contained in:
Solomon Peachy 2025-04-26 11:59:36 -04:00
parent 12b9419006
commit c31518201c

View file

@ -396,6 +396,13 @@ int disk_mount(int drive)
mounted = 1;
init_volume(&volumes[volume], drive, 0);
volume_onmount_internal(IF_MV(volume));
struct storage_info info;
storage_get_info(drive, &info);
pinfo[0].type = PARTITION_TYPE_FAT32_LBA;
pinfo[0].start = 0;
pinfo[0].size = info.num_sectors;
}
if (mounted == 0 && volume != -1) /* not a "superfloppy"? */