diff --git a/build/build-iso.sh b/build/build-iso.sh index f24690b4..4bcb7b2d 100755 --- a/build/build-iso.sh +++ b/build/build-iso.sh @@ -39,7 +39,7 @@ umount_tempdisk() { set -e echo "Building ZealBooter..." -( cd ../zealbooter && make clean all ) +( cd ../zealbooter && make distclean all ) set +e echo "Making temp vdisk, running auto-install ..." diff --git a/src/Kernel/KStart16.ZC b/src/Kernel/KStart16.ZC index 16c6c9e4..1dffdc78 100755 --- a/src/Kernel/KStart16.ZC +++ b/src/Kernel/KStart16.ZC @@ -64,7 +64,10 @@ SYS_BOOT_STACK:: DU32 BOOT_RAM_LIMIT; SYS_IS_UEFI_BOOTED:: DU8 0; -//SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0); +SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0); +// TODO: after placing this here, Ctrl-Alt-Shift-Z to un-zoom the screen +// causes a General Protection at &GrUpdateScreen32+0x89 with +// RAX 0x00E2C4A686A4C2E1, RSI all 0F repeated, and RDI 0x0FF1D3B595B3D1F0 #assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE) @@ -76,8 +79,6 @@ VBE_INFO: DU8 sizeof(CVBEInfo) DUP(0); VBE_FINAL_MODE_NUM: DU16 0; // gets set to final result mode number VBE_STD_MODE_NUM: DU16 0; // gets set to mode number for standard 1024x768 -SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0); - //************************************ CORE0_16BIT_INIT:: //EAX is $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.ZC,[SYS_BOOT_SRC]"$. (Value passed from boot block, $LK,"BootHD",A="FF:::/System/Boot/BootHD.ZC,BOOT_SRC_HARDDRIVE"$, $LK,"BootDVD",A="FF:::/System/Boot/BootDVD.ZC,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/System/Boot/BootRAM.ZC,BOOT_SRC_RAM"$.) diff --git a/src/Kernel/KernelA.HH b/src/Kernel/KernelA.HH index 7a777262..96077af8 100755 --- a/src/Kernel/KernelA.HH +++ b/src/Kernel/KernelA.HH @@ -571,7 +571,7 @@ class CKernel U64 sys_disk_uuid[2]; U32 sys_boot_stack; Bool sys_is_uefi_booted; -// CVideoInfo sys_framebuffer_list[VBE_MODES_NUM]; + CVideoInfo sys_framebuffer_list[VBE_MODES_NUM]; }; //Run-Levels diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index 10368a30..e378a463 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -88,6 +88,13 @@ struct CSysLimitBase { uint8_t *base; } __attribute__((packed)); +struct CVideoInfo { + uint16_t width; + uint16_t height; +} __attribute__((packed)); + +#define VBE_MODES_NUM 32 + struct CKernel { struct CZXE h; uint32_t jmp; @@ -113,6 +120,7 @@ struct CKernel { uint64_t sys_disk_uuid[2]; uint32_t sys_boot_stack; uint8_t sys_is_uefi_booted; + struct CVideoInfo sys_framebuffer_list[VBE_MODES_NUM]; } __attribute__((packed)); #define BOOT_SRC_RAM 2 @@ -190,6 +198,18 @@ void _start(void) { kernel->sys_framebuffer_bpp = fb->bpp; kernel->sys_framebuffer_addr = (uintptr_t)fb->address - hhdm_request.response->offset; + struct limine_video_mode *mode; + for (size_t i = 0, j = 0; i < fb->mode_count && i < VBE_MODES_NUM; i++) + { + mode = fb->modes[i]; + if (mode->bpp == 32) + { + kernel->sys_framebuffer_list[j].height = mode->height; + kernel->sys_framebuffer_list[j].width = mode->width; + j++; + } + } + void *entry_point; // to CORE0_32BIT_INIT for (uint64_t *p = (uint64_t *)kernel; ; p++) { if (*p != 0xaa23c08ed10bd4d7) {