commit 52aba32baf37039cefb77a77723c163338902195
parent 2c3931802b72d7c924653b5c624c9043070d838f
Author: Matsuda Kenji <info@mtkn.jp>
Date: Tue, 2 Apr 2024 12:39:16 +0900
print shinonome font
Diffstat:
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/sys/src/kernel/Makefile b/sys/src/kernel/Makefile
@@ -3,7 +3,7 @@ LD = ld
CFLAGS = -I ../../include -nostdlib -fpic -mno-red-zone -Wall -g \
-ffreestanding -fno-builtin
LDFLAGS = -e kernel_main -static
-OBJS = main.o draw.o alloc.o
+OBJS = main.o draw.o alloc.o console.o
all: main.elf
diff --git a/sys/src/kernel/main.c b/sys/src/kernel/main.c
@@ -1,8 +1,7 @@
#include <uefi.h>
#include <libc.h>
#include <draw.h>
-
-uint8 font[16] = {0x0, 0x18, 0x24, 0x42, 0x5a, 0xb5, 0xa5, 0xa5, 0xa5, 0x9a, 0x40, 0x40, 0x22, 0x1c, 0x0, 0x0};
+#include <console.h>
void
kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
@@ -13,15 +12,12 @@ kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
gop->Mode->Info->VerticalResolution,
gop->Mode->Info->PixelsPerScanLine
);
- line(&root_window, (Point) {10, 10}, (Point) {50, 15}, 0xff00ff);
- for (int i = 0; i < 16; i++) {
- for (int j = 0; j < 8; j++) {
- if (((font[i] >> (8 - j - 1)) & 1) == 1) {
- pixel(&root_window, (Point) {j, i}, root_window.fg);
- } else {
- pixel(&root_window, (Point) {j, i}, root_window.bg);
- }
- }
+ for (int i = 0; i < 5000; i++) {
+ put_glyph(&console, i % 128);
}
+ put_glyph(&console, 'a');
+ put_glyph(&console, 'a');
+ put_glyph(&console, 'a');
+ put_glyph(&console, 'a');
for(;;);
}
\ No newline at end of file