diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-21 02:36:06 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-21 02:42:10 +0100 |
commit | 5129e9f9f732f7d2829f02597cdb4ad2c0f3d856 (patch) | |
tree | e1bafa66c3baa0c07b6a5addc6bdc93ff64539fa | |
parent | 80513bc18ca32f5cc6a5b72e3ad812de3db9a6da (diff) | |
download | cuddles-5129e9f9f732f7d2829f02597cdb4ad2c0f3d856.tar.xz |
compile terminus font into the kernel
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | stage3/font.c | 6 | ||||
-rw-r--r-- | stage3/font.h | 1 | ||||
-rw-r--r-- | stage3/main.c | 4 |
5 files changed, 17 insertions, 2 deletions
@@ -9,3 +9,4 @@ bx_enh_dbg.ini stage3/isr.asm fs.tar stage3/version.c +stage3/font_builtin.c @@ -82,6 +82,11 @@ stage3/version.c: .version-$(GIT_VERSION) stage3/isr.asm: stage3/isr.lua lua stage3/isr.lua > stage3/isr.asm +stage3/font.c: stage3/font_builtin.c + +stage3/font_builtin.c: fs/fonts/ter-u16n.cuddlefont + xxd -i $< > $@ + fs.tar: $(shell find fs | sed 's/ /\\ /g') fs/dbg/kernel.map fs/dbg/kernel.dis.asm cd fs && tar --format=ustar -cf ../fs.tar * @@ -100,7 +105,7 @@ qemu_slow: cuddles.img run: qemu clean: - rm -rf .version-* stage3/*.{o,d} *.bin *.img stage3/{isr.asm,version.c} fs.tar fs/dbg + rm -rf .version-* stage3/*.{o,d} *.bin *.img stage3/{isr.asm,version.c,font_builtin.c} fs.tar fs/dbg flash: cuddles.img dd if=cuddles.img of=$(DEV) diff --git a/stage3/font.c b/stage3/font.c index 31b771e..f47c9c9 100644 --- a/stage3/font.c +++ b/stage3/font.c @@ -3,6 +3,7 @@ #include "gfx.h" #include "heap.h" #include "memory.h" +#include "font_builtin.c" // important: must be a multiple of 2, else code won't work #define TAB_SIZE 4 @@ -40,6 +41,11 @@ void font_load_blob(const void *blob) memcpy(font, blob, 256*16); } +void font_load_builtin() +{ + memcpy(font, fs_fonts_ter_u16n_cuddlefont, 256*16); +} + void font_load_classic() { memset(font, 0, 256 * 16); diff --git a/stage3/font.h b/stage3/font.h index 49b2817..154b58e 100644 --- a/stage3/font.h +++ b/stage3/font.h @@ -7,6 +7,7 @@ void font_init(); void font_set_size(u16 size); void font_load_blob(const void *blob); void font_load_classic(); +void font_load_builtin(); void font_clear_screen(); void print(str line); diff --git a/stage3/main.c b/stage3/main.c index 9f738d5..ac915ff 100644 --- a/stage3/main.c +++ b/stage3/main.c @@ -88,9 +88,11 @@ void kmain() // font init font_init(); font_set_size(1); - font_load_classic(); + font_load_builtin(); font_clear_screen(); + print(S("welcome to cuddles\n")); + // memory map print(S("memory map:\n")); for (usize i = 0; i < n_mreg; i++) { |