summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
authordzwdz2021-07-21 21:35:20 +0200
committerdzwdz2021-07-21 21:35:20 +0200
commit8a168f2be5d90f972975abf0b40145a75c0231b7 (patch)
treecdfcd84a132a6a9864b01b626cc670e9caf7c4ef /src/init/main.c
parent36089d20ca1f7c57f36c4172759a5084bdf87a3a (diff)
syscall parameter & return value passing
Sadly, sysenter on i386 limits me to only 4 arguments (so, 1 for the syscall id + 3 real args). If that turns out to be an issue I'll either just switch to interrupts, or switch to x64.
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/init/main.c b/src/init/main.c
index cb3fa1d..6c4ccc3 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -1,15 +1,15 @@
#include <stdint.h>
-void _syscall();
+int _syscall(int, int, int, int);
int main() {
- _syscall();
+ uint8_t color = _syscall(1, 2, 3, 4);
// 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] = 0x4e;
+ vga[(i << 1) + 1] = color;
// try to mess with kernel memory
uint8_t *kernel = (void*) 0x100000;