diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e4bbec1..115e659 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,18 +26,19 @@ jobs: xorriso \ grub-pc-bin \ grub-common \ - mtools \ qemu-system-x86 \ - llvm \ - name: Compile & Link run: | meson setup build ninja -C build - - name: Test + - name: Artifact Analysis run: | - timeout 30s ninja -C build run || true + timeout 10s ninja -C build runmin || true + + grep -q "1KCSWF23Z456789" build/bootstrap.log + ! grep -i "panic\|fault\|crash\|oops\|error" build/serial.log ls -la build/voidframe.krnl test -s build/voidframe.krnl @@ -45,6 +46,16 @@ jobs: # Check if ISO was created ls -la build/VoidFrame.iso test -s build/VoidFrame.iso + + file build/voidframe.krnl | grep -q "ELF.*executable" + + # Verify kernel size is reasonable (not empty, not huge) + KERNEL_SIZE=$(stat -c%s build/voidframe.krnl) + test $KERNEL_SIZE -gt 100000 # > 100KB + test $KERNEL_SIZE -lt 10000000 # < 10MB + + # Check ISO bootability + file build/VoidFrame.iso | grep -q "ISO.*bootable" - name: Upload kernel artifacts uses: actions/upload-artifact@v4 diff --git a/fs/EXT/Ext2.c b/fs/EXT/Ext2.c new file mode 100644 index 0000000..28579f6 --- /dev/null +++ b/fs/EXT/Ext2.c @@ -0,0 +1,347 @@ +#include "Ext2.h" +#include "../VFS.h" +#include "../../kernel/etc/Console.h" +#include "../../drivers/Ide.h" +#include "../../mm/KernelHeap.h" +#include "../../mm/MemOps.h" +#include "../../kernel/etc/StringOps.h" + +#define EXT2_SUPERBLOCK_OFFSET 1024 +#define EXT2_MAGIC 0xEF53 + +typedef struct { + uint8_t drive; + uint32_t block_size; + uint32_t inode_size; + uint32_t blocks_per_group; + uint32_t inodes_per_group; + uint32_t num_groups; + Ext2Superblock superblock; + Ext2GroupDesc* group_descs; +} Ext2Volume; + +static Ext2Volume volume; +int ext2_initialized = 0; + +// Helper to read a block from the disk +int Ext2ReadBlock(uint32_t block, void* buffer) { + if (block >= volume.superblock.s_blocks_count) { + PrintKernelF("[EXT2] Block %u out of bounds (max: %u)\n", + block, volume.superblock.s_blocks_count - 1); + return -1; + } + uint32_t sector_start = block * (volume.block_size / 512); + uint32_t num_sectors = volume.block_size / 512; + for (uint32_t i = 0; i < num_sectors; i++) { + if (IdeReadSector(volume.drive, + sector_start + i, + (uint8_t*)buffer + (i * 512)) != IDE_OK) { + return -1; + } + } + return 0; +} + +int Ext2Init(uint8_t drive) { + if (ext2_initialized) { + return 0; + } + volume.drive = drive; + + // The superblock is 1024 bytes long and located at offset 1024. + // We assume 512-byte sectors, so we need to read 2 sectors starting from sector 2. + uint8_t sb_buffer[1024]; + if (IdeReadSector(drive, 2, sb_buffer) != IDE_OK || IdeReadSector(drive, 3, sb_buffer + 512) != IDE_OK) { + PrintKernelF("[EXT2] Failed to read superblock.\n"); + return -1; + } + + FastMemcpy(&volume.superblock, sb_buffer, sizeof(Ext2Superblock)); + + // Check for EXT2 magic number + if (volume.superblock.s_magic != EXT2_MAGIC) { + PrintKernelF("[EXT2] Invalid magic number. Not an EXT2 filesystem.\n"); + return -1; + } + + // Calculate important values + if (volume.superblock.s_log_block_size > 10) { // Max 1MB blocks + PrintKernelF("[EXT2] Invalid block size shift: %u\n", + volume.superblock.s_log_block_size); + return -1; + } + volume.block_size = 1024 << volume.superblock.s_log_block_size; + volume.inode_size = volume.superblock.s_inode_size; + volume.blocks_per_group = volume.superblock.s_blocks_per_group; + volume.inodes_per_group = volume.superblock.s_inodes_per_group; + if (volume.blocks_per_group == 0) { + PrintKernelF("[EXT2] Invalid blocks_per_group: 0\n"); + return -1; + } + volume.num_groups = (volume.superblock.s_blocks_count + volume.blocks_per_group - 1) / volume.blocks_per_group; + + PrintKernelF("[EXT2] Block size: %d bytes\n", volume.block_size); + PrintKernelF("[EXT2] Inode size: %d bytes\n", volume.inode_size); + PrintKernelF("[EXT2] Block groups: %d\n", volume.num_groups); + + // Read Block Group Descriptor Table + uint32_t bgdt_size = volume.num_groups * sizeof(Ext2GroupDesc); + volume.group_descs = KernelMemoryAlloc(bgdt_size); + if (!volume.group_descs) { + PrintKernelF("[EXT2] Failed to allocate memory for BGD table.\n"); + return -1; + } + + uint32_t bgdt_block = (volume.block_size == 1024) ? 2 : 1; + if (Ext2ReadBlock(bgdt_block, volume.group_descs) != 0) { + PrintKernelF("[EXT2] Failed to read BGD table.\n"); + KernelFree(volume.group_descs); + return -1; + } + + PrintKernelSuccess("[EXT2] Filesystem initialized successfully.\n"); + ext2_initialized = 1; + return 0; +} + +int Ext2ReadInode(uint32_t inode_num, Ext2Inode* inode) { + if (inode_num == 0) return -1; + + uint32_t group = (inode_num - 1) / volume.inodes_per_group; + if (group >= volume.num_groups) return -1; + + uint32_t index = (inode_num - 1) % volume.inodes_per_group; + uint32_t inode_table_block = volume.group_descs[group].bg_inode_table; + + uint32_t block_offset = (index * volume.inode_size) / volume.block_size; + uint32_t offset_in_block = (index * volume.inode_size) % volume.block_size; + + uint8_t* block_buffer = KernelMemoryAlloc(volume.block_size); + if (!block_buffer) return -1; + + if (Ext2ReadBlock(inode_table_block + block_offset, block_buffer) != 0) { + KernelFree(block_buffer); + return -1; + } + + FastMemcpy(inode, block_buffer + offset_in_block, sizeof(Ext2Inode)); + + KernelFree(block_buffer); + return 0; +} + +// Find a directory entry in a directory inode +uint32_t Ext2FindInDir(Ext2Inode* dir_inode, const char* name) { + if (!S_ISDIR(dir_inode->i_mode)) { + return 0; // Not a directory + } + uint8_t* block_buffer = KernelMemoryAlloc(volume.block_size); + if (!block_buffer) return 0; + // We only handle direct blocks for now + for (int i = 0; i < 12; i++) { + if (dir_inode->i_block[i] == 0) continue; + if (Ext2ReadBlock(dir_inode->i_block[i], block_buffer) != 0) { + continue; + } + Ext2DirEntry* entry = (Ext2DirEntry*)block_buffer; + uint32_t offset = 0; + while (offset < volume.block_size) { + if (entry->inode == 0) break; + char name_buf[256]; + FastMemcpy(name_buf, entry->name, entry->name_len); + name_buf[entry->name_len] = '\0'; + PrintKernelF(" %s\n", name_buf); + offset += entry->rec_len; + if (entry->rec_len == 0) { + PrintKernelF("[EXT2] Corrupted directory entry\n"); + break; + } + entry = (Ext2DirEntry*)((uint8_t*)entry + entry->rec_len); + } + } + KernelFree(block_buffer); + return 0; // Not found +} + +uint32_t Ext2PathToInode(const char* path) { + if (!ext2_initialized || !path) { + return 0; + } + + if (path[0] == '/' && (path[1] == '\0' || path[1] == ' ')) { + return 2; // Root directory inode + } + + // Start from root inode + uint32_t current_inode_num = 2; + Ext2Inode current_inode; + if (Ext2ReadInode(current_inode_num, ¤t_inode) != 0) { + return 0; + } + + char component[256]; + const char* p = path; + if (*p == '/') p++; + + while (*p) { + // Extract next path component + int i = 0; + while (*p && *p != '/' && i < 255) { + component[i++] = *p++; + } + component[i] = '\0'; + + if (!S_ISDIR(current_inode.i_mode)) { + return 0; // Not a directory, but path continues + } + + current_inode_num = Ext2FindInDir(¤t_inode, component); + if (current_inode_num == 0) { + return 0; // Component not found + } + + if (Ext2ReadInode(current_inode_num, ¤t_inode) != 0) { + return 0; // Failed to read next inode + } + + if (*p == '/') p++; + } + + return current_inode_num; +} + +int Ext2ReadFile(const char* path, void* buffer, uint32_t max_size) { + if (!ext2_initialized) return -1; + + uint32_t inode_num = Ext2PathToInode(path); + if (inode_num == 0) return -1; // Not found + + Ext2Inode inode; + if (Ext2ReadInode(inode_num, &inode) != 0) { + return -1; // Failed to read inode + } + + if (!S_ISREG(inode.i_mode)) { + return -1; // Not a regular file + } + + uint32_t file_size = inode.i_size; + uint32_t bytes_to_read = (file_size < max_size) ? file_size : max_size; + uint32_t bytes_read = 0; + + uint8_t* block_buffer = KernelMemoryAlloc(volume.block_size); + if (!block_buffer) return -1; + + // Only handle direct blocks for now + for (int i = 0; i < 12 && bytes_read < bytes_to_read; i++) { + if (inode.i_block[i] == 0) continue; + + if (Ext2ReadBlock(inode.i_block[i], block_buffer) != 0) { + KernelFree(block_buffer); + return -1; + } + + uint32_t remaining_in_block = volume.block_size; + uint32_t remaining_in_file = bytes_to_read - bytes_read; + uint32_t copy_size = (remaining_in_block < remaining_in_file) ? remaining_in_block : remaining_in_file; + + FastMemcpy((uint8_t*)buffer + bytes_read, block_buffer, copy_size); + bytes_read += copy_size; + } + + KernelFree(block_buffer); + return bytes_read; +} + +int Ext2WriteFile(const char* path, const void* buffer, uint32_t size) { + PrintKernelF("[EXT2] WriteFile: %s (Not implemented)\n", path); + return -1; +} + +int Ext2ListDir(const char* path) { + if (!ext2_initialized) return -1; + + uint32_t inode_num = Ext2PathToInode(path); + if (inode_num == 0) return -1; + + Ext2Inode inode; + if (Ext2ReadInode(inode_num, &inode) != 0) return -1; + + if (!S_ISDIR(inode.i_mode)) return -1; + + uint8_t* block_buffer = KernelMemoryAlloc(volume.block_size); + if (!block_buffer) return -1; + + PrintKernelF("Listing directory: %s\n", path); + + // Direct blocks only + for (int i = 0; i < 12; i++) { + if (inode.i_block[i] == 0) continue; + if (Ext2ReadBlock(inode.i_block[i], block_buffer) != 0) continue; + + Ext2DirEntry* entry = (Ext2DirEntry*)block_buffer; + uint32_t offset = 0; + while (offset < volume.block_size) { + if (entry->inode == 0) break; + + char name_buf[256]; + FastMemcpy(name_buf, entry->name, entry->name_len); + name_buf[entry->name_len] = '\0'; + PrintKernelF(" %s\n", name_buf); + + offset += entry->rec_len; + entry = (Ext2DirEntry*)((uint8_t*)entry + entry->rec_len); + } + } + + KernelFree(block_buffer); + return 0; +} + +int Ext2CreateFile(const char* path) { + PrintKernelF("[EXT2] CreateFile: %s (Not implemented)\n", path); + return -1; +} + +int Ext2CreateDir(const char* path) { + PrintKernelF("[EXT2] CreateDir: %s (Not implemented)\n", path); + return -1; +} + +int Ext2Delete(const char* path) { + PrintKernelF("[EXT2] Delete: %s (Not implemented)\n", path); + return -1; +} + +int Ext2IsFile(const char* path) { + if (!ext2_initialized) return 0; + uint32_t inode_num = Ext2PathToInode(path); + if (inode_num == 0) return 0; + + Ext2Inode inode; + if (Ext2ReadInode(inode_num, &inode) != 0) return 0; + + return S_ISREG(inode.i_mode); +} + +int Ext2IsDir(const char* path) { + if (!ext2_initialized) return 0; + uint32_t inode_num = Ext2PathToInode(path); + if (inode_num == 0) return 0; + + Ext2Inode inode; + if (Ext2ReadInode(inode_num, &inode) != 0) return 0; + + return S_ISDIR(inode.i_mode); +} + +uint64_t Ext2GetFileSize(const char* path) { + if (!ext2_initialized) return 0; + uint32_t inode_num = Ext2PathToInode(path); + if (inode_num == 0) return 0; + + Ext2Inode inode; + if (Ext2ReadInode(inode_num, &inode) != 0) return 0; + + return inode.i_size; +} diff --git a/fs/EXT/Ext2.h b/fs/EXT/Ext2.h new file mode 100644 index 0000000..b955b81 --- /dev/null +++ b/fs/EXT/Ext2.h @@ -0,0 +1,113 @@ +#pragma once +#include "stdint.h" + +// Minimal EXT2 data structures + +// ext2_super_block structure +// Located at offset 1024 from the start of the volume +typedef struct { + uint32_t s_inodes_count; + uint32_t s_blocks_count; + uint32_t s_r_blocks_count; + uint32_t s_free_blocks_count; + uint32_t s_free_inodes_count; + uint32_t s_first_data_block; + uint32_t s_log_block_size; + uint32_t s_log_frag_size; + uint32_t s_blocks_per_group; + uint32_t s_frags_per_group; + uint32_t s_inodes_per_group; + uint32_t s_mtime; + uint32_t s_wtime; + uint16_t s_mnt_count; + uint16_t s_max_mnt_count; + uint16_t s_magic; // Should be 0xEF53 + uint16_t s_state; + uint16_t s_errors; + uint16_t s_minor_rev_level; + uint32_t s_lastcheck; + uint32_t s_checkinterval; + uint32_t s_creator_os; + uint32_t s_rev_level; + uint16_t s_def_resuid; + uint16_t s_def_resgid; + // Extended fields + uint32_t s_first_ino; + uint16_t s_inode_size; + uint16_t s_block_group_nr; + uint32_t s_feature_compat; + uint32_t s_feature_incompat; + uint32_t s_feature_ro_compat; + uint8_t s_uuid[16]; + char s_volume_name[16]; + char s_last_mounted[64]; + uint32_t s_algo_bitmap; + // ... other fields omitted for simplicity +} __attribute__((packed)) Ext2Superblock; + +// Block Group Descriptor +typedef struct { + uint32_t bg_block_bitmap; + uint32_t bg_inode_bitmap; + uint32_t bg_inode_table; + uint16_t bg_free_blocks_count; + uint16_t bg_free_inodes_count; + uint16_t bg_used_dirs_count; + uint16_t bg_pad; + uint8_t bg_reserved[12]; +} __attribute__((packed)) Ext2GroupDesc; + +// Inode structure +#define EXT2_N_BLOCKS 15 +typedef struct { + uint16_t i_mode; + uint16_t i_uid; + uint32_t i_size; + uint32_t i_atime; + uint32_t i_ctime; + uint32_t i_mtime; + uint32_t i_dtime; + uint16_t i_gid; + uint16_t i_links_count; + uint32_t i_blocks; + uint32_t i_flags; + uint32_t i_osd1; + uint32_t i_block[EXT2_N_BLOCKS]; + uint32_t i_generation; + uint32_t i_file_acl; + uint32_t i_dir_acl; + uint32_t i_faddr; + uint8_t i_osd2[12]; +} __attribute__((packed)) Ext2Inode; + +// Inode types (in i_mode) +#define EXT2_S_IFDIR 0x4000 // Directory +#define EXT2_S_IFREG 0x8000 // Regular file + +#define S_ISDIR(m) (((m) & 0xF000) == EXT2_S_IFDIR) +#define S_ISREG(m) (((m) & 0xF000) == EXT2_S_IFREG) + +// Directory entry +typedef struct { + uint32_t inode; + uint16_t rec_len; + uint8_t name_len; + uint8_t file_type; + char name[]; +} __attribute__((packed)) Ext2DirEntry; + +// Function prototypes for VFS integration +int Ext2Init(uint8_t drive); +int Ext2ReadFile(const char* path, void* buffer, uint32_t max_size); +int Ext2WriteFile(const char* path, const void* buffer, uint32_t size); +int Ext2ListDir(const char* path); +int Ext2CreateFile(const char* path); +int Ext2CreateDir(const char* path); +int Ext2Delete(const char* path); +int Ext2IsFile(const char* path); +int Ext2IsDir(const char* path); +uint64_t Ext2GetFileSize(const char* path); + +// Internal helpers +int Ext2ReadInode(uint32_t inode_num, Ext2Inode* inode); +uint32_t Ext2PathToInode(const char* path); diff --git a/fs/FAT1x.c b/fs/FAT/FAT1x.c similarity index 100% rename from fs/FAT1x.c rename to fs/FAT/FAT1x.c diff --git a/fs/FAT1x.h b/fs/FAT/FAT1x.h similarity index 100% rename from fs/FAT1x.h rename to fs/FAT/FAT1x.h diff --git a/fs/VFS.c b/fs/VFS.c index f1dfb5b..3872978 100644 --- a/fs/VFS.c +++ b/fs/VFS.c @@ -1,13 +1,14 @@ #include "VFS.h" #include "../mm/MemOps.h" #include "Console.h" -#include "FAT1x.h" +#include "FAT/FAT1x.h" +#include "EXT/Ext2.h" #include "Format.h" +#include "KernelHeap.h" #include "Serial.h" #include "StringOps.h" #include "VFRFS.h" #include "stdbool.h" -#include "KernelHeap.h" #define VFS_MAX_PATH_LEN 256 @@ -58,7 +59,21 @@ int VfsInit(void) { } SerialWrite("[VFS] Root mounted\n"); - // Only mount FAT12 if it was successfully initialized + // Prioritize EXT2 mount first + extern int ext2_initialized; + if (ext2_initialized) { + PrintKernel("[VFS] Attempting EXT2 mount...\n"); + int disk_result = VfsMount(FormatS("%s/VFSystemDrive", DevicesStorage), VFS_EXT2, 0); + + if (disk_result == 0) { + SerialWriteF("[VFS] EXT2 mounted at %s/VFSystemDrive\n", DevicesStorage); + } else { + SerialWrite("[VFS] EXT2 mount failed\n"); + } + } else { + PrintKernel("[VFS] Skipping EXT2 mount - Not initialized\n"); + } + extern int fat12_initialized; if (fat12_initialized) { PrintKernel("[VFS] Attempting FAT12 mount...\n"); @@ -179,6 +194,9 @@ int VfsReadFile(const char* path, void* buffer, uint32_t max_size) { // Use new path-aware function return Fat1xReadFile(local_path, buffer, max_size); } + case VFS_EXT2: { + return Ext2ReadFile(local_path, buffer, max_size); + } } return -1; @@ -214,6 +232,9 @@ int VfsListDir(const char* path) { if (!fat12_initialized) return -1; return Fat1xListDirectory(local_path); } + case VFS_EXT2: { + return Ext2ListDir(local_path); + } } return -1; @@ -238,6 +259,9 @@ int VfsCreateFile(const char* path) { extern int fat12_initialized; if (!fat12_initialized) return -1; return Fat1xCreateFile(local_path); + case VFS_EXT2: { + return Ext2CreateFile(local_path); + } } return -1; @@ -258,6 +282,9 @@ int VfsCreateDir(const char* path) { extern int fat12_initialized; if (!fat12_initialized) return -1; return Fat1xCreateDir(local_path); + case VFS_EXT2: { + return Ext2CreateDir(local_path); + } } return -1; @@ -280,6 +307,9 @@ int VfsDelete(const char* path, bool Recursive) { if (!fat12_initialized) return -1; if (Recursive) return Fat1xDeleteRecursive(local_path); return Fat1xDeleteFile(local_path); + case VFS_EXT2: { + return Ext2Delete(local_path); + } } return -1; @@ -336,6 +366,9 @@ uint64_t VfsGetFileSize(const char* path) { return Fat1xGetFileSize(local_path); } + case VFS_EXT2: { + return Ext2GetFileSize(local_path); + } default: SerialWrite("[VFS] VfsGetFileSize: Unknown filesystem type\n"); @@ -366,6 +399,9 @@ int VfsIsFile(const char* path) { int read_result = Fat1xReadFile(local_path, test_buffer, 1); return read_result >= 0; } + case VFS_EXT2: { + return Ext2IsFile(local_path); + } } return 0; @@ -388,6 +424,9 @@ int VfsIsDir(const char* path) { // Use new directory detection function return Fat1xIsDirectory(local_path); } + case VFS_EXT2: { + return Ext2IsDir(local_path); + } } return 0; } @@ -412,6 +451,9 @@ int VfsWriteFile(const char* path, const void* buffer, uint32_t size) { extern int fat12_initialized; if (!fat12_initialized) return -1; return Fat1xWriteFile(local_path, buffer, size); + case VFS_EXT2: { + return Ext2WriteFile(local_path, buffer, size); + } } return -1; diff --git a/fs/VFS.h b/fs/VFS.h index 7f1bb31..8e9f1b3 100644 --- a/fs/VFS.h +++ b/fs/VFS.h @@ -8,7 +8,8 @@ typedef enum { VFS_RAMFS = 0, VFS_FAT12 = 1, - VFS_FAT16 = 2 + VFS_FAT16 = 2, + VFS_EXT2 = 3 } VfsType; typedef struct { diff --git a/kernel/core/Kernel.c b/kernel/core/Kernel.c index fe37d93..f3e8bd3 100644 --- a/kernel/core/Kernel.c +++ b/kernel/core/Kernel.c @@ -1,8 +1,9 @@ // VoidFrame Kernel Entry File #include "Kernel.h" +#include "../../fs/FAT/FAT1x.h" #include "Compositor.h" #include "Console.h" -#include "FAT1x.h" +#include "EXT/Ext2.h" #include "Format.h" #include "Gdt.h" #include "ISA.h" @@ -647,13 +648,19 @@ static InitResultT PXS2(void) { // Explicitly initialize FAT12 before VFS PrintKernel("Info: Initializing FAT12...\n"); if (Fat1xInit(0) == 0) { - PrintKernelSuccess("System: FAT12 Driver initialized\n"); + PrintKernelSuccess("System: FAT1x Driver initialized\n"); } else { - PrintKernelWarning("FAT12 initialization failed\n"); + PrintKernelWarning("FAT1x initialization failed\n"); + } + + if (Ext2Init(0) == 0) { + PrintKernelSuccess("System: Ext2 Driver initialized\n"); + } else { + PrintKernelWarning("Ext2 initialization failed\n"); } } else { PrintKernelWarning(" IDE initialization failed - no drives detected\n"); - PrintKernelWarning(" Skipping FAT12 initialization\n"); + PrintKernelWarning(" Skipping FAT1x & EXT2 initialization\n"); } #endif diff --git a/kernel/etc/StringOps.c b/kernel/etc/StringOps.c index 9bca9b5..4de7670 100644 --- a/kernel/etc/StringOps.c +++ b/kernel/etc/StringOps.c @@ -22,6 +22,23 @@ void FastStrCopy(char* dst, const char* src, size_t max_len) { dst[i] = '\0'; } +int FastStrnCmp(const char* str1, const char* str2, size_t n) { + if (!str1 || !str2) return (str1 == str2) ? 0 : (str1 ? 1 : -1); + if (n == 0) return 0; // Edge case: comparing 0 characters + + // Compare up to n characters + while (n > 0 && *str1 && *str1 == *str2) { + str1++; + str2++; + n--; + } + + // If we've compared n characters, they're equal + if (n == 0) return 0; + + return (unsigned char)*str1 - (unsigned char)*str2; +} + int FastStrCmp(const char* str1, const char* str2) { if (!str1 || !str2) return (str1 == str2) ? 0 : (str1 ? 1 : -1); diff --git a/kernel/etc/StringOps.h b/kernel/etc/StringOps.h index e991db0..1548575 100644 --- a/kernel/etc/StringOps.h +++ b/kernel/etc/StringOps.h @@ -7,6 +7,7 @@ size_t FastStrlen(const char* s, size_t max); void FastStrCopy(char* dst, const char* src, size_t max_len); const char* FastStrChr(const char* str, int c); int StringLength(const char* str); +int FastStrnCmp(const char* str1, const char* str2, size_t n); void strncpy(char* dest, const char* src, size_t max_len); void strcpy(char* dest, const char* src); diff --git a/meson.build b/meson.build index 6584dd0..b886b81 100644 --- a/meson.build +++ b/meson.build @@ -68,6 +68,8 @@ inc_dirs = [ src_root + '/drivers/sound', src_root + '/drivers/virtio', src_root + '/fs', + src_root + '/fs/FAT', + src_root + '/fs/EXT', src_root + '/mm', src_root + '/mm/trace', src_root + '/mm/security', @@ -110,7 +112,8 @@ c_sources = [ src_root + '/mm/trace/StackTrace.c', src_root + '/mm/security/Cerberus.c', src_root + '/fs/VFRFS.c', - src_root + '/fs/FAT1x.c', + src_root + '/fs/FAT/FAT1x.c', + src_root + '/fs/EXT/Ext2.c', src_root + '/fs/Iso9660.c', src_root + '/fs/VFS.c', src_root + '/drivers/Pic.c', @@ -265,6 +268,19 @@ run_target('run', ] ) +run_target('runmin', + command : [qemu_system_x86_64.full_path(), + '-cdrom', 'VoidFrame.iso', + '-nographic', + '-debugcon', 'file:bootstrap.log', + '-serial', 'file:serial.log', + '-no-reboot','-no-shutdown', + '-m', '4G', + '-boot', 'd', + ] +) + + run_target('img', command : [ 'sh', '-c',