diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-09-01 15:38:05 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-09-01 15:38:05 +0200 |
| commit | 76835f023db03aef20c74541fb2a8a9485206cf7 (patch) | |
| tree | ab7b82e1860ac3d04353ade7ef74449ea4454488 | |
| parent | 46670e7ba97ec80bbcc88feb3d7db7ef3f5e2147 (diff) | |
Added new fields for the OS inside handover header.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
27 files changed, 55 insertions, 19 deletions
diff --git a/dev/ZBA/Modules/SysChk/Module.cxx b/dev/ZBA/Modules/SysChk/Module.cxx index 15758599..fa564324 100644 --- a/dev/ZBA/Modules/SysChk/Module.cxx +++ b/dev/ZBA/Modules/SysChk/Module.cxx @@ -11,5 +11,10 @@ EXTERN_C Int32 main(Kernel::HEL::HandoverInformationHeader* Handover) { + EfiSystemTable* cST = (EfiSystemTable*)Handover->f_FirmwareCustomTables[1]; + cST->ConOut->ClearScreen(cST->ConOut); + cST->ConOut->OutputString(cST->ConOut, L"SYSCHK: CHECKING FOR VALID NEWFS OR EXT4 PARTITIONS...\r"); + cST->ConOut->OutputString(cST->ConOut, L"SYSCHK: WE ARE GOOD TO GO!\r"); + return kEfiOk; } diff --git a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx index 67b2a478..382cbcd6 100644 --- a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx +++ b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx @@ -149,7 +149,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, CGDrawString("NEWOSLDR (C) ZKA TECHNOLOGIES.", 10, 10, RGB(0xFF, 0xFF, 0xFF)); CGDrawString((cnt_enabled > 1) ? "MULTIPROCESSOR SYSTEM." : "UNIPROCESSOR SYSTEM.", 20, 10, RGB(0xFF, 0xFF, 0xFF)); - handoverHdrPtr->f_MultiProcessingEnabled = cnt_enabled > 1 + handoverHdrPtr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1 ; // Fill handover header now. @@ -233,10 +233,13 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, // format the disk. // ---------------------------------------------------- // + handoverHdrPtr->f_FirmwareCustomTables[0] = (VoidPtr)BS; + handoverHdrPtr->f_FirmwareCustomTables[1] = (VoidPtr)ST; + BFileReader readerSysChk(L"syschk.sys", ImageHandle); readerSysChk.ReadAll(0); - Boot::BThread* loaderBootScr = nullptr; + Boot::BThread* loaderSysChk = nullptr; // ------------------------------------------ // // If we succeed in reading the blob, then execute it. @@ -244,11 +247,16 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, if (readerSysChk.Blob()) { - loaderBootScr = new Boot::BThread(readerSysChk.Blob()); - loaderBootScr->SetName("64-bit System Check DLL."); + loaderSysChk = new Boot::BThread(readerSysChk.Blob()); + loaderSysChk->SetName("64-bit System Check DLL."); } - loaderBootScr->Start(handoverHdrPtr); + loaderSysChk->Start(handoverHdrPtr); + + // nullify these fields, to avoid being reused later. + + handoverHdrPtr->f_FirmwareCustomTables[0] = nullptr; + handoverHdrPtr->f_FirmwareCustomTables[1] = nullptr; BFileReader readerKernel(L"newoskrnl.dll", ImageHandle); @@ -264,10 +272,32 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, { loader = new Boot::BThread(readerKernel.Blob()); loader->SetName("64-bit Kernel DLL."); + + handoverHdrPtr->f_KernelImage = readerKernel.Blob(); + } + else + { + CGDrawString("NEWOSLDR: PLEASE RECOVER YOUR NEWOSKRNL KERNEL DLL.", 30, 10, RGB(0xFF, 0xFF, 0xFF)); + } + + BFileReader chimeWav(L"ZKA\\startup.wav", ImageHandle); + BFileReader readerSysDrv(L"ZKA\\startup.sys", ImageHandle); + BFileReader urbanistTTF(L"ZKA\\urbanist.ttf", ImageHandle); + + readerSysDrv.ReadAll(0); + chimeWav.ReadAll(0); + urbanistTTF.ReadAll(0); + + if (readerSysDrv.Blob() && + chimeWav.Blob()) + { + handoverHdrPtr->f_StartupChime = chimeWav.Blob(); + handoverHdrPtr->f_StartupImage = readerKernel.Blob(); + handoverHdrPtr->f_TTFallbackFont = urbanistTTF.Blob(); } else { - CGDrawString("NEWOSLDR: PLEASE RECOVER YOUR NEWOSKRNL INSTALL.", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + CGDrawString("NEWOSLDR: ONE OR MORE SYSTEM COMPONENTS ARE MISSING, PLEASE REINSTALL THE OS.", 30, 10, RGB(0xFF, 0xFF, 0xFF)); } EFI::ExitBootServices(MapKey, ImageHandle); diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Black.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Black.ttf Binary files differdeleted file mode 100644 index e1ec32b3..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Black.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf Binary files differdeleted file mode 100644 index 85323c97..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf Binary files differdeleted file mode 100644 index 330e84f9..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf Binary files differdeleted file mode 100644 index 08d47a8a..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf Binary files differdeleted file mode 100644 index 7971b6db..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf Binary files differdeleted file mode 100644 index 050297e2..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf Binary files differdeleted file mode 100644 index a20a0bf9..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf Binary files differdeleted file mode 100644 index 68968472..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf Binary files differdeleted file mode 100644 index 79688a6c..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf Binary files differdeleted file mode 100644 index 59034000..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf Binary files differdeleted file mode 100644 index 1a455ce2..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf Binary files differdeleted file mode 100644 index 44a9c897..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf Binary files differdeleted file mode 100644 index 2a794b27..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf Binary files differdeleted file mode 100644 index 6d393d1c..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf Binary files differdeleted file mode 100644 index 327aa044..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf Binary files differdeleted file mode 100644 index 9e272162..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf Binary files differdeleted file mode 100644 index 5cf054f1..00000000 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf +++ /dev/null diff --git a/dev/ZBA/Sources/Root/ZKA/fonts.json b/dev/ZBA/Sources/Root/ZKA/fonts.json deleted file mode 100644 index 05487cec..00000000 --- a/dev/ZBA/Sources/Root/ZKA/fonts.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "font_pkg_src": "*.ttf", - "font_pkg_name": "ZKA Standard Fonts." -} diff --git a/dev/ZBA/Sources/Root/ZKA/startup.wav b/dev/ZBA/Sources/Root/ZKA/startup.wav Binary files differnew file mode 100644 index 00000000..524921f5 --- /dev/null +++ b/dev/ZBA/Sources/Root/ZKA/startup.wav diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Medium.ttf b/dev/ZBA/Sources/Root/ZKA/urbanist.ttf Binary files differindex e9a6dbb0..e9a6dbb0 100644 --- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Medium.ttf +++ b/dev/ZBA/Sources/Root/ZKA/urbanist.ttf diff --git a/dev/ZBA/amd64-efi.make b/dev/ZBA/amd64-efi.make index 6eac7584..b1517576 100644 --- a/dev/ZBA/amd64-efi.make +++ b/dev/ZBA/amd64-efi.make @@ -57,6 +57,7 @@ DDK=ddk.dll SCI=sci.dll CRT=ndkcrt.dll SYS_CHK=syschk.sys +STARTUP=startup.sys .PHONY: invalid-recipe invalid-recipe: @@ -72,6 +73,7 @@ all: compile-amd64 $(COPY) ../SCI/$(SCI) Sources/Root/$(SCI) $(COPY) ../DDK/$(DDK) Sources/Root/$(DDK) $(COPY) ./Modules/SysChk/$(SYS_CHK) Sources/Root/$(SYS_CHK) + $(COPY) ./Modules/SysChk/$(SYS_CHK) Sources/Root/ZKA/$(STARTUP) $(COPY) ../CRT/$(CRT) Sources/Root/$(CRT) $(COPY) Sources/$(BOOT_LOADER) Sources/Root/$(BOOT_LOADER) diff --git a/dev/ZKA/FirmwareKit/Handover.hxx b/dev/ZKA/FirmwareKit/Handover.hxx index 4cada822..46fca139 100644 --- a/dev/ZKA/FirmwareKit/Handover.hxx +++ b/dev/ZKA/FirmwareKit/Handover.hxx @@ -65,21 +65,26 @@ namespace Kernel::HEL VoidPtr f_VirtualStart; SizeT f_VirtualSize; VoidPtr f_PhysicalStart; - VoidPtr f_HeapStart; + VoidPtr f_KernelImage; + VoidPtr f_StartupChime; + VoidPtr f_StartupImage; + VoidPtr f_TTFallbackFont; + WideChar f_FirmwareVendorName[32]; SizeT f_FirmwareVendorLen; + VoidPtr f_FirmwareCustomTables[2]; // On EFI 0: BS 1: ST + struct { VoidPtr f_SmBios; VoidPtr f_VendorPtr; VoidPtr f_MpPtr; + Bool f_MultiProcessingEnabled; } f_HardwareTables; - Bool f_MultiProcessingEnabled; - struct { UIntPtr f_The; @@ -91,7 +96,6 @@ namespace Kernel::HEL } f_GOP; UInt64 f_FirmwareSpecific[8]; - Char f_CommandLine[255][kHandoverMaxCmdLine]; }; enum diff --git a/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx b/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx index 820dea97..2f79c173 100644 --- a/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx +++ b/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx @@ -243,7 +243,7 @@ Kernel::Void hal_real_init(Kernel::Void) noexcept kSyscalls[cRebootInterrupt].fHooked = true; kSyscalls[cCreateThreadInterrupt].fHooked = true; - if (kHandoverHeader->f_MultiProcessingEnabled) + if (kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled) Kernel::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); Kernel::kcout << "newoskrnl.dll: Creating filesystem and such.\r"; diff --git a/dev/ZKA/NewKit/Macros.hxx b/dev/ZKA/NewKit/Macros.hxx index 2ecf2319..8c66995b 100644 --- a/dev/ZKA/NewKit/Macros.hxx +++ b/dev/ZKA/NewKit/Macros.hxx @@ -118,4 +118,4 @@ #define kSysPage "\\System\\syspage.sys" /// @brief The main system driver. -#define kSysDrv "\\System\\sysdrv.sys" +#define kSysDrv "\\System\\startup.sys" diff --git a/dev/ZKA/Sources/FS/NewFS.cxx b/dev/ZKA/Sources/FS/NewFS.cxx index edec6a6e..43cc22b5 100644 --- a/dev/ZKA/Sources/FS/NewFS.cxx +++ b/dev/ZKA/Sources/FS/NewFS.cxx @@ -62,8 +62,7 @@ STATIC MountpointInterface sMountpointInterface; _Output NFS_FORK_STRUCT* NewFSParser::CreateFork(_Input NFS_CATALOG_STRUCT* catalog, _Input NFS_FORK_STRUCT& theFork) { - if (catalog && theFork.ForkName[0] != 0 && - theFork.DataSize <= kNewFSForkSz) + if (catalog && theFork.ForkName[0] != 0) { Lba lba = (theFork.Kind == kNewFSDataForkKind) ? catalog->DataFork : catalog->ResourceFork; @@ -710,7 +709,7 @@ bool NewFSParser::WriteCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog, Bool prevFork = *forkDataIn; - startFork = forkDataIn->NextSibling + forkDataIn->DataSize; + startFork = forkDataIn->NextSibling; } return false; |
