summaryrefslogtreecommitdiffstats
path: root/apps/init/stage1/main.c
blob: 90e663d1998c537cd4098524230075182971d2b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "stage1.h"
#include "kprint.h"
#include <kernel/init.h>

uint8_t *_syscall_payload;
uint8_t  _syscall_message;

void main(void *init_message_ptr)
{
    _syscall_payload = init_message_ptr;
    _syscall_message = INIT_OBJECT_MESSAGE;

    kputs("Hello, Userland!\n");
    for(;;);
}

__attribute__((naked))
void
_start(void)
{
    __asm__ volatile("\
            popq %rdi; \
            jmp main");
}