mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-01 02:19:15 +00:00
feat(kernel): update limine
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
@ -25,33 +25,41 @@
|
||||
|
||||
void InitLimine();
|
||||
|
||||
static volatile struct limine_entry_point_request EntryPointRequest = {
|
||||
#define LIMREQ __attribute__((used, section(".limine_requests"))) static volatile
|
||||
#define LIMREQ_S __attribute__((used, section(".limine_requests_start"))) static volatile
|
||||
#define LIMREQ_E __attribute__((used, section(".limine_requests_end"))) static volatile
|
||||
|
||||
LIMREQ LIMINE_BASE_REVISION(3);
|
||||
LIMREQ_S LIMINE_REQUESTS_START_MARKER;
|
||||
LIMREQ_E LIMINE_REQUESTS_END_MARKER;
|
||||
|
||||
LIMREQ struct limine_entry_point_request EntryPointRequest = {
|
||||
.id = LIMINE_ENTRY_POINT_REQUEST,
|
||||
.revision = 0,
|
||||
.response = NULL,
|
||||
.entry = InitLimine};
|
||||
static volatile struct limine_bootloader_info_request BootloaderInfoRequest = {
|
||||
LIMREQ struct limine_bootloader_info_request BootloaderInfoRequest = {
|
||||
.id = LIMINE_BOOTLOADER_INFO_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_framebuffer_request FramebufferRequest = {
|
||||
LIMREQ struct limine_framebuffer_request FramebufferRequest = {
|
||||
.id = LIMINE_FRAMEBUFFER_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_memmap_request MemmapRequest = {
|
||||
LIMREQ struct limine_memmap_request MemmapRequest = {
|
||||
.id = LIMINE_MEMMAP_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_kernel_address_request KernelAddressRequest = {
|
||||
LIMREQ struct limine_kernel_address_request KernelAddressRequest = {
|
||||
.id = LIMINE_KERNEL_ADDRESS_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_rsdp_request RsdpRequest = {
|
||||
LIMREQ struct limine_rsdp_request RsdpRequest = {
|
||||
.id = LIMINE_RSDP_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_kernel_file_request KernelFileRequest = {
|
||||
LIMREQ struct limine_kernel_file_request KernelFileRequest = {
|
||||
.id = LIMINE_KERNEL_FILE_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_module_request ModuleRequest = {
|
||||
LIMREQ struct limine_module_request ModuleRequest = {
|
||||
.id = LIMINE_MODULE_REQUEST,
|
||||
.revision = 0};
|
||||
static volatile struct limine_smbios_request SmbiosRequest = {
|
||||
LIMREQ struct limine_smbios_request SmbiosRequest = {
|
||||
.id = LIMINE_SMBIOS_REQUEST,
|
||||
.revision = 0};
|
||||
|
||||
|
@ -46,9 +46,17 @@ SECTIONS
|
||||
*(.bootstrap .bootstrap.*)
|
||||
} :bootstrap
|
||||
_bootstrap_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||
|
||||
. += KERNEL_VMA;
|
||||
|
||||
/* . += KERNEL_VMA;
|
||||
_bootstrap_start = .;
|
||||
.limine_requests : {
|
||||
KEEP(*(.limine_requests_start))
|
||||
KEEP(*(.limine_requests))
|
||||
KEEP(*(.limine_requests_end))
|
||||
} :bootstrap
|
||||
_bootstrap_end = ALIGN(CONSTANT(MAXPAGESIZE)); */
|
||||
|
||||
_kernel_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||
_kernel_text_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||
.text ALIGN(CONSTANT(MAXPAGESIZE)) : AT(ADDR(.text) - KERNEL_VMA)
|
||||
|
@ -267,22 +267,14 @@ extern CallPtr __fini_array_start[0], __fini_array_end[0];
|
||||
|
||||
EXTERNC __no_stack_protector NIF cold void Entry(BootInfo *Info)
|
||||
{
|
||||
trace("Hello, World!");
|
||||
|
||||
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0)
|
||||
{
|
||||
info("\n\n----------------------------------------\nDEBUGGER DETECTED\n----------------------------------------\n\n");
|
||||
DebuggerIsAttached = true;
|
||||
}
|
||||
|
||||
memcpy(&bInfo, Info, sizeof(BootInfo));
|
||||
debug("BootInfo structure is at %p", &bInfo);
|
||||
|
||||
// https://wiki.osdev.org/Calling_Global_Constructors
|
||||
trace("There are %d constructors to call",
|
||||
__init_array_end - __init_array_start);
|
||||
for (CallPtr *fct = __init_array_start; fct != __init_array_end; fct++)
|
||||
(*fct)();
|
||||
trace("Total constructors called: %d", __init_array_end - __init_array_start);
|
||||
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0)
|
||||
DebuggerIsAttached = true;
|
||||
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
if (!bInfo.SMBIOSPtr)
|
||||
|
Reference in New Issue
Block a user