Skip to content

[kernel] Rearchitect fake FAT /dev inode numbers to fix 360k FAT boot failure#2681

Merged
ghaerr merged 1 commit into
masterfrom
fatdev2
May 12, 2026
Merged

[kernel] Rearchitect fake FAT /dev inode numbers to fix 360k FAT boot failure#2681
ghaerr merged 1 commit into
masterfrom
fatdev2

Conversation

@ghaerr

@ghaerr ghaerr commented May 12, 2026

Copy link
Copy Markdown
Owner

While debugging #2678 it was found that the ELKS 360k FAT floppy distribution images would not boot, due to the architecture of the fake FAT /dev mechanism in the kernel. Occurring only in certain FAT floppies formatted to DOS with a small FAT table (< 5, but all 360k FAT floppies produced by ELKS builds), the FAT /dev and sometimes /bin directories were corrupted, causing boot failure.

On FAT filesystems, the "inode" number happens to be the block number of the sector containing the directory entry, since FAT doesn't actually implement inodes. When the FAT table is small, then certain directory entries were at block numbers that were small enough to trigger the /dev emulation, in this case, turning both /bin and /dev into character devices from the internal table. The code was rewritten to use a very high inode number (0xFFFFFF00) for faked /dev entries, which will work with both small and very large FAT images.

This problem seems to have occurred prior to the release of both v0.9.0 and was not fixed in v0.9.1, so it is likely that yet another small release (v0.9.2) should come soon, for those users that might want to boot a 360k FAT floppy. The problem is independent of using the BIOS or direct floppy driver in the kernel.

This PR also increments the ELKS version number to v0.9.2-dev.

@ghaerr ghaerr merged commit 4b8d0b2 into master May 12, 2026
1 check passed
@ghaerr ghaerr deleted the fatdev2 branch May 12, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant