kornos/kernel/src/arch/x86_64/entry-stivale2.c

30 lines
749 B
C

#include <limine/stivale/stivale2.h>
#include <stdint.h>
#include <stddef.h>
#include "../../main.h"
static uint8_t stack[4096] = {0};
void stivale2_main(struct stivale2_struct *info);
struct stivale2_header_tag_smp smp_request = {
.tag = {
.identifier = STIVALE2_HEADER_TAG_SMP_ID,
.next = 0
},
.flags = 0
};
__attribute__((section(".stivale2hdr"), used))
struct stivale2_header header2 = {
.entry_point = (uint64_t)stivale2_main,
.stack = (uintptr_t)stack + sizeof(stack),
.flags = 0,
.tags = (uint64_t)&smp_request
};
void stivale2_main(struct stivale2_struct *info) {
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
kmain(3, argv);
}