Limine modules request, run with 1GB pages support for x86_64
This commit is contained in:
23
Makefile
23
Makefile
@ -23,25 +23,26 @@ clean:
|
|||||||
rm -f mop2.iso base.img
|
rm -f mop2.iso base.img
|
||||||
|
|
||||||
base:
|
base:
|
||||||
dd if=/dev/zero of=base.img bs=1M count=32
|
dd if=/dev/zero of=base.img bs=1M count=10
|
||||||
mformat -F -i base.img ::
|
mformat -F -i base.img ::
|
||||||
mcopy -i base.img Makefile ::
|
mcopy -i base.img Makefile ::
|
||||||
mdir -i base.img ::
|
mdir -i base.img ::
|
||||||
|
|
||||||
iso:
|
iso:
|
||||||
rm -rf iso_root
|
@rm -rf iso_root
|
||||||
mkdir -p iso_root/boot
|
@mkdir -p iso_root/boot
|
||||||
cp -v kernel/mop2 iso_root/boot
|
@cp -v kernel/mop2 iso_root/boot
|
||||||
mkdir -p iso_root/boot/limine
|
@cp -v base.img iso_root
|
||||||
cp -v limine.conf limine/limine-bios.sys limine/limine-bios-cd.bin \
|
@mkdir -p iso_root/boot/limine
|
||||||
|
@cp -v limine.conf limine/limine-bios.sys limine/limine-bios-cd.bin \
|
||||||
limine/limine-uefi-cd.bin iso_root/boot/limine
|
limine/limine-uefi-cd.bin iso_root/boot/limine
|
||||||
mkdir -p iso_root/EFI/BOOT
|
@mkdir -p iso_root/EFI/BOOT
|
||||||
cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT
|
@cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT
|
||||||
cp -v limine/BOOTIA32.EFI iso_root/EFI/BOOT
|
@cp -v limine/BOOTIA32.EFI iso_root/EFI/BOOT
|
||||||
xorriso -as mkisofs -R -r -J -b boot/limine/limine-bios-cd.bin \
|
@xorriso -as mkisofs -R -r -J -b boot/limine/limine-bios-cd.bin \
|
||||||
-no-emul-boot -boot-load-size 4 -boot-info-table -hfsplus \
|
-no-emul-boot -boot-load-size 4 -boot-info-table -hfsplus \
|
||||||
-apm-block-size 2048 --efi-boot boot/limine/limine-uefi-cd.bin \
|
-apm-block-size 2048 --efi-boot boot/limine/limine-uefi-cd.bin \
|
||||||
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
||||||
iso_root -o mop2.iso
|
iso_root -o mop2.iso
|
||||||
./limine/limine bios-install mop2.iso
|
@./limine/limine bios-install mop2.iso
|
||||||
|
|
||||||
|
@ -40,12 +40,19 @@ static volatile struct limine_framebuffer_request FB_REQ = {
|
|||||||
.id = LIMINE_FRAMEBUFFER_REQUEST, .revision = 0,
|
.id = LIMINE_FRAMEBUFFER_REQUEST, .revision = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static volatile struct limine_module_request MODULE_REQ = {
|
||||||
|
.id = LIMINE_MODULE_REQUEST, .revision = 0,
|
||||||
|
};
|
||||||
|
|
||||||
void bootinfo_init(void) {
|
void bootinfo_init(void) {
|
||||||
if (FB_REQ.response == NULL || FB_REQ.response->framebuffer_count < 1) {
|
if (FB_REQ.response == NULL || FB_REQ.response->framebuffer_count < 1) {
|
||||||
hal_hang();
|
hal_hang();
|
||||||
}
|
}
|
||||||
BOOT_INFO.fb = FB_REQ.response->framebuffers[0];
|
BOOT_INFO.fb = FB_REQ.response->framebuffers[0];
|
||||||
|
|
||||||
|
struct limine_module_response *modulesres= MODULE_REQ.response;
|
||||||
|
BOOT_INFO.modules = modulesres;
|
||||||
|
|
||||||
struct limine_paging_mode_response *pagingres = PAGING_REQ.response;
|
struct limine_paging_mode_response *pagingres = PAGING_REQ.response;
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
if (pagingres->mode != LIMINE_PAGING_MODE_X86_64_4LVL) {
|
if (pagingres->mode != LIMINE_PAGING_MODE_X86_64_4LVL) {
|
||||||
|
@ -22,6 +22,7 @@ typedef struct {
|
|||||||
LIMINE_PTR(struct limine_smp_response *) smp;
|
LIMINE_PTR(struct limine_smp_response *) smp;
|
||||||
uint64_t smp_bspindex;
|
uint64_t smp_bspindex;
|
||||||
LIMINE_PTR(struct limine_framebuffer *) fb;
|
LIMINE_PTR(struct limine_framebuffer *) fb;
|
||||||
|
LIMINE_PTR(struct limine_module_response *) modules;
|
||||||
} BootInfo;
|
} BootInfo;
|
||||||
|
|
||||||
extern BootInfo BOOT_INFO;
|
extern BootInfo BOOT_INFO;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
qemu-system-x86_64 -m 4g -cdrom mop2.iso -boot d -serial stdio $@
|
set -x
|
||||||
|
|
||||||
|
qemu-system-x86_64 -cpu qemu64,+pdpe1gb -m 4G -cdrom mop2.iso -boot d -serial stdio $@
|
||||||
|
Reference in New Issue
Block a user