diff options
author | 3gg <3gg@shellblade.net> | 2025-05-24 17:04:18 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-05-24 17:04:18 -0700 |
commit | 079cd940e727c1705e9f1b30706b9531d5aedda6 (patch) | |
tree | 25cb0748e1365679f5898f3437039af506cdb08e /src/kernel.c | |
parent | a8a39ba24e36119dce48a01c2139e0e5a25674e1 (diff) |
Diffstat (limited to 'src/kernel.c')
-rw-r--r-- | src/kernel.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kernel.c b/src/kernel.c index 4296aa7..ac803cc 100644 --- a/src/kernel.c +++ b/src/kernel.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <framebuffer.h> | ||
1 | #include <mailbox.h> | 2 | #include <mailbox.h> |
2 | #include <mmio.h> | 3 | #include <mmio.h> |
3 | #include <raspi.h> | 4 | #include <raspi.h> |
@@ -10,14 +11,26 @@ static void halt() { | |||
10 | } | 11 | } |
11 | 12 | ||
12 | void main() { | 13 | void main() { |
14 | bool success = true; | ||
15 | uint32_t error = -1; | ||
16 | |||
13 | const int raspi = raspi_init(); | 17 | const int raspi = raspi_init(); |
14 | mmio_init(raspi); // Must be initialized before other peripherals. | 18 | mmio_init(raspi); // Must be initialized before other peripherals. |
15 | 19 | ||
16 | mbox_init(); | 20 | mbox_init(); |
17 | uart_init(raspi); | 21 | uart_init(raspi); |
22 | success = framebuffer_init(&error); | ||
23 | if (!success) { | ||
24 | uart_print("Failed to initialize framebuffer\n"); | ||
25 | if (error == MAILBOX_DELIVERY_ERROR) { | ||
26 | uart_print("MAILBOX_DELIVERY_ERROR\n"); | ||
27 | } | ||
28 | goto end; | ||
29 | } | ||
18 | 30 | ||
19 | uart_print("Hello world!\n"); | 31 | uart_print("Hello world!\n"); |
20 | 32 | ||
33 | end: | ||
21 | halt(); | 34 | halt(); |
22 | } | 35 | } |
23 | 36 | ||