Add a print_char system call

This commit is contained in:
Baptiste Wicht 2014-01-18 18:07:30 +01:00
parent 19b68b7e9f
commit d7378376e6
2 changed files with 20 additions and 2 deletions

View File

@ -8,8 +8,26 @@
#include "system_calls.hpp"
#include "console.hpp"
namespace {
void sc_print_char(const interrupt::syscall_regs& regs){
k_print(static_cast<char>(regs.rbx));
}
} //End of anonymous namespace
void system_call_entry(const interrupt::syscall_regs& regs){
k_print_line("system_call");
auto code = regs.rax;
switch(code){
case 0:
sc_print_char(regs);
break;
default:
k_print_line("Invalid system call");
break;
}
}
void install_system_calls(){

View File

@ -6,7 +6,7 @@
//=======================================================================
int main(){
asm volatile("int 50");
asm volatile("mov rax, 0; mov rbx, 0x41; int 50" : : : "rax", "rbx");
return 1;
}