summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
authordzwdz2021-07-22 19:11:42 +0200
committerdzwdz2021-07-22 19:11:42 +0200
commit4823f92f9d3feabdc758d8cd6eef855de90fee2a (patch)
tree374c065807f422818d79b35c33082df3d00b461d /src/init/main.c
parent8a168f2be5d90f972975abf0b40145a75c0231b7 (diff)
implement the debuglog() syscall
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 6c4ccc3..fda68b7 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -1,15 +1,23 @@
+#include <kernel/syscalls.h>
+#include <stddef.h>
#include <stdint.h>
int _syscall(int, int, int, int);
+int debuglog(const char *msg, size_t len) {
+ return _syscall(SC_DEBUGLOG, (void*)msg, len, 0);
+}
+
+
int main() {
- uint8_t color = _syscall(1, 2, 3, 4);
+ debuglog("hello from init! ",
+ sizeof("hello from init! ") - 1);
// change the colors of VGA text
// doesn't require a lot of code, but still shows that it's working
uint8_t *vga = (void*) 0xB8000;
for (int i = 0; i < 80 * 25; i++)
- vga[(i << 1) + 1] = color;
+ vga[(i << 1) + 1] = 0x4e;
// try to mess with kernel memory
uint8_t *kernel = (void*) 0x100000;