mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
Remove the obsolete "Userspace" stuff.
This commit is contained in:
parent
42c88b5f2d
commit
5cfeeede7c
Notes:
sideshowbarker
2024-07-19 18:37:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5cfeeede7cb
4 changed files with 0 additions and 100 deletions
|
@ -13,7 +13,6 @@ KERNEL_OBJS = \
|
|||
PIC.o \
|
||||
Syscall.o \
|
||||
Disk.o \
|
||||
Userspace.o \
|
||||
IDEDiskDevice.o \
|
||||
MemoryManager.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 "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");
|
||||
|
|
Loading…
Reference in a new issue