diff options
| author | Amlal <amlal@zka.com> | 2024-07-20 08:43:16 +0200 |
|---|---|---|
| committer | Amlal <amlal@zka.com> | 2024-07-20 08:43:16 +0200 |
| commit | 650fee520f526d9cd5ffa75735bd94d5140dd247 (patch) | |
| tree | 5967c57a2e754c0f46bccfba40a915a680dcaa10 /Boot/Sources | |
| parent | 81b284cacb03b34ae259c485ac874b02c8ecba69 (diff) | |
[IMP] See below.
- Revoke OTA flag for now inside bootloader (newosldr #4)
- Rework Comm as SCI (System Call Interface) (newoskrnl #3)
- Rework and fix some parts of the scheduler (newoskrnl #2)
- Return from thread when region is zero (newosldr #1)
- Separate allocation functions and c++ runtime from each other. (DDK #5)
- Rename kHartStandard to kStandard (newoskrnl #6)
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Boot/Sources')
| -rw-r--r-- | Boot/Sources/HEL/AMD64/BootMain.cxx | 2 | ||||
| -rw-r--r-- | Boot/Sources/ProgramLoader.cxx | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index 8946aadc..95d795ea 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -245,7 +245,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, if (loader) loader->Start(handoverHdrPtr); #else - hal_init_platform(handoverHdrPtr); + hal_init_platform(handoverHdrPtr); #endif // ifdef __NEWOS_OTA__ EFI::Stop(); diff --git a/Boot/Sources/ProgramLoader.cxx b/Boot/Sources/ProgramLoader.cxx index 5938c2a0..4ea0d4c6 100644 --- a/Boot/Sources/ProgramLoader.cxx +++ b/Boot/Sources/ProgramLoader.cxx @@ -20,7 +20,7 @@ EXTERN_C namespace Boot { - EXTERN_C Int32 rt_jump_to_address(HEL::HandoverProc baseCode, HEL::HandoverInformationHeader* handover, Char* stackPointer); + EXTERN_C Int32 rt_jump_to_address(HEL::HandoverProc baseCode, HEL::HandoverInformationHeader* handover, Char* stackPointer); ProgramLoader::ProgramLoader(VoidPtr blob) : fBlob(blob), fStartAddress(nullptr) @@ -39,14 +39,14 @@ namespace Boot if (firstBytes[0] == kMagMz0 && firstBytes[1] == kMagMz1) { - writer.Write("newosldr: MZ executable detected.\r"); + writer.Write("newosldr: MZ executable detected.\r"); - ExecHeaderPtr hdrPtr = (ldr_find_exec_header(firstBytes)); - ExecOptionalHeaderPtr optHdr = (ldr_find_opt_exec_header(firstBytes)); + ExecHeaderPtr hdrPtr = (ldr_find_exec_header(firstBytes)); + ExecOptionalHeaderPtr optHdr = (ldr_find_opt_exec_header(firstBytes)); // Parse PE32+ fStartAddress = (VoidPtr)((UIntPtr)optHdr->mImageBase + optHdr->mBaseOfCode + optHdr->mAddressOfEntryPoint); - fStackPtr = new Char[optHdr->mSizeOfStackReserve]; + fStackPtr = new Char[optHdr->mSizeOfStackReserve]; writer.Write("newosldr: Major Linker: ").Write(optHdr->mMajorLinkerVersion).Write("\r"); writer.Write("newosldr: Minor Linker: ").Write(optHdr->mMinorLinkerVersion).Write("\r"); @@ -73,21 +73,21 @@ namespace Boot /// @note handover header has to be valid! Void ProgramLoader::Start(HEL::HandoverInformationHeader* handover) { - BTextWriter writer; + BTextWriter writer; - if (!handover) + if (!handover || + ((Char*)fStartAddress)[0] == 0x0) { - writer.Write("newosldr: Exec format error.\r"); - return; + writer.Write("newosldr: Exec format error.\r"); + return; } writer.Write("newosldr: Trying to run: ").Write(fBlobName).Write("\r"); - if (!fStartAddress || - ((Char*)fStartAddress)[0] == 0x0) + if (!fStartAddress) { - HEL::HandoverProc fn = [](HEL::HandoverInformationHeader* rcx) -> void { - BTextWriter writer; + HEL::HandoverProc fn = [](HEL::HandoverInformationHeader* rcx) -> void { + BTextWriter writer; writer.Write("newosldr: Exec format error, Thread has been aborted.\r"); EFI::ThrowError(L"Exec-Format-Error", L"Format doesn't match (Thread aborted.)"); |
