diff --git a/idt.inc b/idt.inc index 77fe552..fd7a8f9 100644 --- a/idt.inc +++ b/idt.inc @@ -67,6 +67,9 @@ isr_label 48 isr_label 49 isr_main: + cmp eax, 0x30 + jz isr_syscall + pusha push ds push es @@ -85,6 +88,21 @@ isr_main: iret +isr_syscall: + pop eax ;syscall function number + pusha + push ds + push es + + push ebx + call _putc + + pop es + pop ds + popa + iret + + diff --git a/kernel.c b/kernel.c index f4added..a5237f0 100644 --- a/kernel.c +++ b/kernel.c @@ -82,6 +82,20 @@ void k_init() printf("Memory available to OS: %u MB (%u bytes)\n", mm_megabytes, mm_totalmem); printf("Free memory: %u bytes (%u pages)\n", mm_freemem(), mm_freemem()>>12); printf("Root Directory: %s/\n", rootDevice->id); + + +// int a; +// byte *addr = 0; +// for (a = 0; a < 2; a++) +// { +// byte *app = mm_palloc(); +// vmm_map1((dword)addr, (dword)app); +// addr += 4096; +// } + +// addr = vfs_readFile("/bin/hash.hos"); +// memcpy(0, addr, 8192); +// asm("call 0"); dword key = 0;