From 02f14113cbf14c6f842fb43ecbc68d0c851ef3b0 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 24 May 2020 11:02:43 -0400 Subject: very basic vga, ata, serial drivers. start of fat and fs drivers --- src/kernel/main.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/kernel/main.c') 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 #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 -- cgit v1.2.3