diff options
Diffstat (limited to 'dev/zba')
| -rw-r--r-- | dev/zba/src/BootFileReader.cc | 2 | ||||
| -rw-r--r-- | dev/zba/src/BootString.cc | 2 | ||||
| -rw-r--r-- | dev/zba/src/BootTextWriter.cc | 2 | ||||
| -rw-r--r-- | dev/zba/src/BootThread.cc (renamed from dev/zba/src/Thread.cc) | 2 | ||||
| -rw-r--r-- | dev/zba/src/HEL/AMD64/BootAHCI.cc | 4 | ||||
| -rw-r--r-- | dev/zba/src/HEL/AMD64/BootATA.cc | 2 | ||||
| -rw-r--r-- | dev/zba/src/HEL/AMD64/BootMain.cc | 45 |
7 files changed, 29 insertions, 30 deletions
diff --git a/dev/zba/src/BootFileReader.cc b/dev/zba/src/BootFileReader.cc index 835fcb05..ab5d53ee 100644 --- a/dev/zba/src/BootFileReader.cc +++ b/dev/zba/src/BootFileReader.cc @@ -2,7 +2,7 @@ Copyright ZKA Web Services Co. - File: FileReader.cxx + File: FileReader.cc Purpose: New Boot FileReader, Read complete file and store it in a buffer. diff --git a/dev/zba/src/BootString.cc b/dev/zba/src/BootString.cc index faa7f168..6bc5cf9d 100644 --- a/dev/zba/src/BootString.cc +++ b/dev/zba/src/BootString.cc @@ -2,7 +2,7 @@ Copyright ZKA Web Services Co. - File: String.cxx + File: String.cc Purpose: ZBA string library Revision History: diff --git a/dev/zba/src/BootTextWriter.cc b/dev/zba/src/BootTextWriter.cc index 650484b3..e394d193 100644 --- a/dev/zba/src/BootTextWriter.cc +++ b/dev/zba/src/BootTextWriter.cc @@ -2,7 +2,7 @@ Copyright ZKA Web Services Co. - File: String.cxx + File: String.cc Purpose: ZBA string library Revision History: diff --git a/dev/zba/src/Thread.cc b/dev/zba/src/BootThread.cc index d009a633..c185b367 100644 --- a/dev/zba/src/Thread.cc +++ b/dev/zba/src/BootThread.cc @@ -12,7 +12,7 @@ #include <KernelKit/PEF.h> #include <KernelKit/PE.h> #include <KernelKit/MSDOS.h> -#include <CFKit/LoaderUtils.h> +#include <CFKit/Utils.h> #include <modules/FB/Text.h> // External boot services symbol. diff --git a/dev/zba/src/HEL/AMD64/BootAHCI.cc b/dev/zba/src/HEL/AMD64/BootAHCI.cc index 5899f177..60520ac9 100644 --- a/dev/zba/src/HEL/AMD64/BootAHCI.cc +++ b/dev/zba/src/HEL/AMD64/BootAHCI.cc @@ -5,9 +5,9 @@ ------------------------------------------- */ /** - * @file AHCI.cxx + * @file BootAHCI.cc * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com) - * @brief AHCI driver. + * @brief AHCI support for ZBA. * @version 0.1 * @date 2024-02-02 * diff --git a/dev/zba/src/HEL/AMD64/BootATA.cc b/dev/zba/src/HEL/AMD64/BootATA.cc index 0faba789..34f1df29 100644 --- a/dev/zba/src/HEL/AMD64/BootATA.cc +++ b/dev/zba/src/HEL/AMD64/BootATA.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ /** - * @file ATA.cxx + * @file BootATA.cc * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com) * @brief ATA driver. * @version 0.1 diff --git a/dev/zba/src/HEL/AMD64/BootMain.cc b/dev/zba/src/HEL/AMD64/BootMain.cc index 392fce0d..e939ac18 100644 --- a/dev/zba/src/HEL/AMD64/BootMain.cc +++ b/dev/zba/src/HEL/AMD64/BootMain.cc @@ -17,17 +17,17 @@ #include <NewKit/Ref.h> #include <BootKit/Thread.h> -// make the compiler shut up. +// Makes the compiler shut up. #ifndef kMachineModel #define kMachineModel "ZKA SSD" #endif // !kMachineModel -#ifndef cExpectedWidth -#define cExpectedWidth 1280 +#ifndef kExpectedWidth +#define kExpectedWidth 1280 #endif -#ifndef cExpectedHeight -#define cExpectedHeight 720 +#ifndef kExpectedHeight +#define kExpectedHeight 720 #endif /** Graphics related. */ @@ -38,18 +38,18 @@ STATIC EfiGUID kGopGuid; EXTERN_C Void rt_reset_hardware(); -/** - @brief Finds and stores the GOP. -*/ - EXTERN EfiBootServices* BS; -STATIC Void boot_init_fb() noexcept +/** + @brief Finds and stores the GOP object. +*/ +STATIC Bool boot_init_fb() noexcept { kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); kGop = nullptr; - BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop); + if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop) /= kEfiOk) + return No; kGopStride = 4; @@ -60,8 +60,8 @@ STATIC Void boot_init_fb() noexcept kGop->QueryMode(kGop, i, &sz, &infoPtr); - if (infoPtr->HorizontalResolution == cExpectedWidth && - infoPtr->VerticalResolution == cExpectedHeight) + if (infoPtr->HorizontalResolution == kExpectedWidth && + infoPtr->VerticalResolution == kExpectedHeight) { kGop->SetMode(kGop, i); break; @@ -93,15 +93,16 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, UInt32 rev_desc = 0; #ifdef __ZKA_USE_FB__ - boot_init_fb(); ///! Init the GOP. + if (!boot_init_fb()) + return -1; ///! Init the GOP. - for (SizeT indexVT = 0; indexVT < SystemTable->NumberOfTableEntries; - ++indexVT) + for (SizeT index_vt = 0; index_vt < SystemTable->NumberOfTableEntries; + ++index_vt) { Char* vendor_table = reinterpret_cast<Char*>( - SystemTable->ConfigurationTable[indexVT].VendorTable); + SystemTable->ConfigurationTable[index_vt].VendorTable); - /// ACPI's 'RSD PTR', which contains hardware tables (MADT, FACP...) + // ACPI's 'RSD PTR', which contains the ACPI SDT (MADT, FACP...) if (vendor_table[0] == 'R' && vendor_table[1] == 'S' && vendor_table[2] == 'D' && vendor_table[3] == ' ' && vendor_table[4] == 'P' && vendor_table[5] == 'T' && @@ -164,7 +165,6 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, // format the disk. // ---------------------------------------------------- // -#ifdef __AHCI__ if (!partition_factory.IsPartitionValid()) { Boot::BDiskFormatFactory<BootDeviceATA>::BFileDescriptor root; @@ -177,7 +177,6 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, rt_reset_hardware(); } -#endif BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); @@ -231,7 +230,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, if (reader_syschk.Blob()) { syschk_thread = new Boot::BThread(reader_syschk.Blob()); - syschk_thread->SetName("System Check."); + syschk_thread->SetName("System Check (Integrity check)"); } syschk_thread->Start(handover_hdr); @@ -268,7 +267,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, if (reader_kernel.Blob()) { kernel_thread = new Boot::BThread(reader_kernel.Blob()); - kernel_thread->SetName("Minimal Kernel."); + kernel_thread->SetName("OS Kernel (Microkernel)."); handover_hdr->f_KernelImage = reader_kernel.Blob(); } @@ -315,7 +314,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, #endif // __ZKA_USE_FB__ // ---------------------------------------------------- // - // Finally load Kernel, and the cr3 to it. + // Finally load the operating system kernel. // ---------------------------------------------------- // kernel_thread->Start(handover_hdr); |
