diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-23 10:12:50 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-23 10:12:50 +0200 |
commit | fe237ee215fafd2012e6f4e5da88e3c2b8f9d33d (patch) | |
tree | 9c88982f0717bd2ee465d19ccb967dd1b27de91f /Kernel/Syscall.cpp | |
parent | 72514c8b97891a3a032ae7b3003064ac9cf554e7 (diff) | |
download | serenity-fe237ee215fafd2012e6f4e5da88e3c2b8f9d33d.zip |
Lots of hacking:
- Turn Keyboard into a CharacterDevice (85,1) at /dev/keyboard.
- Implement MM::unmapRegionsForTask() and MM::unmapRegion()
- Save SS correctly on interrupt.
- Add a simple Spawn syscall for launching another process.
- Move a bunch of IO syscall debug output behind DEBUG_IO.
- Have ASSERT do a "cli" immediately when failing.
This makes the output look proper every time.
- Implement a bunch of syscalls in LibC.
- Add a simple shell ("sh"). All it can do now is read a line
of text from /dev/keyboard and then try launching the specified
executable by calling spawn().
There are definitely bugs in here, but we're moving on forward.
Diffstat (limited to 'Kernel/Syscall.cpp')
-rw-r--r-- | Kernel/Syscall.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 7ad1f2507d..4ba373daca 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -22,6 +22,7 @@ asm( " pushw %ss\n" " pushw %ss\n" " pushw %ss\n" + " pushw %ss\n" " popw %ds\n" " popw %es\n" " popw %fs\n" @@ -29,6 +30,7 @@ asm( " mov %esp, syscallRegDump\n" " call syscall_entry\n" " popw %gs\n" + " popw %gs\n" " popw %fs\n" " popw %es\n" " popw %ds\n" @@ -58,15 +60,16 @@ DWORD handle(DWORD function, DWORD arg1, DWORD arg2, DWORD arg3) //kprintf("syscall: sleep(%d)\n", arg1); current->sys$sleep(arg1); break; + case Syscall::Spawn: + return current->sys$spawn((const char*)arg1); case Syscall::PosixOpen: - Task::checkSanity("syscall"); - kprintf("syscall: open('%s', %u)\n", arg1, arg2); + //kprintf("syscall: open('%s', %u)\n", arg1, arg2); return current->sys$open((const char*)arg1, (size_t)arg2); case Syscall::PosixClose: - kprintf("syscall: close(%d)\n", arg1); + //kprintf("syscall: close(%d)\n", arg1); return current->sys$close((int)arg1); case Syscall::PosixRead: - kprintf("syscall: read(%d, %p, %u)\n", arg1, arg2, arg3); + //kprintf("syscall: read(%d, %p, %u)\n", arg1, arg2, arg3); return current->sys$read((int)arg1, (void*)arg2, (size_t)arg3); case Syscall::PosixSeek: // FIXME: This has the wrong signature, should be like lseek() |