SvarDOS / bugz

SvarDOS bug tracker
http://svardos.org/
7 stars 0 forks source link

SvarDOS installs on a non-initialized FAT partition #90

Closed boeckmann closed 3 months ago

boeckmann commented 3 months ago

If deleting a partition and re-creating it afterwards with Free FDISK, SvarDOS "installs" into it. But this should fail, because actually the partition is not properly set up without running FORMAT. The problem is that the EDR kernel sets up a valid BPB for an unformatted disk and does not block access to it.

This is related of https://github.com/SvarDOS/edrdos/issues/49 not being implemented.

My guess is that the DR-DOS FDISK initializes the partition right away, so this is a non-issue under DR-DOS. I do not know if they spawn FORMAT from FDISK or how they do it, but after creating the partition with DR-DOS FDISK seems to be a usable FAT partition.

For the time being, and until https://github.com/SvarDOS/edrdos/issues/49 is properly implemented, I suggest to always ask the user if he wants to format the installation drive (and strongly suggest it).

mateuszviste commented 3 months ago

I did notice this and I was a little bit surprised that I can do a seemingly working DIR on an unformatted partition, but I naively assumed this is a side effect of a missing int 24 error handler and did not look deeper.

For the time being, and until https://github.com/SvarDOS/edrdos/issues/49 is properly implemented, I suggest to always ask the user if he wants to format the installation drive (and strongly suggest it).

Maybe only doing this for drives that appear to be completely empty. Or maybe there is a way to check if the drive is healthy, like comparing free space vs total space, geometry, etc..

boeckmann commented 3 months ago

Maybe only doing this for drives that appear to be completely empty. Or maybe there is a way to check if the drive is healthy, like comparing free space vs total space, geometry, etc..

Should be the kernels job to make sure such a partition is not accessible. So I would refrain from implmenting such a "feature" in the user space. I will priorize https://github.com/SvarDOS/edrdos/issues/49 and try to solve this in the next 1-2 weeks.

mateuszviste commented 3 months ago

I tested with kernel 20240803: the SvarDOS installer detects unformatted partitions correctly (and refuses to install on them), so it seems this issue is no longer relevant. (thanks for the kernel fix!)

boeckmann commented 3 months ago

Perfect. I will push the latest kernel tomorrow and test the SvarDOS bleeding edge on my Pentium system.