diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:51:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 10:51:53 +0200 |
| commit | 5c0bb7ee7b1b0fee02cc179fb21f4c57a61d6c2d (patch) | |
| tree | cb17577bcdc9714c97a84ce417a075117097f146 /public/frameworks | |
| parent | d608230b1350b064ceb01e6572519b108f6139b0 (diff) | |
| parent | 3167f59dbb401d6a79b1524537e04218baf49ee3 (diff) | |
Merge pull request #32 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'public/frameworks')
11 files changed, 59 insertions, 15 deletions
diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Array.h b/public/frameworks/CoreFoundation.fwrk/headers/Array.h index 0b4a8dbf..55e75e5e 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Array.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Array.h @@ -6,7 +6,7 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { template <typename T, SizeT N> diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h index 194b7bb7..1f295ea5 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h @@ -10,7 +10,7 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { class CFString; diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Property.h b/public/frameworks/CoreFoundation.fwrk/headers/Property.h index 58e881e5..4da173c7 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Property.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Property.h @@ -8,7 +8,7 @@ #define _PROPS_H #include <CoreFoundation.fwrk/headers/Ref.h> -#include <user/SystemCalls.h> +#include <libSystem/System.h> #define kMaxPropLen (256U) diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h index c18c6161..cb72a034 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h @@ -9,7 +9,7 @@ #define _REF_H_ #include <CoreFoundation.fwrk/headers/Object.h> -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { template <typename T> diff --git a/public/frameworks/CoreFoundation.fwrk/xml/app.xml b/public/frameworks/CoreFoundation.fwrk/xml/app.xml index 3a2beac4..fe112a09 100644 --- a/public/frameworks/CoreFoundation.fwrk/xml/app.xml +++ b/public/frameworks/CoreFoundation.fwrk/xml/app.xml @@ -1,3 +1,3 @@ <PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="CoreFoundation" /> +<PLEntry Type="CFString" Name="LibraryName" Len="255" Value="CoreFoundation" /> <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> diff --git a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h index 78b39bf8..efc21253 100644 --- a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h +++ b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h @@ -9,9 +9,14 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> +#ifndef __DISK_IMAGE_CDROM__ #define kDISectorSz (512) +#else +#define kDISectorSz (2048) +#endif // __DISK_IMAGE_CDROM__ + #define kDIMinDiskSz mib_cast(1) #define kDIDefaultOutputName "disk.eimg" #define kDIDefaultDiskName "Disk" @@ -46,4 +51,9 @@ SInt32 DIFormatPartitionEPM(struct DI_DISK_IMAGE& img) noexcept; /// @return Status code upon completion. SInt32 DIFormatFilesystemNeFS(struct DI_DISK_IMAGE& img) noexcept; +/// @brief HeFS format over EPM. +/// @param img disk image structure. +/// @return Status code upon completion. +SInt32 DIFormatFilesystemHeFS(struct DI_DISK_IMAGE& img) noexcept; + } // namespace DI diff --git a/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc b/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc new file mode 100644 index 00000000..7f917052 --- /dev/null +++ b/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. + + FILE: DiskImage+HeFS.cc + PURPOSE: Disk Imaging framework. + + ------------------------------------------- */ + +#include <DiskImage.fwrk/headers/DiskImage.h> + +#include <FSKit/HeFS.h> +#include <FirmwareKit/EPM.h> + +/// @brief format HeFS over an EPM disk. +/// @param img disk image structure. +/// @return Status code upon completion. +SInt32 DI::DIFormatFilesystemHeFS(struct DI_DISK_IMAGE& img) noexcept { + if (!img.sector_sz || (img.sector_sz % kDISectorSz != 0)) return kDIFailureStatus; + + if (*img.out_name == 0 || *img.disk_name == 0) return kDIFailureStatus; + + IORef handle = IoOpenFile(img.out_name, nullptr); + + if (!handle) return kDIFailureStatus; + + ::IoCloseFile(handle); + + handle = nullptr; + + return kDISuccessStatus; +}
\ No newline at end of file diff --git a/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc b/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc index bee84cca..c4f32c95 100644 --- a/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc +++ b/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc @@ -12,11 +12,11 @@ #include <FSKit/NeFS.h> #include <FirmwareKit/EPM.h> -/// @brief NeFS format over EPM. +/// @brief format NeFS over an EPM disk. /// @param img disk image structure. /// @return Status code upon completion. SInt32 DI::DIFormatFilesystemNeFS(struct DI_DISK_IMAGE& img) noexcept { - if (!img.sector_sz || (img.sector_sz % 512 != 0)) return kDIFailureStatus; + if (!img.sector_sz || (img.sector_sz % kDISectorSz != 0)) return kDIFailureStatus; if (*img.out_name == 0 || *img.disk_name == 0) return kDIFailureStatus; diff --git a/public/frameworks/DiskImage.fwrk/xml/app.xml b/public/frameworks/DiskImage.fwrk/xml/app.xml index 29d6670f..f498d4ab 100644 --- a/public/frameworks/DiskImage.fwrk/xml/app.xml +++ b/public/frameworks/DiskImage.fwrk/xml/app.xml @@ -1,3 +1,4 @@ -<PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="DiskImage" /> -<PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +<PropertyList> + <PLEntry Type="CFString" Name="LibraryName" Len="10" Value="DiskImage" /> + <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +</PropertyList>
\ No newline at end of file diff --git a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h index ccb1a903..04e90964 100644 --- a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h +++ b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h @@ -6,13 +6,13 @@ #pragma once -#include <NewKit/KernelPanic.h> +#include <NeKit/KernelPanic.h> /// @brief Kernel Test Framework. /// @file KernelTest.h #define KT_TEST_VERSION_BCD (0x0001) -#define KT_TEST_VERSION "0.0.1" +#define KT_TEST_VERSION "v0.0.1-kerneltest" #define KT_TEST_FAILURE (1) diff --git a/public/frameworks/KernelTest.fwrk/xml/app.xml b/public/frameworks/KernelTest.fwrk/xml/app.xml index f0c48862..e3ff9424 100644 --- a/public/frameworks/KernelTest.fwrk/xml/app.xml +++ b/public/frameworks/KernelTest.fwrk/xml/app.xml @@ -1,3 +1,4 @@ -<PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="KernelTest" /> +<PropertyList> +<PLEntry Type="CFString" Name="LibraryName" Len="10" Value="KernelTest" /> <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +</PropertyList>
\ No newline at end of file |
