diff options
author | Marvin Borner | 2021-07-07 19:13:11 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-07 19:13:11 +0200 |
commit | 9a2d5cbdc7972d1d5bfb1ea93f82f66d113faa17 (patch) | |
tree | 08ceb8427b64a08c89a5526dfbf8b66c78f9d12c /example/mb1/main.c | |
parent | 6355c3e08c9f4d3db122252abce5837c364d5b81 (diff) |
Strange implementations
Diffstat (limited to 'example/mb1/main.c')
-rw-r--r-- | example/mb1/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/example/mb1/main.c b/example/mb1/main.c index 0174803..d572977 100644 --- a/example/mb1/main.c +++ b/example/mb1/main.c @@ -1,6 +1,16 @@ // MIT License, Copyright (c) 2021 Marvin Borner typedef unsigned int u32; +typedef unsigned short u16; +typedef unsigned char u8; + +static void draw(u8 color, u8 data) +{ + u16 *out = (u16 *)0xb8000; + for (u16 i = 0; i < 80 * 25; i++) { + out[i] = data | (color << 8); + } +} int kernel_main(u32 magic, u32 addr, u32 esp); // Decl int kernel_main(u32 magic, u32 addr, u32 esp) @@ -9,6 +19,11 @@ int kernel_main(u32 magic, u32 addr, u32 esp) (void)addr; (void)esp; + if (magic == 0x2badb002) + draw(0x02, 'y'); + else + draw(0x04, 'n'); + while (1) ; |