From: Tulio A M Mendes Date: Fri, 13 Feb 2026 05:07:22 +0000 (-0300) Subject: feat: mount FAT and ext2 filesystems from init.c X-Git-Url: https://projects.tadryanom.me/docs/static/gitweb.css?a=commitdiff_plain;h=a7633e5b663153b608c3ca1ae5e4413c52cbb5a2;p=AdrOS.git feat: mount FAT and ext2 filesystems from init.c - Probe IDE disk at LBA 0 for FAT and ext2 signatures during boot - FAT mounts at /fat, ext2 mounts at /ext2 - Both fail gracefully on unformatted/zeroed disks (no panic) - diskfs remains at /disk as primary RW filesystem Build: clean, cppcheck: clean, smoke: 19/19 pass --- diff --git a/src/kernel/init.c b/src/kernel/init.c index 4f34320..04954f4 100644 --- a/src/kernel/init.c +++ b/src/kernel/init.c @@ -12,6 +12,8 @@ #include "persistfs.h" #include "diskfs.h" #include "procfs.h" +#include "fat.h" +#include "ext2.h" #include "pci.h" #include "e1000.h" #include "net.h" @@ -104,6 +106,22 @@ int init_start(const struct boot_info* bi) { (void)vfs_mount("/proc", proc); } + /* Probe second IDE disk partition (LBA 0) for FAT or ext2. + * The primary disk is used by diskfs; a second partition could + * be formatted as FAT or ext2 and mounted at /mnt. */ + { + fs_node_t* fatfs = fat_mount(0); + if (fatfs) { + (void)vfs_mount("/fat", fatfs); + } + } + { + fs_node_t* ext2fs = ext2_mount(0); + if (ext2fs) { + (void)vfs_mount("/ext2", ext2fs); + } + } + int user_ret = arch_platform_start_userspace(bi); if (bi && cmdline_has_token(bi->cmdline, "ring3")) {