mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 07:20:32 +00:00
Implement half-functional prototype Limine bootloader MBR install script.
This commit is contained in:
parent
2bb8ef846e
commit
7e8ed65677
1 changed files with 27 additions and 0 deletions
27
src/Home/LimineHDD.ZC
Executable file
27
src/Home/LimineHDD.ZC
Executable file
|
@ -0,0 +1,27 @@
|
|||
|
||||
#include "/Boot/Limine-HDD.HH"
|
||||
|
||||
class CLimineStage2Header
|
||||
{
|
||||
U16 size_a;
|
||||
U16 size_b;
|
||||
U64 location_a;
|
||||
U64 location_b;
|
||||
};
|
||||
|
||||
U8 *limine = binary_limine_hdd_bin_data;
|
||||
U16 limine_size = sizeof(binary_limine_hdd_bin_data);
|
||||
CLimineStage2Header *limine_stage2 = limine + 0x1A4;
|
||||
|
||||
U16 limine_stage2_size = limine_size - BLK_SIZE;
|
||||
U16 limine_stage2_size_aligned = limine_stage2_size + ((BLK_SIZE * 2) - limine_stage2_size % (BLK_SIZE * 2));
|
||||
|
||||
limine_stage2->size_a = limine_stage2->size_b = limine_stage2_size_aligned / 2;
|
||||
limine_stage2->location_a = BLK_SIZE;
|
||||
limine_stage2->location_b = BLK_SIZE + limine_stage2->size_a;
|
||||
|
||||
ClassRep(limine_stage2);
|
||||
|
||||
CBlkDev *bd = Letter2BlkDev('c');
|
||||
|
||||
AHCIAtaBlksWrite(bd, limine, 0, BLK_SIZE + limine_stage2_size_aligned);
|
Loading…
Reference in a new issue