mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
Add a simple ELF binary called _test.o to the test fs.
This commit is contained in:
parent
f67d695254
commit
5b10846bed
Notes:
sideshowbarker
2024-07-19 18:46:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5b10846bed5
@ -4,6 +4,14 @@
|
||||
|
||||
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));
|
||||
|
Binary file not shown.
12
Kernel/_test.cpp
Normal file
12
Kernel/_test.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "Userspace.cpp"
|
||||
|
||||
using namespace Userspace;
|
||||
|
||||
int elf_entry()
|
||||
{
|
||||
int fd = open("/Banner.txt");
|
||||
char buf[2048];
|
||||
int nread = read(fd, buf, sizeof(buf));
|
||||
buf[nread] = '\0';
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user