diff options
author | Simponic <loganthebean222@gmail.com> | 2021-02-20 23:24:25 -0700 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2021-02-20 23:24:25 -0700 |
commit | a2a4a155c259d24101435771607b81f167b62cf3 (patch) | |
tree | 8e5dc73b21d02abbfe0f5185050c48908b3249ab /src/kernel.c | |
download | simponicos-a2a4a155c259d24101435771607b81f167b62cf3.tar.gz simponicos-a2a4a155c259d24101435771607b81f167b62cf3.zip |
Changed to nasm
Diffstat (limited to 'src/kernel.c')
-rw-r--r-- | src/kernel.c | 22 |
1 files changed, 22 insertions, 0 deletions
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); +} + |