mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 15:26:43 +00:00
Unhardcode BOOT_RAM_LIMIT, patch via kernel headers.
This commit is contained in:
parent
7a0c9a710c
commit
8fa30a396f
5 changed files with 8 additions and 2 deletions
|
@ -60,6 +60,8 @@ SYS_SMBIOS_ENTRY:: DU64 0;
|
||||||
|
|
||||||
SYS_DISK_UUID:: DU64 0, 0;
|
SYS_DISK_UUID:: DU64 0, 0;
|
||||||
|
|
||||||
|
SYS_BOOT_STACK:: DU32 BOOT_RAM_LIMIT;
|
||||||
|
|
||||||
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE)
|
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE)
|
||||||
|
|
||||||
REQUESTED_SCREEN_WIDTH: DU16 1024;
|
REQUESTED_SCREEN_WIDTH: DU16 1024;
|
||||||
|
|
|
@ -88,6 +88,7 @@ CORE0_32BIT_INIT:: //Entry point for $LK,"BootRAM",A="MN:BootRAM"$.
|
||||||
BTS U32 [SYS_RUN_LEVEL], RLf_32BIT
|
BTS U32 [SYS_RUN_LEVEL], RLf_32BIT
|
||||||
MOV ESI, U32 [SYS_BOOT_PATCH_TABLE_BASE]
|
MOV ESI, U32 [SYS_BOOT_PATCH_TABLE_BASE]
|
||||||
MOV EDI, U32 [MEM_BOOT_BASE]
|
MOV EDI, U32 [MEM_BOOT_BASE]
|
||||||
|
MOV ESP, U32 [SYS_BOOT_STACK]
|
||||||
|
|
||||||
MOV AX, CGDT.ds
|
MOV AX, CGDT.ds
|
||||||
MOV DS, AX
|
MOV DS, AX
|
||||||
|
@ -95,7 +96,6 @@ CORE0_32BIT_INIT:: //Entry point for $LK,"BootRAM",A="MN:BootRAM"$.
|
||||||
MOV FS, AX
|
MOV FS, AX
|
||||||
MOV GS, AX
|
MOV GS, AX
|
||||||
MOV SS, AX
|
MOV SS, AX
|
||||||
MOV ESP, BOOT_RAM_LIMIT //Tmp Stack
|
|
||||||
|
|
||||||
JMP @@02
|
JMP @@02
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ USE64
|
||||||
//************************************
|
//************************************
|
||||||
SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/System/Boot/BootRAM.ZC,SYS_RAM_REBOOT:2"$
|
SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/System/Boot/BootRAM.ZC,SYS_RAM_REBOOT:2"$
|
||||||
PUSH U32 CGDT.ds //stack seg
|
PUSH U32 CGDT.ds //stack seg
|
||||||
PUSH U32 BOOT_RAM_LIMIT //stack
|
PUSH U32 [SYS_BOOT_STACK]//stack
|
||||||
PUSH U32 0 //flags
|
PUSH U32 0 //flags
|
||||||
PUSH U32 CGDT.cs32
|
PUSH U32 CGDT.cs32
|
||||||
LEA RAX, [@@10]
|
LEA RAX, [@@10]
|
||||||
|
|
|
@ -563,6 +563,7 @@ class CKernel
|
||||||
U8 sys_framebuffer_bpp;
|
U8 sys_framebuffer_bpp;
|
||||||
U64 sys_smbios_entry;
|
U64 sys_smbios_entry;
|
||||||
U64 sys_disk_uuid[2];
|
U64 sys_disk_uuid[2];
|
||||||
|
U32 sys_boot_stack;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Run-Levels
|
//Run-Levels
|
||||||
|
|
|
@ -111,6 +111,7 @@ struct CKernel {
|
||||||
uint16_t sys_disk_uuid_b;
|
uint16_t sys_disk_uuid_b;
|
||||||
uint16_t sys_disk_uuid_c;
|
uint16_t sys_disk_uuid_c;
|
||||||
uint8_t sys_disk_uuid_d[8];
|
uint8_t sys_disk_uuid_d[8];
|
||||||
|
uint32_t sys_boot_stack;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
#define BOOT_SRC_RAM 2
|
#define BOOT_SRC_RAM 2
|
||||||
|
@ -266,6 +267,8 @@ void _start(void) {
|
||||||
|
|
||||||
uintptr_t boot_stack = ALIGN_UP(final_address + kernel->size + trampoline_size, 16) + boot_stack_size;
|
uintptr_t boot_stack = ALIGN_UP(final_address + kernel->size + trampoline_size, 16) + boot_stack_size;
|
||||||
|
|
||||||
|
CKernel->sys_boot_stack = boot_stack;
|
||||||
|
|
||||||
memcpy(trampoline_phys, trampoline, trampoline_size);
|
memcpy(trampoline_phys, trampoline, trampoline_size);
|
||||||
memcpy((void *)final_address, CKernel, kernel->size);
|
memcpy((void *)final_address, CKernel, kernel->size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue