From 44c0352f0d4124d7c367352e4de746a51b9db42b Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 25 May 2020 15:35:45 -0400 Subject: got file loading working properly --- src/kernel/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/kernel/main.c') diff --git a/src/kernel/main.c b/src/kernel/main.c index 194ce93..92e778c 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -54,5 +54,19 @@ void main() { u32_dec(e.length, nbuf); vga_printsz(nbuf); } + fs_close(root); + if (root = fs_open("BLEH.TXT")) { + vga_printsz("\n\nContents of BLEH.TXT:"); + uint8_t l; + uint8_t line[82]; + line[0] = '\n'; + line[1] = ' '; + line[2] = ' '; + while (l = fs_read(root, 78, line + 3)) { + line[l + 3] = 0; + vga_printsz(line); + } + fs_close(root); + } halt(); } \ No newline at end of file -- cgit v1.2.3