diff options
Diffstat (limited to 'src/init')
-rw-r--r-- | src/init/main.c | 6 | ||||
-rw-r--r-- | src/init/syscall.s | 4 |
2 files changed, 7 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; diff --git a/src/init/syscall.s b/src/init/syscall.s index ebd9d0e..86d3523 100644 --- a/src/init/syscall.s +++ b/src/init/syscall.s @@ -2,8 +2,12 @@ .global _syscall .type _syscall, @function _syscall: + mov 4(%esp), %eax + mov 8(%esp), %ebx mov %esp, %ecx mov $_syscall_ret, %edx + mov 12(%esp), %esi + mov 16(%esp), %edi sysenter _syscall_ret: ret |