commit 331c1f284ba77046dc4d7ffb869a9f87405247a4 parent 5623211d35ff4d663e6b36305fdc6f0ba59f4b64 Author: Matsuda Kenji <info@mtkn.jp> Date: Mon, 1 Apr 2024 16:07:30 +0900 change header Diffstat:
A | sys/include/libc.h | | | 13 | +++++++++++++ |
D | sys/include/stdint.h | | | 3 | --- |
M | sys/src/kernel/main.c | | | 14 | +++++++------- |
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/sys/include/libc.h b/sys/include/libc.h @@ -0,0 +1,12 @@ +typedef unsigned char uint8; +typedef unsigned int uint32; +typedef unsigned long long int uint64; +typedef unsigned long long int uintptr; + +typedef struct Memmap { + +} Memmap; + +extern Memmap memmap[]; + +void *malloc(uintptr); +\ No newline at end of file diff --git a/sys/include/stdint.h b/sys/include/stdint.h @@ -1,3 +0,0 @@ -typedef unsigned char uint8_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; diff --git a/sys/src/kernel/main.c b/sys/src/kernel/main.c @@ -1,15 +1,15 @@ #include <uefi.h> -#include <stdint.h> +#include <libc.h> void kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) { - uint32_t *fb_base = (uint32_t *)gop->Mode->FrameBufferBase; - uint32_t hrez = gop->Mode->Info->HorizontalResolution; - uint32_t vrez = gop->Mode->Info->VerticalResolution; - uint32_t sl = gop->Mode->Info->PixelsPerScanLine; - uint32_t cx = hrez / 2; - uint32_t cy = vrez / 2; + uint32 *fb_base = (uint32 *)gop->Mode->FrameBufferBase; + uint32 hrez = gop->Mode->Info->HorizontalResolution; + uint32 vrez = gop->Mode->Info->VerticalResolution; + uint32 sl = gop->Mode->Info->PixelsPerScanLine; + uint32 cx = hrez / 2; + uint32 cy = vrez / 2; for (int i = 0; i < vrez; i++) { for (int j = 0; j < hrez; j++) { if ((cx-j)*(cx-j) + (cy-i)*(cy-i) < (vrez/3) * (vrez/3)) {