summaryrefslogtreecommitdiff
path: root/src/kernel/main.c
diff options
context:
space:
mode:
authorBenji Dial <benji3.141@gmail.com>2020-05-24 11:02:43 -0400
committerBenji Dial <benji3.141@gmail.com>2020-05-24 11:02:43 -0400
commit02f14113cbf14c6f842fb43ecbc68d0c851ef3b0 (patch)
tree75d2d943d9822b3f945fd947e9b91eec1d68e900 /src/kernel/main.c
parent31d8ae388a7ded576abd3e3d99c3d9193ea6d704 (diff)
downloadportland-os-02f14113cbf14c6f842fb43ecbc68d0c851ef3b0.tar.gz
very basic vga, ata, serial drivers. start of fat and fs drivers
Diffstat (limited to 'src/kernel/main.c')
-rw-r--r--src/kernel/main.c28
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