commit 310e5dd324e0738ef8b8660f88010cb5582f954d
parent 5cfff507503138a8e774e2fbf99434061cd132c2
Author: Matsuda Kenji <info@mtkn.jp>
Date: Mon, 1 Apr 2024 11:14:07 +0900
add stdint, draw. need malloc
Diffstat:
4 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/kernel/draw.c b/kernel/draw.c
@@ -0,0 +1,9 @@
+#include "draw.h"
+
+Display root_display;
+
+int
+init_root_display(RGBA32 *fb_base, int fb_size, int hrez, int vrez)
+{
+ return 1;
+}
+\ No newline at end of file
diff --git a/kernel/draw.h b/kernel/draw.h
@@ -0,0 +1,23 @@
+typedef unsigned int RGBA32;
+
+typedef struct Display Display;
+
+typedef struct Point {
+ int x, y;
+} Point;
+
+typedef struct Rectangle {
+ Point min; // upper left
+ Point max; // lower right
+} Rectangle;
+
+typedef struct Image {
+ Display *display;
+ Rectangle r;
+} Image;
+
+struct Display {
+ RGBA32 *framebuffer;
+} Display;
+
+int init_root_display(RGBA32 *fb_base, int fb_size, int hrez, int vrez);
+\ No newline at end of file
diff --git a/kernel/main.c b/kernel/main.c
@@ -1,10 +1,6 @@
#include "../uefi/uefi.h"
+#include "stdint.h"
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long int uint64_t;
-
-// Argument order is to interface to the MS-ABI
void
kernel_main(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
{
diff --git a/kernel/stdint.h b/kernel/stdint.h
@@ -0,0 +1,3 @@
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long int uint64_t;