diff options
Diffstat (limited to 'kernel/shell.c')
| -rw-r--r-- | kernel/shell.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/shell.c b/kernel/shell.c index b377ce0..2e00bd0 100644 --- a/kernel/shell.c +++ b/kernel/shell.c @@ -82,6 +82,42 @@ void shell_execute() { // uint8_t *read= flpydsk_read_sector (10); } + else if(1==strcmp(command,"SYSCALL",0)) + { + + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"system call 10"); + uint32_t ebx; // will hold return value; + // system call + asm("pusha"); + asm("mov $10,%eax"); // select syscall 10 (example_syscall) + asm("mov $666,%edx"); + asm("mov $333,%ecx"); + asm("int $0x80"); // actual syscall ! interrupt + asm("mov %%ebx, %0": "=b" (ebx)); + asm("popa"); + // + + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"system call returned %d",ebx); + + } + else if(1==strcmp(command,"TWO",0)) + { + + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"system call 20"); + uint32_t ebx; // will hold return value; + // system call + asm("pusha"); + asm("mov $20,%eax"); // select syscall2 20 (example_syscall) + asm("mov $566,%edx"); + asm("mov $233,%ecx"); + asm("int $0x80"); // actual syscall ! interrupt + asm("mov %%ebx, %0": "=b" (ebx)); + asm("popa"); + // + + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"system call returned %d",ebx); + + } else { log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"command unknown"); |
