summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.c3fmt2
-rw-r--r--main.c315
2 files changed, 15 insertions, 2 deletions
diff --git a/.c3fmt b/.c3fmt
new file mode 100644
index 0000000..d84959f
--- /dev/null
+++ b/.c3fmt
@@ -0,0 +1,2 @@
+newline_at_eof: true
+max_line_length: 132
diff --git a/main.c3 b/main.c3
index 13620ee..286b4fe 100644
--- a/main.c3
+++ b/main.c3
@@ -18,15 +18,26 @@ module c3os;
import uefi;
+EfiHandle eh;
+SystemTable* st;
+
fn EfiStatus efi_main(EfiHandle image_handle, SystemTable* system_table) @export("efi_main")
{
+ eh = image_handle;
+ st = system_table;
+
+ st.conOut.@output_string("Hello World!\n");
+
+ spin();
return SUCCESS;
}
alias PanicFn = fn void(String message, String file, String function, int line);
PanicFn panicfn = &_panicfn;
-fn void _panicfn(String reason, String file = "", String func = "", int line = 0)
+fn void _panicfn(String reason, String file = "", String func = "", int line = 0) => spin();
+
+fn void spin()
{
asm("cli");
asm("hlt");
-} \ No newline at end of file
+}