From a2a4a155c259d24101435771607b81f167b62cf3 Mon Sep 17 00:00:00 2001 From: Simponic Date: Sat, 20 Feb 2021 23:24:25 -0700 Subject: Changed to nasm --- src/kernel.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/kernel.c (limited to 'src/kernel.c') diff --git a/src/kernel.c b/src/kernel.c new file mode 100644 index 0000000..d24c24e --- /dev/null +++ b/src/kernel.c @@ -0,0 +1,22 @@ +#include "gdt.h" +#include "types.h" +#include "print.h" + +#define FOREGROUND 0x0 +#define BACKGROUND 0xF + +void PrintWithScreenFill(char* string, TextOutput* output_stream) { + // Print a string and fill the screen + print(string, BACKGROUND, FOREGROUND, output_stream); + int row = output_stream->terminal_row; + while (output_stream->terminal_row < output_stream->max_row) { + putChar('\n', BACKGROUND, FOREGROUND, output_stream); + } + output_stream->terminal_row = row; +} + +void kernel_main(void) { + TextOutput output_stream = createOutput(25,80,(uint16_t*)0xB8000); + PrintWithScreenFill("Hello, Logan World!\n", &output_stream); +} + -- cgit v1.2.3-70-g09d2