1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:55:08 +00:00

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.
This commit is contained in:
Andreas Kling 2018-10-23 10:12:50 +02:00
parent 72514c8b97
commit fe237ee215
29 changed files with 276 additions and 32 deletions

View file

@ -99,13 +99,12 @@ static void init_stage2()
{
kprintf("init stage2...\n");
// Anything that registers interrupts goes *after* PIC and IDT for obvious reasons.
Syscall::initialize();
auto keyboard = make<Keyboard>();
extern void panel_main();
new Task(panel_main, "panel", IPC::Handle::PanelTask, Task::Ring0);
//new Task(led_disco, "led-disco", IPC::Handle::Any, Task::Ring0);
Disk::initialize();
@ -125,6 +124,8 @@ static void init_stage2()
auto dev_random = make<RandomDevice>();
vfs->registerCharacterDevice(1, 8, *dev_random);
vfs->registerCharacterDevice(85, 1, *keyboard);
auto dev_hd0 = IDEDiskDevice::create();
auto e2fs = Ext2FileSystem::create(dev_hd0.copyRef());
e2fs->initialize();
@ -167,7 +168,9 @@ static void init_stage2()
}
#endif
auto* idTask = Task::create("/bin/id", (uid_t)209, (gid_t)1985);
//auto* idTask = Task::create("/bin/id", (uid_t)209, (gid_t)1985);
auto* shTask = Task::create("/bin/sh", (uid_t)100, (gid_t)100);
//new Task(motd_main, "motd", IPC::Handle::MotdTask, Task::Ring0);
//new Task(syscall_test_main, "syscall_test", IPC::Handle::MotdTask, Task::Ring3);
@ -206,8 +209,6 @@ void init()
VirtualFileSystem::initializeGlobals();
StringImpl::initializeGlobals();
auto keyboard = make<Keyboard>();
PIT::initialize();
memset(&system, 0, sizeof(system));