summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-01 15:38:05 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-09-01 15:38:05 +0200
commit76835f023db03aef20c74541fb2a8a9485206cf7 (patch)
treeab7b82e1860ac3d04353ade7ef74449ea4454488
parent46670e7ba97ec80bbcc88feb3d7db7ef3f5e2147 (diff)
Added new fields for the OS inside handover header.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
-rw-r--r--dev/ZBA/Modules/SysChk/Module.cxx5
-rw-r--r--dev/ZBA/Sources/HEL/AMD64/BootMain.cxx42
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Black.ttfbin42784 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttfbin44084 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttfbin42636 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttfbin43900 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttfbin42908 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttfbin44208 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttfbin42792 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttfbin44104 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttfbin43996 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttfbin42764 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttfbin44052 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttfbin44080 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttfbin42704 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttfbin42740 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttfbin44088 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttfbin42580 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttfbin43868 -> 0 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/fonts.json4
-rw-r--r--dev/ZBA/Sources/Root/ZKA/startup.wavbin0 -> 1045048 bytes
-rw-r--r--dev/ZBA/Sources/Root/ZKA/urbanist.ttf (renamed from dev/ZBA/Sources/Root/ZKA/Urbanist-Medium.ttf)bin42752 -> 42752 bytes
-rw-r--r--dev/ZBA/amd64-efi.make2
-rw-r--r--dev/ZKA/FirmwareKit/Handover.hxx12
-rw-r--r--dev/ZKA/HALKit/AMD64/HalKernelMain.cxx2
-rw-r--r--dev/ZKA/NewKit/Macros.hxx2
-rw-r--r--dev/ZKA/Sources/FS/NewFS.cxx5
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
deleted file mode 100644
index e1ec32b3..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Black.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf
deleted file mode 100644
index 85323c97..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-BlackItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf
deleted file mode 100644
index 330e84f9..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf
deleted file mode 100644
index 08d47a8a..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-BoldItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf
deleted file mode 100644
index 7971b6db..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBold.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf
deleted file mode 100644
index 050297e2..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraBoldItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf
deleted file mode 100644
index a20a0bf9..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLight.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf
deleted file mode 100644
index 68968472..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ExtraLightItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf
deleted file mode 100644
index 79688a6c..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Italic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf
deleted file mode 100644
index 59034000..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Light.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf
deleted file mode 100644
index 1a455ce2..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-LightItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf
deleted file mode 100644
index 44a9c897..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-MediumItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf
deleted file mode 100644
index 2a794b27..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf
deleted file mode 100644
index 6d393d1c..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBold.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf
deleted file mode 100644
index 327aa044..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-SemiBoldItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf
deleted file mode 100644
index 9e272162..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Thin.ttf
+++ /dev/null
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf b/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf
deleted file mode 100644
index 5cf054f1..00000000
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-ThinItalic.ttf
+++ /dev/null
Binary files differ
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
new file mode 100644
index 00000000..524921f5
--- /dev/null
+++ b/dev/ZBA/Sources/Root/ZKA/startup.wav
Binary files differ
diff --git a/dev/ZBA/Sources/Root/ZKA/Urbanist-Medium.ttf b/dev/ZBA/Sources/Root/ZKA/urbanist.ttf
index e9a6dbb0..e9a6dbb0 100644
--- a/dev/ZBA/Sources/Root/ZKA/Urbanist-Medium.ttf
+++ b/dev/ZBA/Sources/Root/ZKA/urbanist.ttf
Binary files differ
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;