summaryrefslogtreecommitdiff
path: root/src/user/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/bootstrap')
-rw-r--r--src/user/bootstrap/linker.ld2
-rw-r--r--src/user/bootstrap/main.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/user/bootstrap/linker.ld b/src/user/bootstrap/linker.ld
index f2d718f..34d8101 100644
--- a/src/user/bootstrap/linker.ld
+++ b/src/user/bootstrap/linker.ld
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("binary")
SECTIONS
{
- . = 0x10000;
+ . = 0x20000;
_bss_start = .;
.bss BLOCK(4K) : ALIGN(4K)
{
diff --git a/src/user/bootstrap/main.c b/src/user/bootstrap/main.c
index f145e74..577f1d8 100644
--- a/src/user/bootstrap/main.c
+++ b/src/user/bootstrap/main.c
@@ -1,3 +1,4 @@
+#include <_proc.h>
#include <camellia/flags.h>
#include <camellia/syscalls.h>
#include <stdio.h>
@@ -13,6 +14,10 @@ extern char _initrd;
__attribute__((section(".text")))
_Noreturn void main(void) {
+ _syscall_memflag(_libc_psdata, 1, MEMFLAG_PRESENT);
+ setprogname("bootstrap");
+ setproctitle(NULL);
+
/* move everything provided by the kernel to /kdev */
MOUNT_AT("/kdev/") { fs_passthru(NULL); }
MOUNT_AT("/") {
@@ -26,10 +31,11 @@ _Noreturn void main(void) {
MOUNT_AT("/init/") { tar_driver(&_initrd); }
const char *initpath = "bin/amd64/init";
+ char *initargv[] = {"init", NULL};
void *init = tar_find(initpath, strlen(initpath), &_initrd, ~0) + 512;
if (init) {
_klogf("execing init");
- elf_exec(init, NULL, NULL);
+ elf_exec(init, initargv, NULL);
_klogf("elf_exec failed");
} else {
_klogf("couldn't find init.elf");