summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-26 20:42:54 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-26 20:42:54 +0200
commitd10241467cc3f77988927a48a4384f63297465dd (patch)
tree53ad5822367ce5b53ec03220a0b9839936d1f93e /Private/NewBoot
parent3210d2e3f38a73090bcdbdd68623c676868529ce (diff)
MHR-18: Test and improve filesystem.
- Disk driver for PIO divide by sector size by default. - Breaking changes in NewFS as well, no more mess in forks! Either a data or resource fork. - Also implemented disk size and sector count better for disk drivers as a mandatory function. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot')
-rw-r--r--Private/NewBoot/BootKit/BootKit.hxx11
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx2
2 files changed, 9 insertions, 4 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx
index e2e371dd..26c6c755 100644
--- a/Private/NewBoot/BootKit/BootKit.hxx
+++ b/Private/NewBoot/BootKit/BootKit.hxx
@@ -268,8 +268,11 @@ private:
catalogKind->Kind = blob->fKind;
/// Allocate fork for blob.
- catalogKind->FirstFork = (startLba + sizeof(NewCatalog));
- catalogKind->LastFork = catalogKind->FirstFork;
+ if (catalogKind->Kind == kNewFSDataForkKind) {
+ catalogKind->DataFork = (startLba + sizeof(NewCatalog));
+ } else {
+ catalogKind->ResourceFork = (startLba + sizeof(NewCatalog));
+ }
NewFork* forkKind = new NewFork();
memset(forkKind, 0, sizeof(NewFork));
@@ -284,8 +287,8 @@ private:
forkKind->ResourceKind = 0;
/// We're the only fork here.
- forkKind->NextSibling = catalogKind->FirstFork;
- forkKind->PreviousSibling = catalogKind->FirstFork;
+ forkKind->NextSibling = forkKind->Kind == kNewFSDataForkKind ? catalogKind->DataFork : catalogKind->ResourceFork;
+ forkKind->PreviousSibling = kNewFSDataForkKind ? catalogKind->DataFork : catalogKind->ResourceFork;
forkKind->DataOffset = (startLba + sizeof(NewCatalog) + sizeof(NewFork));
forkKind->DataSize = blob->fBlobSz;
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index 558bf001..226d5bff 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -170,6 +170,8 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
BDiskFormatFactory<BootDeviceATA> diskFormatter;
+ /// if not formated yet, then format it with the following folders:
+ /// /, /Boot, /Applications.
if (!diskFormatter) {
BDiskFormatFactory<BootDeviceATA>::BFileDescriptor rootDesc{0};