[feat] hankaku print

This commit is contained in:
2026-05-10 18:55:48 +08:00
Unverified
parent 4356f88dfb
commit 4433d2ef85
12 changed files with 348 additions and 22 deletions
+8 -10
View File
@@ -1,6 +1,8 @@
#include <efi.h>
#include <efilib.h>
#include <graphics/context.h>
#include <graphics/draw.h>
#include <fonts/pixel_font.h>
extern "C" void kernel_main() {
EFI_GUID gop_guid = {0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a}};
@@ -9,18 +11,14 @@ extern "C" void kernel_main() {
uefi_call_wrapper((void*)ST->BootServices->SetWatchdogTimer, 4, 0, 0, 0, NULL);
uefi_call_wrapper((void*)ST->BootServices->LocateProtocol, 3, &gop_guid, NULL, (void **)&GOP);
unsigned int hr = GOP->Mode->Info->HorizontalResolution;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) GOP->Mode->FrameBufferBase;
gfx_init(GOP);
uefi_call_wrapper((void*)ST->ConOut->SetCursorPosition, 3, ST->ConOut, 0, 5);
uefi_call_wrapper((void*)ST->ConOut->OutputString, 2, ST->ConOut, L"Kernel is running!\n");
for (unsigned int i = 1; i <= 100; i++) {
// uefi_call_wrapper((void*)ST->ConOut->SetCursorPosition, 3, ST->ConOut, 0, i + 6);
// uefi_call_wrapper((void*)ST->ConOut->OutputString, 2, ST->ConOut, L"hello!");
for (unsigned int j = 1; j <= 100; j++) {
draw_pixel(i, j, {255, 255, 255, 255}, GOP, hr, base);
}
}
uefi_call_wrapper((void*)ST->ConOut->ClearScreen, 1, ST->ConOut);
// pf_print_char('k', 10, 10);
pf_print("Welcome to Sylva OS!", 10, 10);
while (1);
}