Remove the obsolete "Userspace" stuff.

This commit is contained in:
Andreas Kling 2018-10-27 00:41:23 +02:00
parent 42c88b5f2d
commit 5cfeeede7c
4 changed files with 0 additions and 100 deletions

View file

@ -13,7 +13,6 @@ KERNEL_OBJS = \
PIC.o \
Syscall.o \
Disk.o \
Userspace.o \
IDEDiskDevice.o \
MemoryManager.o \
Console.o \

View file

@ -1,60 +0,0 @@
#include "Userspace.h"
#include "Syscall.h"
#include "StdLib.h"
namespace Userspace {
int strlen(const char* str)
{
int len = 0;
while (*(str++))
++len;
return len;
}
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);
}
void yield()
{
DO_SYSCALL_A0(Syscall::Yield);
}
void putch(char ch)
{
DO_SYSCALL_A1(Syscall::PutCharacter, ch);
}
}

View file

@ -1,17 +0,0 @@
#pragma once
#include "types.h"
namespace Userspace {
int open(const char* path);
int close(int fd);
int read(int fd, void* outbuf, size_t nread);
int seek(int fd, int offset);
int kill(pid_t pid, int sig);
uid_t getuid();
void sleep(DWORD ticks);
void yield();
void putch(char);
}

View file

@ -11,7 +11,6 @@
#include "StdLib.h"
#include "Syscall.h"
#include "CMOS.h"
#include "Userspace.h"
#include "IDEDiskDevice.h"
#include <VirtualFileSystem/NullDevice.h>
#include <VirtualFileSystem/ZeroDevice.h>
@ -31,7 +30,6 @@
#define KERNEL_MAP
//#define STRESS_TEST_SPAWNING
//#define TEST_ELF_LOADER
//#define TEST_CRASHY_USER_PROCESSES
system_t system;
@ -98,22 +96,6 @@ static void loadKernelMap(const ByteBuffer& buffer)
}
}
#ifdef TEST_CRASHY_USER_PROCESSES
static void user_main() NORETURN;
static void user_main()
{
DO_SYSCALL_A3(0x3000, 2, 3, 4);
// Crash ourselves!
char* x = reinterpret_cast<char*>(0xbeefbabe);
*x = 1;
HANG;
for (;;) {
// nothing?
Userspace::sleep(1 * TICKS_PER_SECOND);
}
}
#endif
static void undertaker_main() NORETURN;
static void undertaker_main()
{
@ -174,10 +156,6 @@ static void init_stage2()
#endif
#ifdef TEST_CRASHY_USER_PROCESSES
new Task(user_main, "user", Task::Ring3);
#endif
#ifdef TEST_ELF_LOADER
{
auto testExecutable = vfs->open("/bin/id");