Begin integrating Limine framebuffer mode info list into ZealBooter to pass abstracted mode information to CKernel header.

This commit is contained in:
TomAwezome 2022-10-14 22:01:34 -04:00
parent a2be44fa28
commit 2c2dc1141d
4 changed files with 26 additions and 5 deletions

View file

@ -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 ..."

View file

@ -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"$.)

View file

@ -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

View file

@ -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) {