summaryrefslogtreecommitdiffhomepage
path: root/dev/ZBA/Sources
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-05 14:42:03 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-05 14:42:03 +0200
commit432e68391357423914547a7b34311258d7598808 (patch)
treec2f7eeb45f99b910122257d1a9c2bcfcda4bddb3 /dev/ZBA/Sources
parent3e2b931d65582284e9716c42a902cab6d279c7f0 (diff)
[ FIX ] Fixing shortcomings of scheduler, filesystem and kernel.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZBA/Sources')
-rw-r--r--dev/ZBA/Sources/HEL/AMD64/BootMain.cxx58
-rw-r--r--dev/ZBA/Sources/HEL/AMD64/BootTextWriter.cxx8
2 files changed, 33 insertions, 33 deletions
diff --git a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
index 55f10ea2..9cccc922 100644
--- a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
+++ b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
@@ -154,6 +154,27 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
handoverHdrPtr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1;
// Fill handover header now.
+ BDiskFormatFactory<BootDeviceATA> checkPart;
+
+ // ---------------------------------------------------- //
+ // The following checks for an exisiting partition
+ // inside the disk, if it doesn't have one,
+ // format the disk.
+ // ---------------------------------------------------- //
+
+ if (!checkPart.IsPartitionValid())
+ {
+ BDiskFormatFactory<BootDeviceATA>::BFileDescriptor root;
+ root.fFileName[0] = kNeFSRoot[0];
+ root.fFileName[1] = 0;
+
+ root.fKind = kNeFSCatalogKindDir;
+
+ checkPart.Format("ZKA (A:)", &root, 1);
+
+ rt_reset_hardware();
+ }
+
BS->GetMemoryMap(&SizePtr, Descriptor, &MapKey, &SzDesc, &RevDesc);
Descriptor = new EfiMemoryDescriptor[SzDesc];
@@ -193,15 +214,9 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
while (BS->AllocatePool(EfiRuntimeServicesData, kHandoverHeapSz, &handoverHdrPtr->f_BitMapStart) != kEfiOk)
;
- auto extended_heap = (VoidPtr)((UIntPtr)handoverHdrPtr->f_BitMapStart + kHandoverHeapSz);
-
- while (BS->AllocatePool(EfiRuntimeServicesData, kHandoverHeapSz, &extended_heap) != kEfiOk)
- ;
-
handoverHdrPtr->f_VirtualSize =
Descriptor[cDefaultMemoryMap].NumberOfPages; /* # of pages */
-
handoverHdrPtr->f_FirmwareCustomTables[0] = (VoidPtr)BS;
handoverHdrPtr->f_FirmwareCustomTables[1] = (VoidPtr)ST;
@@ -241,27 +256,6 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
// Assign to global 'kHandoverHeader'.
- BDiskFormatFactory<BootDeviceATA> checkPart;
-
- // ---------------------------------------------------- //
- // The following checks for an exisiting partition
- // inside the disk, if it doesn't have one,
- // format the disk.
- // ---------------------------------------------------- //
-
- if (!checkPart.IsPartitionValid())
- {
- BDiskFormatFactory<BootDeviceATA>::BFileDescriptor root;
- root.fFileName[0] = kNewFSRoot[0];
- root.fFileName[1] = 0;
-
- root.fKind = kNewFSCatalogKindDir;
-
- checkPart.Format("ZKA (A:)", &root, 1);
-
- rt_reset_hardware();
- }
-
BFileReader readerKernel(L"newoskrnl.exe", ImageHandle);
readerKernel.ReadAll(0);
@@ -293,11 +287,17 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
urbanistTTF.ReadAll(0);
if (readerSysDrv.Blob() &&
- chimeWav.Blob())
+ chimeWav.Blob() &&
+ urbanistTTF.Blob())
{
handoverHdrPtr->f_StartupChime = chimeWav.Blob();
- handoverHdrPtr->f_StartupImage = readerKernel.Blob();
+ handoverHdrPtr->f_ChimeSz = chimeWav.Size();
+ handoverHdrPtr->f_StartupImage = readerSysDrv.Blob();
+ handoverHdrPtr->f_StartupSz = readerSysDrv.Size();
+ handoverHdrPtr->f_KernelImage = readerKernel.Blob();
+ handoverHdrPtr->f_KernelSz = readerKernel.Size();
handoverHdrPtr->f_TTFallbackFont = urbanistTTF.Blob();
+ handoverHdrPtr->f_FontSz = urbanistTTF.Size();
}
else
{
diff --git a/dev/ZBA/Sources/HEL/AMD64/BootTextWriter.cxx b/dev/ZBA/Sources/HEL/AMD64/BootTextWriter.cxx
index 65ea3d89..467f4303 100644
--- a/dev/ZBA/Sources/HEL/AMD64/BootTextWriter.cxx
+++ b/dev/ZBA/Sources/HEL/AMD64/BootTextWriter.cxx
@@ -25,7 +25,7 @@
*/
BTextWriter& BTextWriter::Write(const CharacterTypeUTF16* str)
{
-#ifdef __DEBUG_OUTPUT__
+#ifdef __DEBUG__
if (!str || *str == 0)
return *this;
@@ -57,7 +57,7 @@ BTextWriter& BTextWriter::Write(const CharacterTypeUTF16* str)
/// @param str the input string.
BTextWriter& BTextWriter::Write(const Char* str)
{
-#ifdef __DEBUG_OUTPUT__
+#ifdef __DEBUG__
if (!str || *str == 0)
return *this;
@@ -87,7 +87,7 @@ BTextWriter& BTextWriter::Write(const Char* str)
BTextWriter& BTextWriter::Write(const UChar* str)
{
-#ifdef __DEBUG_OUTPUT__
+#ifdef __DEBUG__
if (!str || *str == 0)
return *this;
@@ -120,7 +120,7 @@ BTextWriter& BTextWriter::Write(const UChar* str)
*/
BTextWriter& BTextWriter::WriteCharacter(CharacterTypeUTF16 c)
{
-#ifdef __DEBUG_OUTPUT__
+#ifdef __DEBUG__
EfiCharType str[2];
str[0] = c;