1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:07:44 +00:00

Import the "gerbert" kernel I worked on earlier this year.

It's a lot crappier than I remembered it. It's gonna need a lot of work.
This commit is contained in:
Andreas Kling 2018-10-16 11:01:38 +02:00
parent f608629704
commit 9396108034
55 changed files with 4600 additions and 0 deletions

42
Kernel/Userspace.cpp Normal file
View file

@ -0,0 +1,42 @@
#include "Userspace.h"
#include "Syscall.h"
#include "StdLib.h"
namespace Userspace {
int open(const char* path)
{
return DO_SYSCALL_A2(Syscall::PosixOpen, path, strlen(path));
}
int close(int fd)
{
return DO_SYSCALL_A1(Syscall::PosixClose, fd);
}
int read(int fd, void* outbuf, size_t nread)
{
return DO_SYSCALL_A3(Syscall::PosixRead, fd, outbuf, nread);
}
int seek(int fd, int offset)
{
return DO_SYSCALL_A2(Syscall::PosixRead, fd, offset);
}
int kill(pid_t pid, int sig)
{
return DO_SYSCALL_A2(Syscall::PosixKill, pid, sig);
}
uid_t getuid()
{
return DO_SYSCALL_A0(Syscall::PosixGetuid);
}
void sleep(DWORD ticks)
{
DO_SYSCALL_A1(Syscall::Sleep, ticks);
}
}