diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-25 09:38:24 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-25 09:38:24 +0200 |
| commit | 1cae0d2cde6e775ecb1625aa93a5d65d996efad0 (patch) | |
| tree | 59b85cf83b18f48c34591dc8f736215d2b747b19 | |
| parent | f6a38d6c14b314d7b85855f311527ede869db96f (diff) | |
MHR-16: Load NewLoader correctly.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | Private/HALKit/AMD64/HalProcessor.cpp | 2 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/Storage/AHCI.cxx | 8 | ||||
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/BootMain.cxx | 16 | ||||
| -rw-r--r-- | ReadMe.md | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/Private/HALKit/AMD64/HalProcessor.cpp b/Private/HALKit/AMD64/HalProcessor.cpp index 4fea4e7e..61d98c8c 100644 --- a/Private/HALKit/AMD64/HalProcessor.cpp +++ b/Private/HALKit/AMD64/HalProcessor.cpp @@ -8,7 +8,7 @@ /** * @file Processor.cpp - * @brief This file is about processor specific functions (in/out...) + * @brief This file is about processor specific functions (in/out/cli/std...) */ namespace NewOS::HAL { diff --git a/Private/HALKit/AMD64/Storage/AHCI.cxx b/Private/HALKit/AMD64/Storage/AHCI.cxx index 5e6b3348..c9db540a 100644 --- a/Private/HALKit/AMD64/Storage/AHCI.cxx +++ b/Private/HALKit/AMD64/Storage/AHCI.cxx @@ -33,11 +33,11 @@ NewOS::Boolean drv_std_init(NewOS::UInt16& PortsImplemented) { for (SizeT devIndex = 0; devIndex < NEWOS_BUS_COUNT; ++devIndex) { if (iterator[devIndex].Leak().Subclass() == kSATASubClass && iterator[devIndex].Leak().ProgIf() == kSATAProgIfAHCI) { - iterator[devIndex].Leak().EnableMmio(); - kAhciDevice = iterator[devIndex].Leak(); + iterator[devIndex].Leak().EnableMmio(); /// enable the memory i/o for this ahci device. + kAhciDevice = iterator[devIndex].Leak(); /// and then leak the reference. kcout << "NewKernel: [PCI] Found AHCI controller.\r\n"; - + return true; } } @@ -54,4 +54,4 @@ NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size) {} -#endif // __AHCI__
\ No newline at end of file +#endif // __AHCI__ diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx index 7120bcd9..cdbb2f36 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx @@ -170,20 +170,20 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, kernelFile.ReadAll(MIB(1), 4096); if (kernelFile.Blob()) { - PEFContainer* headerKind = + PEFContainer* containerKind = reinterpret_cast<PEFContainer*>(kernelFile.Blob()); - if (headerKind->Magic[0] == kPefMagic[0] && - headerKind->Magic[1] == kPefMagic[1] && - headerKind->Magic[2] == kPefMagic[2] && - headerKind->Magic[3] == kPefMagic[3] && - headerKind->Magic[4] == kPefMagic[4]) { - if (headerKind->Abi != kPefAbi || headerKind->Cpu != kPefArchAMD64) { + if (containerKind->Magic[0] == kPefMagic[0] && + containerKind->Magic[1] == kPefMagic[1] && + containerKind->Magic[2] == kPefMagic[2] && + containerKind->Magic[3] == kPefMagic[3] && + containerKind->Magic[4] == kPefMagic[4]) { + if (containerKind->Abi != kPefAbi || containerKind->Cpu != kPefArchAMD64) { EFI::ThrowError(L"Bad-Architecture", L"New Boot can't run this architecture."); } - NewOS::HEL::BootMainKind main = (NewOS::HEL::BootMainKind) nullptr; + NewOS::HEL::BootMainKind main = reinterpret_cast<NewOS::HEL::BootMainKind>(containerKind + containerKind->Start); if (!main) { EFI::ThrowError(L"Bad-Exec", @@ -1,6 +1,6 @@ <div align="center"> -<img src="Meta/Kernel.svg" width="96" height="96"/> -<h1>NewKernel</h1> +<img src="../Meta/Kernel.svg" width="96" height="96"/> +<h1>NewOS</h1> </div> <br> |
