From 9be360bd9cce8a28fb4626fcc47b31b169e3b47c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 8 Apr 2024 21:13:11 +0200 Subject: Kernel: Don't forget to set drives inside DriveManager. Kernel: Start implement Format method for NewFS, it needs to verify the disk first. Kernel: Add kErrorDiskIsCorrupted (Error 54). Kernel: Add __NEWOS_AMD64__ and __NEWOS_PPC__. Kernel: Rename builtin RJ45 to IEE802 Signed-off-by: Amlal El Mahrouss --- Private/Source/FS/NewFS.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Private/Source/FS') diff --git a/Private/Source/FS/NewFS.cxx b/Private/Source/FS/NewFS.cxx index 012cb3d2..1d7d3621 100644 --- a/Private/Source/FS/NewFS.cxx +++ b/Private/Source/FS/NewFS.cxx @@ -151,7 +151,18 @@ _Output NewCatalog* NewFSParser::CreateCatalog(_Input const char* name, /// @brief Make a EPM+NewFS drive out of the disk. /// @param drive The drive to write on. /// @return If it was sucessful, see DbgLastError(). -bool NewFSParser::Format(_Input _Output DriveTrait* drive) { return false; } +bool NewFSParser::Format(_Input _Output DriveTrait* drive) { + /// verify disk. + drive->fVerify(&drive->fPacket); + + /// if disk isn't good, then error out. + if (false == drive->fPacket.fPacketGood) { + DbgLastError() = kErrorDiskIsCorrupted; + return false; + } + + return true; +} /// @brief /// @param catalog -- cgit v1.2.3