From f29e7e30fde2b994c86024659b41f56b64dce911 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 18 Nov 2025 22:09:11 +0100 Subject: fix: kernel: OpenHeFS and NeFS fixes, PCI and DriveMgr fixes. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/DriveMgr.h | 17 +++++++++++------ dev/kernel/KernelKit/PCI/Iterator.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'dev/kernel/KernelKit') diff --git a/dev/kernel/KernelKit/DriveMgr.h b/dev/kernel/KernelKit/DriveMgr.h index dd3f9614..1a6d1b08 100644 --- a/dev/kernel/KernelKit/DriveMgr.h +++ b/dev/kernel/KernelKit/DriveMgr.h @@ -52,7 +52,7 @@ enum { /// @brief Media drive trait type. struct DriveTrait final { - Char fName[kDriveNameLen] = {0}; // /System, /boot, //./Devices/USB... + Char fName[kDriveNameLen] = "/media/null"; // /System, /boot, //./Devices/USB... UInt32 fKind{}; // fMassStorage, fFloppy, fOpticalDrive. UInt32 fFlags{}; // fReadOnly, fEPMDrive... @@ -70,11 +70,11 @@ struct DriveTrait final { Lba fLbaStart{0}, fLbaEnd{0}; SizeT fSectorSz{kDriveSectorSz}; - Void (*fInput)(DrivePacket& packet){}; - Void (*fOutput)(DrivePacket& packet){}; - Void (*fVerify)(DrivePacket& packet){}; - Void (*fInit)(DrivePacket& packet){}; - const Char* (*fProtocol)(Void){}; + Void (*fInput)(DrivePacket& packet){nullptr}; + Void (*fOutput)(DrivePacket& packet){nullptr}; + Void (*fVerify)(DrivePacket& packet){nullptr}; + Void (*fInit)(DrivePacket& packet){nullptr}; + const Char* (*fProtocol)(Void){nullptr}; }; namespace Probe { @@ -154,8 +154,13 @@ const Char* io_drv_kind(Void); /// @return the new drive as a trait. DriveTrait io_construct_blank_drive(Void) noexcept; +/// @brief Fetches the main drive. +/// @param trait the new drive as a trait. +Void io_construct_main_drive(DriveTrait& trait) noexcept; + /// @brief Fetches the main drive. /// @return the new drive as a trait. +/// @deprecated use io_construct_main_drive(DriveTrait& trait) instead. DriveTrait io_construct_main_drive(Void) noexcept; namespace Detect { diff --git a/dev/kernel/KernelKit/PCI/Iterator.h b/dev/kernel/KernelKit/PCI/Iterator.h index 9ab746d9..743e73ea 100644 --- a/dev/kernel/KernelKit/PCI/Iterator.h +++ b/dev/kernel/KernelKit/PCI/Iterator.h @@ -23,7 +23,7 @@ class Iterator final { Iterator() = delete; public: - explicit Iterator(const Types::PciDeviceKind& deviceType); + explicit Iterator(const Types::PciDeviceKind deviceType, UInt32 bar); Iterator& operator=(const Iterator&) = default; Iterator(const Iterator&) = default; -- cgit v1.2.3