diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-02 19:38:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-02 19:38:46 +0200 |
| commit | 997be16e5ac9a68d54882ab69529815860d62955 (patch) | |
| tree | 19d6129c2d776bb1edc5d4a7325e39ca176c3403 /dev/boot/modules/SysChk/SysChk.cc | |
| parent | 618104e74c195d7508a18450524f8ed7f9af8cc6 (diff) | |
| parent | b3b4b1ebdcd6adeac914869017c86d892b7a8ced (diff) | |
Merge pull request #28 from nekernel-org/dev
0.0.2
Diffstat (limited to 'dev/boot/modules/SysChk/SysChk.cc')
| -rw-r--r-- | dev/boot/modules/SysChk/SysChk.cc | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/dev/boot/modules/SysChk/SysChk.cc b/dev/boot/modules/SysChk/SysChk.cc index 3979714d..c93ef83b 100644 --- a/dev/boot/modules/SysChk/SysChk.cc +++ b/dev/boot/modules/SysChk/SysChk.cc @@ -8,8 +8,8 @@ */ #include <BootKit/BootKit.h> -#include <modules/CoreGfx/CoreGfx.h> -#include <modules/CoreGfx/TextGfx.h> +#include <BootKit/BootThread.h> +#include <BootKit/HW/SATA.h> #include <FirmwareKit/EFI.h> #include <FirmwareKit/EFI/API.h> #include <FirmwareKit/Handover.h> @@ -18,37 +18,23 @@ #include <KernelKit/PEF.h> #include <NewKit/Macros.h> #include <NewKit/Ref.h> -#include <BootKit/BootThread.h> #include <modules/CoreGfx/CoreGfx.h> +#include <modules/CoreGfx/TextGfx.h> // Makes the compiler shut up. #ifndef kMachineModel -#define kMachineModel "Ne" -#endif // !kMachineModel +#define kMachineModel "OS" +#endif // !kMachineModel -EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) -{ - NE_UNUSED(handover); +EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) { + fw_init_efi((EfiSystemTable*) handover->f_FirmwareCustomTables[1]); #if defined(__ATA_PIO__) - Boot::BDiskFormatFactory<BootDeviceATA> partition_factory; - - if (partition_factory.IsPartitionValid()) - return kEfiOk; - - Boot::BDiskFormatFactory<BootDeviceATA>::BFileDescriptor desc{}; - - desc.fFileName[0] = '/'; - desc.fFileName[1] = 0; - desc.fKind = kNeFSCatalogKindDir; - - partition_factory.Format(kMachineModel, &desc, 1); - - if (partition_factory.IsPartitionValid()) - return kEfiOk; - - return kEfiFail; -#else - return kEfiOk; + Boot::BDiskFormatFactory<BootDeviceATA> partition_factory; +#elif defined(__AHCI__) + Boot::BDiskFormatFactory<BootDeviceSATA> partition_factory; #endif + if (partition_factory.IsPartitionValid()) return kEfiOk; + + return partition_factory.Format(kMachineModel); } |
