mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +00:00
Remove the obsolete "Userspace" stuff.
This commit is contained in:
parent
42c88b5f2d
commit
5cfeeede7c
4 changed files with 0 additions and 100 deletions
|
@ -13,7 +13,6 @@ KERNEL_OBJS = \
|
||||||
PIC.o \
|
PIC.o \
|
||||||
Syscall.o \
|
Syscall.o \
|
||||||
Disk.o \
|
Disk.o \
|
||||||
Userspace.o \
|
|
||||||
IDEDiskDevice.o \
|
IDEDiskDevice.o \
|
||||||
MemoryManager.o \
|
MemoryManager.o \
|
||||||
Console.o \
|
Console.o \
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
|
|
||||||
}
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "StdLib.h"
|
#include "StdLib.h"
|
||||||
#include "Syscall.h"
|
#include "Syscall.h"
|
||||||
#include "CMOS.h"
|
#include "CMOS.h"
|
||||||
#include "Userspace.h"
|
|
||||||
#include "IDEDiskDevice.h"
|
#include "IDEDiskDevice.h"
|
||||||
#include <VirtualFileSystem/NullDevice.h>
|
#include <VirtualFileSystem/NullDevice.h>
|
||||||
#include <VirtualFileSystem/ZeroDevice.h>
|
#include <VirtualFileSystem/ZeroDevice.h>
|
||||||
|
@ -31,7 +30,6 @@
|
||||||
#define KERNEL_MAP
|
#define KERNEL_MAP
|
||||||
//#define STRESS_TEST_SPAWNING
|
//#define STRESS_TEST_SPAWNING
|
||||||
//#define TEST_ELF_LOADER
|
//#define TEST_ELF_LOADER
|
||||||
//#define TEST_CRASHY_USER_PROCESSES
|
|
||||||
|
|
||||||
system_t system;
|
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() NORETURN;
|
||||||
static void undertaker_main()
|
static void undertaker_main()
|
||||||
{
|
{
|
||||||
|
@ -174,10 +156,6 @@ static void init_stage2()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TEST_CRASHY_USER_PROCESSES
|
|
||||||
new Task(user_main, "user", Task::Ring3);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TEST_ELF_LOADER
|
#ifdef TEST_ELF_LOADER
|
||||||
{
|
{
|
||||||
auto testExecutable = vfs->open("/bin/id");
|
auto testExecutable = vfs->open("/bin/id");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue