NeKernel dev
Loading...
Searching...
No Matches
HeFS.h File Reference

HeFS filesystem support. More...

#include <CompilerKit/CompilerKit.h>
#include <KernelKit/DriveMgr.h>
#include <KernelKit/UserMgr.h>
#include <NeKit/Crc32.h>
#include <NeKit/Defines.h>
#include <NeKit/KString.h>
#include <hint/CompilerHint.h>

Go to the source code of this file.

Classes

struct  Kernel::HEFS_BOOT_NODE
 HeFS Boot node. More...
struct  Kernel::HEFS_JOURNAL_NODE
 Journal Node structure. More...
struct  Kernel::HEFS_INDEX_NODE
 HeFS index node. More...
struct  Kernel::HEFS_INDEX_NODE_DIRECTORY
 HeFS directory node. More...
class  Kernel::HeFileSystemParser
 HeFS filesystem parser class. More...

Namespaces

namespace  Kernel
 USER_PROCESS inline definitions.
namespace  Kernel::Detail
 Implementation details namespace.
namespace  Kernel::HeFS

Macros

#define kHeFSVersion   (0x0103)
#define kHeFSMagic   " HeFS"
#define kHeFSMagicLen   (8)
#define kHeFSBlockLen   (512U)
#define kHeFSFileNameLen   (256U)
#define kHeFSPartNameLen   (128U)
#define kHeFSMinimumDiskSize   (gib_cast(128))
#define kHeFSDefaultVolumeName   u8"HeFS Volume"
#define kHeFSINDStartOffset   (sizeof(HEFS_BOOT_NODE))
#define kHeFSINStartOffset   (sizeof(HEFS_INDEX_NODE_DIRECTORY))
#define kHeFSSearchAllStr   u8"*"

Typedefs

typedef UInt64 Kernel::ATime
 Access time type.

Enumerations

enum  : UInt8 {
  kHeFSHardDrive = 0xC0 , kHeFSSolidStateDrive = 0xC1 , kHeFSOpticalDrive = 0x0C , kHeFSMassStorageDevice = 0xCC ,
  kHeFSScsiDrive = 0xC4 , kHeFSFlashDrive = 0xC6 , kHeFSUnknown = 0xFF , kHeFSDriveCount = 8
}
enum  : UInt8 {
  kHeFSStatusUnlocked = 0x18 , kHeFSStatusLocked , kHeFSStatusError , kHeFSStatusInvalid ,
  kHeFSStatusCount
}
enum  : UInt16 {
  kHeFSEncodingFlagsUTF8 = 0x50 , kHeFSEncodingFlagsUTF16 , kHeFSEncodingFlagsUTF32 , kHeFSEncodingFlagsUTF16BE ,
  kHeFSEncodingFlagsUTF16LE , kHeFSEncodingFlagsUTF32BE , kHeFSEncodingFlagsUTF32LE , kHeFSEncodingFlagsUTF8BE ,
  kHeFSEncodingFlagsUTF8LE , kHeFSEncodingFlagsBinary , kHeFSEncodingFlagsCount = 11 , kHeFSFlagsNone = 0 ,
  kHeFSFlagsReadOnly = 0x100 , kHeFSFlagsHidden , kHeFSFlagsSystem , kHeFSFlagsArchive ,
  kHeFSFlagsDevice , kHeFSFlagsCount = 7
}
enum  Kernel::HeFSJournalKind : UInt8 {
  Kernel::kJournalKindInvalid = 0x00 , Kernel::kJournalKindWrite = 0x01 , Kernel::kJournalKindRename = 0x02 , Kernel::kJournalKindDelete = 0x03 ,
  Kernel::kJournalKindFlagEdit = 0x04 , Kernel::kJournalKindCreate = 0x05 , Kernel::kJournalKindCount
}
 This enum defines the opcode of the journal, here mentioned as 'kinds'. More...
enum  { Kernel::kHeFSInvalidColor = 0 , Kernel::kHeFSRed = 100 , Kernel::kHeFSBlack , Kernel::kHeFSColorCount }

Functions

UInt32 Kernel::Detail::hefs_year_get (ATime raw_atime) noexcept
 HeFS get year from ATime.
UInt32 Kernel::Detail::hefs_month_get (ATime raw_atime) noexcept
 HeFS get month from ATime.
UInt32 Kernel::Detail::hefs_day_get (ATime raw_atime) noexcept
 HeFS get day from ATime.
UInt32 Kernel::Detail::hefs_hour_get (ATime raw_atime) noexcept
 HeFS get hour from ATime.
UInt32 Kernel::Detail::hefs_minute_get (ATime raw_atime) noexcept
 HeFS get minute from ATime.
const CharKernel::Detail::hefs_status_to_string (UInt16 status) noexcept
const CharKernel::Detail::hefs_drive_kind_to_string (UInt8 kind) noexcept
const CharKernel::Detail::hefs_encoding_to_string (UInt8 encoding) noexcept
const CharKernel::Detail::hefs_file_kind_to_string (UInt16 kind) noexcept
const CharKernel::Detail::hefs_file_flags_to_string (UInt32 flags) noexcept
Boolean Kernel::HeFS::fs_init_hefs (Void) noexcept
 Initialize HeFS inside the main disk.

Variables

constexpr UInt16 kHeFSFileKindRegular = 0x00
constexpr UInt16 kHeFSFileKindDirectory = 0x01
constexpr UInt16 kHeFSFileKindBlock = 0x02
constexpr UInt16 kHeFSFileKindCharacter = 0x03
constexpr UInt16 kHeFSFileKindFIFO = 0x04
constexpr UInt16 kHeFSFileKindSocket = 0x05
constexpr UInt16 kHeFSFileKindSymbolicLink = 0x06
constexpr UInt16 kHeFSFileKindUnknown = 0x07
constexpr UInt16 kHeFSFileKindCount = 0x08
constexpr UInt16 kHeFSSliceCount = 0x10
 HeFS blocks are array containing sparse blocks of data.
constexpr UInt16 kHeFSInvalidVID = 0xFFFF
constexpr ATime Kernel::kHeFSTimeInvalid = 0x0000000000000000
constexpr ATime Kernel::kHeFSTimeMax = 0xFFFFFFFFFFFFFFFF - 1
constexpr UInt32 Kernel::Detail::kHeFSBaseYear = 1970
constexpr UInt32 Kernel::Detail::kHeFSBaseMonth = 1
constexpr UInt32 Kernel::Detail::kHeFSBaseDay = 1
constexpr UInt32 Kernel::Detail::kHeFSBaseHour = 0
constexpr UInt32 Kernel::Detail::kHeFSBaseMinute = 0

Detailed Description

HeFS filesystem support.

Macro Definition Documentation

◆ kHeFSBlockLen

#define kHeFSBlockLen   (512U)

◆ kHeFSDefaultVolumeName

#define kHeFSDefaultVolumeName   u8"HeFS Volume"

◆ kHeFSFileNameLen

#define kHeFSFileNameLen   (256U)

◆ kHeFSINDStartOffset

#define kHeFSINDStartOffset   (sizeof(HEFS_BOOT_NODE))

◆ kHeFSINStartOffset

#define kHeFSINStartOffset   (sizeof(HEFS_INDEX_NODE_DIRECTORY))

◆ kHeFSMagic

#define kHeFSMagic   " HeFS"

◆ kHeFSMagicLen

#define kHeFSMagicLen   (8)

◆ kHeFSMinimumDiskSize

#define kHeFSMinimumDiskSize   (gib_cast(128))

◆ kHeFSPartNameLen

#define kHeFSPartNameLen   (128U)

◆ kHeFSSearchAllStr

#define kHeFSSearchAllStr   u8"*"

◆ kHeFSVersion

#define kHeFSVersion   (0x0103)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : UInt16
Enumerator
kHeFSEncodingFlagsUTF8 
kHeFSEncodingFlagsUTF16 
kHeFSEncodingFlagsUTF32 
kHeFSEncodingFlagsUTF16BE 
kHeFSEncodingFlagsUTF16LE 
kHeFSEncodingFlagsUTF32BE 
kHeFSEncodingFlagsUTF32LE 
kHeFSEncodingFlagsUTF8BE 
kHeFSEncodingFlagsUTF8LE 
kHeFSEncodingFlagsBinary 
kHeFSEncodingFlagsCount 
kHeFSFlagsNone 
kHeFSFlagsReadOnly 
kHeFSFlagsHidden 
kHeFSFlagsSystem 
kHeFSFlagsArchive 
kHeFSFlagsDevice 
kHeFSFlagsCount 

◆ anonymous enum

anonymous enum : UInt8
Enumerator
kHeFSHardDrive 
kHeFSSolidStateDrive 
kHeFSOpticalDrive 
kHeFSMassStorageDevice 
kHeFSScsiDrive 
kHeFSFlashDrive 
kHeFSUnknown 
kHeFSDriveCount 

◆ anonymous enum

anonymous enum : UInt8
Enumerator
kHeFSStatusUnlocked 
kHeFSStatusLocked 
kHeFSStatusError 
kHeFSStatusInvalid 
kHeFSStatusCount 

Variable Documentation

◆ kHeFSFileKindBlock

UInt16 kHeFSFileKindBlock = 0x02
inlineconstexpr

◆ kHeFSFileKindCharacter

UInt16 kHeFSFileKindCharacter = 0x03
inlineconstexpr

◆ kHeFSFileKindCount

UInt16 kHeFSFileKindCount = 0x08
inlineconstexpr

◆ kHeFSFileKindDirectory

UInt16 kHeFSFileKindDirectory = 0x01
inlineconstexpr

◆ kHeFSFileKindFIFO

UInt16 kHeFSFileKindFIFO = 0x04
inlineconstexpr

◆ kHeFSFileKindRegular

UInt16 kHeFSFileKindRegular = 0x00
inlineconstexpr

◆ kHeFSFileKindSocket

UInt16 kHeFSFileKindSocket = 0x05
inlineconstexpr

◆ kHeFSFileKindSymbolicLink

UInt16 kHeFSFileKindSymbolicLink = 0x06
inlineconstexpr

◆ kHeFSFileKindUnknown

UInt16 kHeFSFileKindUnknown = 0x07
inlineconstexpr

◆ kHeFSInvalidVID

UInt16 kHeFSInvalidVID = 0xFFFF
inlineconstexpr

◆ kHeFSSliceCount

UInt16 kHeFSSliceCount = 0x10
inlineconstexpr

HeFS blocks are array containing sparse blocks of data.

The blocks are used to store the data of a file. Each block is a pointer to a block of data on the disk.