mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Implement old MBR saving in LimineMHDIns.
This commit is contained in:
parent
f02a3c844f
commit
572c36509b
1 changed files with 3 additions and 1 deletions
|
@ -100,9 +100,11 @@ Bool LimineMHDIns(U8 drv_let)
|
|||
BlkDevLock(bd);
|
||||
|
||||
AHCIAtaBlksRead(bd, &old_mbr, 0, 1); // read old MBR currently on disk
|
||||
|
||||
MemCopy(new_mbr->p, old_mbr.p, sizeof(CMasterBoot.p)); // copy old MBR partition table to new Limine MBR
|
||||
|
||||
// read the whole MBR + post-MBR-gap that Limine wants to overwrite, save all of that as an OldMBR.BIN
|
||||
BootMHDOldRead(drv_let, drv_let, 1 + (limine_stage2_size_aligned / BLK_SIZE));
|
||||
|
||||
AHCIAtaBlksWrite(bd, limine, 0, 1 + (limine_stage2_size_aligned / BLK_SIZE)); // write Limine to MBR and post-MBR gap
|
||||
|
||||
BlkDevUnlock(bd);
|
||||
|
|
Loading…
Reference in a new issue