Made syscall ids 64 bits in rax

This commit is contained in:
Justin C. Miller
2018-09-07 10:28:13 -07:00
parent cabfec3f1e
commit 3a39d9440a
3 changed files with 7 additions and 7 deletions

View File

@@ -2,9 +2,9 @@ global _start
_start: _start:
xor rbp, rbp ; Sentinel rbp xor rbp, rbp ; Sentinel rbp
mov rdi, 0 ; DEBUG syscall
.loop: .loop:
mov rax, 0 ; DEBUG syscall
syscall syscall
jmp .loop jmp .loop

View File

@@ -303,12 +303,9 @@ addr_t
syscall_handler(addr_t return_rsp, cpu_state regs) syscall_handler(addr_t return_rsp, cpu_state regs)
{ {
console *cons = console::get(); console *cons = console::get();
syscall call = static_cast<syscall>(regs.rdi & 0xffff); syscall call = static_cast<syscall>(regs.rax);
switch (call) { switch (call) {
case syscall::message:
break;
case syscall::debug: case syscall::debug:
cons->set_color(11); cons->set_color(11);
cons->printf("\nReceived DEBUG syscall\n"); cons->printf("\nReceived DEBUG syscall\n");
@@ -316,6 +313,9 @@ syscall_handler(addr_t return_rsp, cpu_state regs)
print_regs(regs); print_regs(regs);
break; break;
case syscall::message:
break;
default: default:
cons->set_color(9); cons->set_color(9);
cons->printf("\nReceived unknown syscall: %02x\n", call); cons->printf("\nReceived unknown syscall: %02x\n", call);

View File

@@ -1,6 +1,6 @@
#pragma once #pragma once
enum class syscall : uint16_t enum class syscall : uint64_t
{ {
debug, debug,
message, message,