summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <sgkadesh@icloud.com>2024-01-27 03:37:48 -0500
committerSimon <sgkadesh@icloud.com>2024-01-27 03:37:48 -0500
commit90c70043be70a557ae55807b7a907133df0b5f02 (patch)
tree34e9103a0808f80935e76e2bb7226245a05cc54a
parentjoe biden (diff)
downloadcorn-90c70043be70a557ae55807b7a907133df0b5f02.tar.gz
corn-90c70043be70a557ae55807b7a907133df0b5f02.tar.bz2
corn-90c70043be70a557ae55807b7a907133df0b5f02.zip
Ununfixed kmain, fixed boot.S
-rw-r--r--src/arch/amd64/boot.S2
-rw-r--r--src/kmain.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/arch/amd64/boot.S b/src/arch/amd64/boot.S
index 9771fe2..36e4bc6 100644
--- a/src/arch/amd64/boot.S
+++ b/src/arch/amd64/boot.S
@@ -116,7 +116,7 @@ start:
bits 64
code64:
call amd64_shim
- push rax
+ mov rdi, rax
call kmain
cli
halt:
diff --git a/src/kmain.c b/src/kmain.c
index b9ceb77..381ceb9 100644
--- a/src/kmain.c
+++ b/src/kmain.c
@@ -1,7 +1,9 @@
-void kmain() {
+#include <lib.h>
+#include <serial.h>
+void kmain(void *info) {
+ char buf[20];
*(char*)0xB8000 = 'c';
*(char*)(0xB8002 + 0x20'0000) = 'd';
- while(1) {
- __asm("cli; hlt");
- }
+ itoa((long)info, buf, 10);
+ serial_out_str(buf);
}