]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: consolidate kconsole banner + safe disk FS probe order
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 07:39:05 +0000 (04:39 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 07:39:05 +0000 (04:39 -0300)
commita3698e075ca713d6fb57b330e48ea7b4f0ed5f23
tree0c36e99eefa4e8bef2af1c7d7739b114053efce9
parenta2e7d0a209635fa837119f52f267996ea0998468
fix: consolidate kconsole banner + safe disk FS probe order

1. Consolidate redundant PANIC + kconsole banners into a single
   message shown by kconsole_enter(). Previously both main.c and
   kconsole.c printed separate banners.

2. Fix critical VFS mount ordering bug: diskfs, FAT, and ext2 all
   share the same ATA primary master disk at LBA 0. Previously
   diskfs_create_root() was called first, and its auto-format
   (diskfs_super_load) would overwrite LBA 2-3 if DISKFS_MAGIC
   was not found -- destroying any ext2 superblock at the same
   location. Now the probe order is:
     a) ext2 (checks magic 0xEF53 at byte 1080)
     b) FAT (validates BPB fields at LBA 0)
     c) diskfs (fallback, may auto-format blank disks)
   Only one FS is mounted per device -- they are mutually exclusive.

3. Make ata_pio_init_primary_master() idempotent with a static
   guard flag so it can be called from both init.c and
   diskfs_create_root() without double-initializing.

4. Increase VFS mount table from 8 to 16 slots to prevent
   -ENOSPC when adding future mount points.

Build: clean, cppcheck: clean, smoke: 19/19 pass
src/hal/x86/ata_pio.c
src/kernel/fs.c
src/kernel/init.c
src/kernel/kconsole.c
src/kernel/main.c