diff options
Diffstat (limited to 'src/kernel/main.c')
-rw-r--r-- | src/kernel/main.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/kernel/main.c b/src/kernel/main.c index dbeb11b..877a276 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -1,14 +1,36 @@ #include <stdint.h> #include "vga.h" #include "fat.h" +#include "fs.h" +#include "ata.h" +#include "panic.h" +#include "serial.h" +#include "util.h" + +uint8_t nbuf[11]; void main() { vga_blank(); - vga_printsz("In kernel-land\n\nDisk label: "); + vga_printsz("Initializing drivers..."); + sinit(); + vga_printsz("\n Serial ready."); + load_fat(); + clear_fs_handles(); + vga_printsz("\n File system ready.\n\nDisk label: "); vga_printsn(FAT_INFO->label, 11); vga_printsz("\nDisk size: "); - vga_printu32((FAT_INFO->sectors * FAT_INFO->bytes_per_sector) >> 10); - vga_printsz("k\n\nHalting..."); + u32_dec(FAT_INFO->sectors >> 1, nbuf); + vga_printsz(nbuf); + vga_printsz("k\n\nFAT start:\n"); + nbuf[3] = 0; + for (uint8_t r = 0; r < 192; r += 24) { + for (uint8_t c = 0; c < 24; ++c) { + u8_hex(*(uint8_t *)(FAT + r + c), nbuf); + nbuf[2] = ' '; + vga_printsz(nbuf); + } + vga_printch('\n'); + } while (1) asm ("hlt"); }
\ No newline at end of file |