mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-25 22:14:34 +00:00
feat(kernel): update limine
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
0cc4d5096b
commit
c412a75f91
@ -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)
|
||||
|
26
Makefile
26
Makefile
@ -14,7 +14,6 @@ QEMUFLAGS := -display gtk
|
||||
|
||||
ifeq ($(OSARCH), amd64)
|
||||
QEMUFLAGS += -device vmware-svga -M q35 \
|
||||
-monitor pty \
|
||||
-usb \
|
||||
-device qemu-xhci,id=xhci \
|
||||
-net user \
|
||||
@ -41,7 +40,6 @@ QEMUFLAGS += -device vmware-svga -M q35 \
|
||||
-acpitable file=tools/acpi/SSDT1.dat
|
||||
else ifeq ($(OSARCH), i386)
|
||||
QEMUFLAGS += -M q35 \
|
||||
-monitor pty \
|
||||
-usb \
|
||||
-device qemu-xhci,id=xhci \
|
||||
-device usb-mouse,bus=xhci.0,pcap=mousex.pcap \
|
||||
@ -68,7 +66,6 @@ QEMUFLAGS += -M q35 \
|
||||
-acpitable file=tools/acpi/SSDT1.dat
|
||||
else ifeq ($(OSARCH), arm)
|
||||
QEMUFLAGS += -M raspi2b \
|
||||
-monitor pty \
|
||||
-cpu cortex-a15 \
|
||||
-serial file:serial.log \
|
||||
-serial file:COM2.dmp \
|
||||
@ -77,7 +74,6 @@ QEMUFLAGS += -M raspi2b \
|
||||
-kernel $(OSNAME).img
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
QEMUFLAGS += -M raspi4b \
|
||||
-monitor pty \
|
||||
-cpu cortex-a72 \
|
||||
-serial file:serial.log \
|
||||
-serial file:COM2.dmp \
|
||||
@ -260,17 +256,21 @@ endif
|
||||
cp Kernel/fennix.elf rootfs.tar \
|
||||
iso_tmp_data/
|
||||
ifeq ($(BOOTLOADER), limine)
|
||||
cp tools/limine.cfg tools/limine/limine-bios.sys \
|
||||
tools/limine/limine-bios-cd.bin \
|
||||
tools/limine/limine-uefi-cd.bin \
|
||||
iso_tmp_data/
|
||||
cp tools/limine.conf \
|
||||
tools/limine/limine-bios.sys \
|
||||
tools/limine/limine-bios-cd.bin \
|
||||
tools/limine/limine-uefi-cd.bin \
|
||||
iso_tmp_data/
|
||||
mkdir -p iso_tmp_data/EFI/BOOT
|
||||
cp tools/limine/BOOTX64.EFI \
|
||||
cp tools/limine/BOOTAA64.EFI \
|
||||
tools/limine/BOOTIA32.EFI \
|
||||
tools/limine/BOOTLOONGARCH64.EFI \
|
||||
tools/limine/BOOTRISCV64.EFI \
|
||||
tools/limine/BOOTX64.EFI \
|
||||
iso_tmp_data/EFI/BOOT/
|
||||
xorriso -as mkisofs -quiet -b limine-bios-cd.bin \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
--efi-boot limine-uefi-cd.bin -V FENNIX \
|
||||
xorriso -as mkisofs -R -r -J -b limine-bios-cd.bin \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table -hfsplus \
|
||||
-apm-block-size 2048 --efi-boot limine-uefi-cd.bin \
|
||||
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
||||
iso_tmp_data -o $(OSNAME).iso
|
||||
endif
|
||||
@ -332,7 +332,7 @@ QEMU_DBG_MEMORY = -m 2G
|
||||
endif
|
||||
|
||||
clean_logs:
|
||||
rm -f serial.log COM2.dmp COM3.dmp \
|
||||
rm -f serial.log COM2.dmp COM3.dmp COM4.dmp \
|
||||
network.dmp \
|
||||
LPT1.dmp LPT2.dmp LPT3.dmp \
|
||||
mouse.pcap kbd.pcap mousex.pcap kbdx.pcap
|
||||
|
@ -30,7 +30,7 @@ do_tools:
|
||||
|
||||
do_limine:
|
||||
ifeq ("$(wildcard ./limine)", "")
|
||||
git clone https://github.com/limine-bootloader/limine.git --branch=v6.x-branch-binary --depth=1 limine
|
||||
git clone https://github.com/limine-bootloader/limine.git --branch=v9.x-binary --depth=1 limine
|
||||
else
|
||||
$(info > TOOLS: Skipping cloning limine because directory already exists.)
|
||||
endif
|
||||
|
@ -1,12 +0,0 @@
|
||||
TIMEOUT=5
|
||||
INTERFACE_BRANDING=Fennix
|
||||
|
||||
:Fennix (limine)
|
||||
# DO NOT EDIT!
|
||||
COMMENT=Boot Fennix using limine protocol
|
||||
PROTOCOL=limine
|
||||
KERNEL_CMDLINE=--init=/sys/bin/init
|
||||
KERNEL_PATH=boot:///fennix.elf
|
||||
|
||||
MODULE_PATH=boot:///rootfs.tar
|
||||
MODULE_CMDLINE=rootfs
|
Loading…
x
Reference in New Issue
Block a user