NeKernel dev
Loading...
Searching...
No Matches
Kernel Namespace Reference

UPS inline definitions. More...

Namespaces

namespace  Qr
namespace  HAL
 Hardware Abstraction Layer.
namespace  CF
 CFKit.
namespace  HEL
namespace  Indexer
namespace  NeFS
namespace  Detail
 Implementation details namespace.
namespace  OpenHeFS
namespace  PCI
namespace  Probe
namespace  Detect
namespace  Types
namespace  Utils
namespace  DDK

Classes

class  Device
 Device type. More...
struct  GPT_PARTITION_TABLE
struct  GPT_PARTITION_ENTRY
class  Ext2Context
 Context for an EXT2 filesystem on a given drive. More...
class  Ext2FileSystemParser
class  NeFileSystemParser
class  NeFileSystemHelper
class  NeFileSystemJournal
 Journal class for NeFS. More...
struct  HEFS_BOOT_NODE
 OpenHeFS Boot node. More...
struct  HEFS_JOURNAL_NODE
 Journal Node structure. More...
struct  HEFS_INDEX_NODE
 OpenHeFS index node. More...
struct  HEFS_INDEX_NODE_DIRECTORY
 OpenHeFS directory node. More...
class  HeFileSystemParser
 OpenHeFS filesystem parser class. More...
struct  FBDevicePacket
 Framebuffer device interface packet. More...
class  NE_DEVICE< FBDevicePacket * >
 Framebuffer device interface. More...
class  RecoveryFactory
 Dumping factory class. More...
struct  HAL_HARDWARE_THREAD
 Hardware thread information structure. More...
class  BinaryMutex
 Access control class, which locks a task until one is done. More...
struct  PROCESS_HEAP_TREE
struct  PROCESS_SPECIAL_TREE
struct  PROCESS_FILE_TREE
struct  ProcessImage
 Helper class to contain a process's image and blob. More...
class  NE_DEVICE< const Char * >
class  NE_DEVICE< const Utf8Char * >
class  DeviceInterface
 Device contract interface, represents an HW device. More...
class  IOBuf
 Input Output abstract class. Used mainly to communicate between OS to hardware. More...
struct  DriveTrait
 Media drive trait type. More...
class  IMountpoint
 Mounted drives interface. More...
class  IFilesystemMgr
 Filesystem Mgr Interface class. More...
class  FileStream
struct  FILEMGR_RESTRICT
 restrict information about the file descriptor. More...
class  HardwareThread
class  HardwareThreadScheduler
class  IDylibObject
 Dylib class object. A handle to a shared library. More...
class  ILoader
 This interface is used to make loader contracts (MSCOFF, PEF). More...
class  NE_DYLIB_OBJECT
 Shared Library class Load library from this class. More...
class  KERNEL_TASK
 Equivalent of USER_PROCESS, but for kernel tasks. More...
class  KernelTaskHelper
 Equivalent of UserProcessHelper, but for kernel tasks. More...
class  LockDelegate
 Locking delegate class, hangs until limit. More...
class  DMAWrapper
class  DMAFactory
class  IOArray
class  PE32Loader
struct  PEFContainer
struct  PEFCommandHeader
class  PEFLoader
class  TimerInterface
class  SoftwareTimer
class  HardwareTimer
class  User
 System User class. More...
class  NE_VETTABLE
class  UserProcessTeam
 Processs Team (contains multiple processes inside it.) Equivalent to a process batch. More...
class  UserProcessScheduler
 USER_PROCESS scheduler class. The main class which you call to schedule user processes. More...
class  UserProcessHelper
 USER_PROCESS helper class, which contains needed utilities for the scheduler. More...
struct  ZXD_EXEC_HEADER
 ZXD executable header. More...
struct  ZXD_STUB_HEADER
 ZXD stub header. More...
class  Array
class  ArrayList
class  Atom
class  ICodec
 Encoding interface, used as a proxy to convert T to Char* Used to cast A to B or B to A. More...
class  ISchedulable
 Scheduler interface, represents a scheduler object. More...
class  ErrorOr
 ErrorOr class for error handling. More...
class  Function
 Function wrapper class. More...
class  JsonObject
 JSON object representation. More...
struct  AsciiJsonStreamReader
 JsonObject stream reader helper for ASCII. More...
class  KBasicString
 Kernel string class, not dynamic. More...
class  KStringBuilder
class  MutableArray
class  NullableMutableArray
class  MutableLinkedList
class  OwnPtr
class  NonNullRefPtr
class  PTEWrapper
struct  PageMgr
class  Pair
class  PairBuilder
class  Pmm
class  Ref
 Reference wrapper class. /// =========================================================== ///. More...
class  NonNullRef
class  Stream
class  TOMLObject
class  Variant
struct  IVet
 Vet interface for objects. More...
struct  Vettable
struct  Vettable< IVet >
class  RawIPAddress
class  RawIPAddress6
 IPv6 address. More...
class  IPFactory
 IP Creation helpers. More...
struct  IPC_ADDR
 128-bit IPC address. More...
struct  IPC_MSG
 IPC connection header, message cannot be greater than 6K. More...
class  MacAddressGetter
 This retrieves the MAC address of the device. More...
class  NE_DEVICE< NetworkDeviceCommand >
 Network device interface, establishes a connection to the NIC. More...
struct  NetworkDeviceCommand
class  NE_DEVICE< IMountpoint * >
 AHCIDeviceInterface class. More...
class  ATADeviceInterface
 ATA device interface class. More...
struct  PRDT
 Physical Region Descriptor Table. More...
class  DiskSwapInterface
 Virtual memory interface to swap memory chunks onto disk. More...
struct  SWAP_DISK_HEADER
 Swap disk header, containing information about the held virtual memory. More...
class  ChronoInterface
 a Chronometer interface used for benchmarking. More...
class  HWChrono
struct  HWChronoTraits
 BenchKit chrono logic for x64/ARM64. More...
class  BENCHKIT_INTERFACE
 hardware chronometer implementation using a trait to extract the data. More...
class  SDT
class  RSDP
class  ConfigHeader
class  ACPI_ADDRESS
class  RSDT
class  NE_POWER_FACTORY
struct  HPETAddressStructure
struct  HPETHeader
struct  IMBCIHost
 MBCI Host header. More...
struct  HAL_NVME_BAR_0
struct  HAL_NVME_QUEUE
class  PowerFactory
struct  USBCommandRegister
struct  USBStatusRegister
struct  USBInterruptEnableRegister

Concepts

concept  IVettable
 Concept version of Vettable.

Typedefs

typedef Device BootDevice
typedef Device NetworkDevice
typedef Device DiskDevice
typedef UInt64 ATime
 Access time type.
typedef UInt32 FBCoord2x2
typedef UInt32 FBDim2x2
typedef UInt32 FBColorProfile
typedef UInt32 FBFlags
typedef Kernel::Int32 hal_ap_kind
 hardware thread indentification type.
typedef struct Kernel::HAL_HARDWARE_THREAD HAL_HARDWARE_THREAD
 Hardware thread information structure.
typedef void(* rtl_start_kind) (void)
 Image process entrypoint.
typedef void(* rtl_cxx_ctor_kind) (void)
 C++ Constructor entrypoint.
typedef void(* rtl_cxx_dtor_kind) (void)
 C++ Destructor entrypoint.
using ProcessCtx = UInt32
using PTime = UInt64
using ProcessTime = PTime
using ProcessID = Int64
 Local Process Identifier type.
using ImagePtr = VoidPtr
 Helper type to describe a code image.
typedef Char rt_debug_cmd[kDebugCmdLen]
typedef DriveTraitDriveTraitPtr
 ! drive as a device.
using NodePtr = VoidPtr
using FileStreamASCII = FileStream<Char>
using FileStreamUTF8 = FileStream<Utf8Char>
using FileStreamUTF16 = FileStream<WideChar>
typedef UInt64 CursorType
using ThreadID = UInt32
typedef enum ThreadKind ThreadKind
typedef IPEFDylibObject * IDylibRef
typedef ProcessID KID
typedef Int32 KPCError
typedef BooleanLockPtr
 Lock condition pointer.
using IOArray16 = IOArray<kMaxPorts>
typedef struct Kernel::PEFContainer PEFContainer
typedef struct Kernel::PEFCommandHeader PEFCommandHeader
typedef UInt64 SemaphoreArr[kSemaphoreCount]
 Semaphore structure used for synchronization.
typedef CharUserPublicKey
typedef Char UserPublicKeyType
using ZXD_EXEC_HEADER_PTR = ZXD_EXEC_HEADER*
using ZXD_STUB_HEADER_PTR = ZXD_STUB_HEADER*
using voidPtr = void*
using VoidPtr = void*
using nullPtr = decltype(nullptr)
using NullPtr = decltype(nullptr)
using Int = int
using Int32 = __INT32_TYPE__
using UShort = __UINT16_TYPE__
using UInt16 = __UINT16_TYPE__
using Short = short
using Int16 = __INT16_TYPE__
using UInt = __UINT32_TYPE__
using UInt32 = __UINT32_TYPE__
using Long = __INT64_TYPE__
using Int64 = __INT64_TYPE__
using ULong = __UINT64_TYPE__
using UInt64 = __UINT64_TYPE__
using Boolean = bool
using Bool = bool
using Char = char
using Int8 = __INT8_TYPE__
using Char8 = char8_t
using UChar = __UINT8_TYPE__
using UInt8 = __UINT8_TYPE__
using SSize = long
using SSizeT = long
using Size = __SIZE_TYPE__
using SizeT = __SIZE_TYPE__
using IntPtr = __INTPTR_TYPE__
using UIntPtr = __UINTPTR_TYPE__
using IntFast = __INT_FAST32_TYPE__
using IntFast64 = __INT_FAST64_TYPE__
using PtrDiff = __PTRDIFF_TYPE__
using SInt16 = Int16
using SInt32 = Int32
using SInt64 = Int64
typedef UIntPtrPtr64
typedef UInt32Ptr32
typedef UInt8Ptr8
using Utf8Char = char8_t
using Utf16Char = char16_t
using WideChar = wchar_t
using Utf32Char = char32_t
using LongDouble = long double
using Double = double
using Float = float
typedef UInt32 PhysicalAddressKind
typedef UIntPtr VirtualAddressKind
using Void = void
using Any = void*
using Lba = UInt64
using Char16 = char16_t
using ErrorT = Int32
using ErrorOrAny = ErrorOr<voidPtr>
template<typename T, typename... Args>
using FunctionOr = ErrorOr<Function<T, Args...>>
using AsciiJsonStream = Stream<AsciiJsonStreamReader, JsonObject<Char>>
 AsciiJsonStream type definition.
using KString = KBasicString<>
using KStringOr = ErrorOr<KString>
template<typename T>
using OwnOr = ErrorOr<OwnPtr<T>>
template<typename T1, typename T2>
using PairOr = ErrorOr<Pair<T1, T2>>
using RefAny = Ref<Any>
using NonNullRefAny = NonNullRef<Any>
typedef struct IPC_ADDR IPC_ADDR
using TCPNetworkDevice = NetworkDevice
 TCP device.
using UDPNetworkDevice = NetworkDevice
 UDP device.
using PPPNetworkDevice = NetworkDevice
 PPP device.
using IPCNetworkDevice = NetworkDevice
 IPC device.
using GPRSNetworkDevice = NetworkDevice
 GRPS device.
using GSMNetworkDevice = NetworkDevice
 GSM device.
using BTNetworkDevice = NetworkDevice
 Bluetooth device.
using PrinterNetworkDevice = NetworkDevice
 Printer device.
using DBGNetworkDevice = NetworkDevice
 Debug device.
using LTENetworkDevice = NetworkDevice
 LTE device.
typedef SizeT rt_signal_kind
typedef ACPIFactoryInterface PowerFactoryInterface
typedef Int32 APMPowerCmd
typedef UInt32 MBCIAuthKeyType
 An AuthKey is a context used to tokenize data for an MBCI packet.
template<Int32 PacketBitLen>
using scsi_packet_type = Kernel::UInt16[PacketBitLen]
using scsi_packet_type_12 = scsi_packet_type<12>
typedef struct Kernel::USBCommandRegister USBCommandRegister
typedef struct Kernel::USBStatusRegister USBStatusRegister
typedef struct Kernel::USBInterruptEnableRegister USBInterruptEnableRegister
USER_PROCESS

USER_PROCESS class, holds information about the running process/thread.

typedef Array< USER_PROCESS, kSchedProcessLimitPerTeamUSER_PROCESS_ARRAY
typedef Ref< USER_PROCESS > USER_PROCESS_REF

Enumerations

enum  {
  kNeFSSubDriveA , kNeFSSubDriveB , kNeFSSubDriveC , kNeFSSubDriveD ,
  kNeFSSubDriveInvalid , kNeFSSubDriveCount
}
enum  { kNeFSRsrcForkKind = 0 , kNeFSDataForkKind = 1 }
 Resource fork kind. More...
enum  HeFSJournalKind : UInt8 {
  kJournalKindInvalid = 0x00 , kJournalKindWrite = 0x01 , kJournalKindRename = 0x02 , kJournalKindDelete = 0x03 ,
  kJournalKindFlagEdit = 0x04 , kJournalKindCreate = 0x05 , kJournalKindCount
}
 This enum defines the opcode of the journal, here mentioned as 'kinds'. More...
enum  { kOpenHeFSInvalidColor = 0 , kOpenHeFSRed = 100 , kOpenHeFSBlack , kOpenHeFSColorCount }
enum  CommStatus : UInt16 { kStateInvalid = 0x64 , kStateReady = 0xCF , kStateTransmit = 0xFC , kStateCnt = 3 }
enum  { kInvalidTreeKind = 0U , kRedTreeKind = 100U , kBlackTreeKind = 101U , kTreeKindCount = 3U }
enum class  ProcessSubsystem : Int32 {
  kProcessSubsystemSecurity = 100 , kProcessSubsystemUser , kProcessSubsystemService , kProcessSubsystemDriver ,
  kProcessSubsystemKernel , kProcessSubsystemCount = kProcessSubsystemKernel - kProcessSubsystemSecurity + 1 , kProcessSubsystemInvalid = 0xFFFFFFF
}
 Subsystem enum type. More...
enum class  ProcessStatusKind : Int32 {
  kInvalid = 0 , kStarting = 100 , kRunning , kKilled ,
  kFrozen , kFinished , kCount = kFinished - kStarting + 1
}
 Local Process status enum. More...
enum class  AffinityKind : Int32 {
  kInvalid = 0 , kRealTime = 100 , kVeryHigh = 150 , kHigh = 200 ,
  kStandard = 1000 , kLowUsage = 1500 , kVeryLowUsage = 2000
}
 Affinity is the amount of nano-seconds this process is going to run. More...
enum class  ProcessLevelRing : Int32 { kRingStdUser = 1 , kRingSuperUser = 2 , kRingGuestUser = 5 , kRingCount = 3 }
enum  {
  kDeviceTypeInvalid = 0 , kDeviceTypeIDE = 100 , kDeviceTypeEthernet , kDeviceTypeWiFi ,
  kDeviceTypeFW , kDeviceTypeBT , kDeviceTypeRS232 , kDeviceTypeSCSI ,
  kDeviceTypeAHCI , kDeviceTypeMBCI , kDeviceTypeATA , kDeviceTypeUSB ,
  kDeviceTypeAPM , kDeviceTypePCI , kDeviceTypeVGA , kDeviceTypeGPU ,
  kDeviceTypeCount
}
 ! More...
enum  {
  kInvalidDrive = -1 , kBlockDevice = 0xAD , kMassStorageDrive = 0xDA , kFloppyDrive = 0xCD ,
  kOpticalDrive = 0xDC , kTapeDrive = 0xD7 , kReadOnlyDrive = 0x10 , kEPMDrive = 0x11 ,
  kVEPMDrive = 0x12 , kMBRDrive = 0x13 , kGPTDrive = 0x14 , kUnformattedDrive = 0x15 ,
  kStorageCount = 9
}
enum  {
  kFileIOInvalid = 0 , kFileWriteAll = 100 , kFileReadAll = 101 , kFileReadChunk = 102 ,
  kFileWriteChunk = 103 , kFileFlagRsrc = 104 , kFileFlagData = 105 , kFileIOCnt = (kFileFlagData - kFileWriteAll) + 1
}
enum  ThreadKind {
  kAPInvalid = 0 , kAPSystemReserved = 100 , kAPStandard , kAPRealTime ,
  kAPBoot , kAPCount
}
enum  { kLockInvalid = 0 , kLockDone = 200 , kLockTimedOut = 300 , kLockCount = 3 }
enum class  DmaKind { PCI = 10 , ISA , Count = 2 , Invalid = 0 }
enum  {
  kPefArchIntel86S , kPefArchAMD64 , kPefArchRISCV , kPefArch64x0 ,
  kPefArch32x0 , kPefArchPowerPC , kPefArchARM64 , kPefArchCount = (kPefArchARM64 - kPefArchIntel86S) + 1 ,
  kPefArchInvalid = 0xFF
}
enum  {
  kPefSubArchGeneric = 0 , kPefSubArchAMD = 200 , kPefSubArchIntel , kPefSubArchARM ,
  kPefSubArchIBM
}
enum  {
  kPefKindInvalid = 0 , kPefKindExec = 1 , kPefKindDylib = 2 , kPefKindObject = 4 ,
  kPefKindDebug = 5 , kPefKindDriver = 6 , kPefKindCount
}
enum  {
  kPefInvalid = 0x0 , kPefCode = 0xC , kPefData = 0xD , kPefZero = 0xE ,
  kPefLinkerID = 0x1 , kPefCount = 4
}
enum class  UserRingKind : Int32 {
  kRingInvalid = 0 , kRingStdUser = 444 , kRingSuperUser = 666 , kRingGuestUser = 777 ,
  kRingCount = 3
}
enum  ZXD_FLAGS {
  kZXDFlagsInvalid = 0 , kZXDFlagsDriver = 120 , kZXDFlagsBoot , kZXDFlagsKernel ,
  kZXDFlagsCount = kZXDFlagsKernel - kZXDFlagsDriver + 1
}
enum class  Endian : UInt8 {
  kEndianInvalid , kEndianBig , kEndianLittle , kEndianMixed ,
  kEndianCount
}
enum  { kIPCLittleEndian = 0 , kIPCBigEndian = 1 , kIPCMixedEndian = 2 }
enum  { kIPCLockInvalid = 0 , kIPCLockFree = 1 , kIPCLockUsed = 2 }
enum  { kPRDTTransferInProgress , kPRDTTransferIsDone , kPRDTTransferCount }
 Tranfer information about PRD. More...
enum  ACPI_ADDRESS_SPACE_KIND : UInt8 {
  eSystemMemory = 0 , eSystemIO = 1 , ePci = 2 , eController = 3 ,
  eSmBus = 4 , eCount = 5 , eInvalid = 0xFF
}
enum  {
  kAPMPowerCommandInvalid = 0x00 , kAPMPowerCommandStop = 0x01 , kAPMPowerCommandStart = 0x02 , kAPMPowerCommandSleep = 0x04 ,
  kAPMPowerCommandWakeup = 0x06 , kAPMPowerCommandShutdown = 0x07 , kAPMPowerCommandReboot = 0x08
}
enum  { kMBCISpeedDeviceInvalid , kMBCILowSpeedDevice , kMBCIHighSpeedDevice , kMBCISpeedDeviceCount }
enum  MBCIHostFlags {
  kMBCIHostFlagsSupportsNothing , kMBCIHostFlagsSupportsAPM , kMBCIHostFlagsSupportsDaisyChain , kMBCIHostFlagsSupportsHWInterrupts ,
  kMBCIHostFlagsSupportsDMA , kMBCIHostFlagsExtended
}
 MBCI host flags. More...
enum  MBCIHostKind {
  kMBCIHostKindHardDisk , kMBCIHostKindOpticalDisk , kMBCIHostKindKeyboardLow , kMBCIHostKindMouseLow ,
  kMBCIHostKindMouseHigh , kMBCIHostKindKeyboardHigh , kMBCIHostKindNetworkInterface , kMBCIHostKindDaisyChain ,
  kMBCIHostKindStartExtended
}
 MBCI host kind. More...
enum  MBCIHostState {
  kMBCIHostStateInvalid , kMBCIHostStateReset , kMBCIHostStateSuccess , kMBCIHostStateReady ,
  kMBCIHostStateDmaStart , kMBCIHostStateDmaEnd , kMBCIHostStateFail , kMBCIHostStateCount
}
enum  {
  kInvalidNVME = 0xFF , kCreateCompletionQueueNVME = 0x05 , kCreateSubmissionQueueNVME = 0x01 , kIdentifyNVME = 0x06 ,
  kReadNVME = 0x02 , kWriteNVME = 0x01 , kCountNVME = 5
}

Functions

SizeT rt_hash_seed (const Char *seed, UInt32 mul)
template<typename DataKind>
Void ke_dma_write (UIntPtr base, DataKind reg, DataKind value)
 write to mapped memory register
template<typename DataKind>
UInt32 ke_dma_read (UIntPtr base, DataKind reg)
 read from mapped memory register.
VoidPtr rtl_dma_alloc (SizeT size, SizeT align)
 allocate from the rtl_dma_alloc system.
Void rtl_dma_free (SizeT size)
 Free DMA pointer.
Void rtl_dma_flush (VoidPtr ptr, SizeT size_buffer)
 Flush DMA pointer.
BOOL ext2_read_block (Kernel::DriveTrait *drv, Kernel::UInt32 lba, VoidPtr buffer, Kernel::UInt32 size)
BOOL ext2_write_block (Kernel::DriveTrait *drv, Kernel::UInt32 lba, const VoidPtr buffer, Kernel::UInt32 size)
Kernel::ErrorOr< EXT2_SUPER_BLOCK * > ext2_load_superblock (Ext2Context *ctx)
Kernel::ErrorOr< Ext2Node * > ext2_load_inode (Ext2Context *ctx, Kernel::UInt32 inodeNumber)
EXTERN_C void ke_utf_io_write (DeviceInterface< const Utf8Char * > *obj, const Utf8Char *bytes)
EXTERN_C void ke_io_write (DeviceInterface< const Char * > *obj, const Char *bytes)
EXTERN_C void ke_io_read (DeviceInterface< const Char * > *, const Char *bytes)
Void ke_panic (const Kernel::Int32 &id, const Char *message)
 Stops execution of the kernel.
void ke_runtime_check (bool expr, const Char *file, const Char *line)
EXTERN_C Void __ne_pure_call (USER_PROCESS *process)
 Unimplemented function (crashes by default).
EXTERN_C Bool hal_check_task (HAL::StackFramePtr stack_ptr)
 Validate user stack.
Void mp_wakeup_thread (HAL::StackFrame *stack)
 Wakes up thread. Wakes up thread from the hang state.
Void mp_hang_thread (HAL::StackFrame *stack)
 makes the thread sleep on a loop. hooks and hangs thread to prevent code from executing.
 ENUM_STRING (Qemu, "TCGTCGTCGTCG")
 ENUM_STRING (KVM, " KVMKVMKVM ")
 ENUM_STRING (VMWare, "VMwareVMware")
 ENUM_STRING (VirtualBox, "VBoxVBoxVBox")
 ENUM_STRING (Xen, "XenVMMXenVMM")
 ENUM_STRING (Microsoft, "Microsoft Hv")
 ENUM_STRING (Parallels, " prl hyperv ")
 ENUM_STRING (ParallelsAlt, " lrpepyh vr ")
 ENUM_STRING (Bhyve, "bhyve bhyve ")
 ENUM_STRING (Qnx, " QNXQVMBSQG ")
UInt16 sk_init_ahci_device (BOOL atapi)
 Initialize an AHCI device (StorageKit).
ErrorOr< AHCIDeviceInterface > sk_acquire_ahci_device (UInt32 drv_index)
 Acquires a new AHCI device with drv_index in mind.
BOOL sk_init_ata_device (BOOL is_master, UInt16 &io, UInt8 &master)
 Initialize an PIO device (StorageKit function).
ErrorOr< ATADeviceInterfacesk_acquire_ata_device (Int32 drv_index)
 Acquires a new PIO device with drv_index in mind.
Void mp_init_cores (Void)
 Initialize the Global Interrupt Controller.
EXTERN_C HAL::StackFramePtr mp_get_current_task (ProcessID thrdid)
 Get current stack frame for a thread.
EXTERN_C Bool mp_register_task (HAL::StackFramePtr stack_frame, ProcessID thrdid)
 Register current stack frame for a thread.
EXTERN_C Kernel::Void hal_set_pc_to_hart (HAL_HARDWARE_THREAD *hart, Kernel::VoidPtr epc)
 Set PC to specific hart.
BOOL rtl_create_kernel_task (HAL::StackFramePtr main, const KID kid)
 Executes a new process from a function. Kernel code only.
ProcessID rtl_create_user_process (rtl_start_kind main, const Char *process_name)
 Executes a new process from a function. User code only.
bool operator< (AffinityKind lhs, AffinityKind rhs)
 Operators for AffinityKind.
bool operator> (AffinityKind lhs, AffinityKind rhs)
bool operator<= (AffinityKind lhs, AffinityKind rhs)
bool operator>= (AffinityKind lhs, AffinityKind rhs)
TerminalDevice end_line ()
TerminalDevice number (const Long &x)
TerminalDevice hex_number (const Long &x)
Utf8TerminalDevice utf_end_line ()
TerminalDevice carriage_return ()
TerminalDevice tabulate ()
TerminalDevice bell ()
 emulate a terminal bell, like the VT100 does.
TerminalDevice get_console_in (Char *buf)
TerminalDevice & operator<< (TerminalDevice &src, const Long &num)
Void io_drv_unimplemented (DriveTrait::DrivePacket *pckt)
 Unimplemented drive.
const Chario_drv_kind (Void)
 Gets the drive kind (ATA, SCSI, AHCI...).
DriveTrait io_construct_blank_drive (Void)
 Makes a new drive.
Void io_construct_main_drive (DriveTrait &trait)
 Fetches the main drive.
DriveTrait io_construct_main_drive (Void)
 Fetches the main drive.
Void io_drv_input (DriveTrait::DrivePacket pckt)
Void io_drv_output (DriveTrait::DrivePacket pckt)
Int32 mm_free_ptr (VoidPtr heap_ptr)
 Declare pointer as free.
Boolean mm_is_valid_ptr (VoidPtr heap_ptr)
 Check if pointer is a valid Kernel pointer.
VoidPtr mm_alloc_ptr (SizeT sz, Bool wr, Bool user, SizeT pad_amount=0)
 Allocate chunk of memory.
Boolean mm_protect_ptr (VoidPtr heap_ptr)
 Protect the heap with a CRC value.
Int32 mm_make_page (VoidPtr heap_ptr)
 Makes a Kernel page.
Int32 mm_set_ptr_flags (VoidPtr heap_ptr, UInt64 flags)
 Overwrites and set the flags of a heap header.
UInt64 mm_get_ptr_flags (VoidPtr heap_ptr)
 Gets the flags of a heap header.
template<typename T, typename... Args>
BOOL mm_new_class (_Input _Output T **cls, _Input Args &&... args)
 Allocate C++ class.
template<typename T>
Void mm_delete_class (_Input _Output T **cls)
 Delete and nullify C++ class.
EXTERN_C void __ne_pure_call (void)
 Pure implementation, missing method/function handler.
Int32 fs_ifs_read (IMountpoint *Mnt, DriveTrait &DrvTrait, Int32 DrvIndex)
 Read from IFS disk.
Int32 fs_ifs_write (IMountpoint *Mnt, DriveTrait &DrvTrait, Int32 DrvIndex)
 Write to IFS disk.
EXTERN_C IDylibRef rtl_init_dylib_pef (USER_PROCESS &header)
EXTERN_C Void rtl_fini_dylib_pef (USER_PROCESS &header, IDylibRef lib, Bool *successful)
Boolean err_bug_check_raise (Void)
 Does a system wide bug check.
template<SizeT Sz>
Array< UShort, Sz > make_ports (UShort base)
BOOL rtl_sem_is_valid (const SemaphoreArr &sem, UInt64 owner=0)
 Checks if the semaphore is valid.
BOOL rtl_sem_release (SemaphoreArr &sem)
 Releases the semaphore, resetting its owner and count.
BOOL rtl_sem_acquire (SemaphoreArr &sem, UInt64 owner)
 Initializes the semaphore with an owner and a count of zero.
BOOL rtl_sem_wait (SemaphoreArr &sem, UInt64 owner, UInt64 timeout, BOOL *condition=nullptr)
 Waits for the semaphore to be available, blocking until it is.
UInt64 rtl_microseconds (UInt64 time)
UInt64 rtl_milliseconds (UInt64 time)
template<typename ValueType>
auto make_list (ValueType val)
template<typename ValueType>
ArrayList< ValueType > make_list (ValueType val)
template<typename Args>
Args && forward (Args &arg)
 Forward object.
template<typename Args>
Args && move (Args &&arg)
 Move object.
UInt32 ke_calculate_crc32 (const VoidPtr inp, Int32 len)
 Calculate CRC32 of p.
template<typename CharKind>
void ort_string_append (CharKind *lhs, const CharKind *rhs, Int32 cur)
template<typename T, typename... Args>
OwnPtr< T > make_ptr (Args &&... args)
Int rt_copy_memory (const voidPtr src, voidPtr dst, Size len)
 ASCII API =========================================================== ///.
Int rt_move_memory (const voidPtr src, voidPtr dst, Size len)
voidPtr rt_set_memory (voidPtr dst, UInt32 val, Size len)
void rt_zero_memory (voidPtr pointer, Size len)
Int rt_string_cmp (const Char *src, const Char *cmp, Size len)
const Charrt_alloc_string (const Char *text)
Size rt_string_len (const Char *str)
Size rt_string_len (const Char *str, SizeT _len)
Boolean rt_to_string (Char *str_out, UInt64 base, Int32 limit)
Boolean rt_is_newln (Int chr)
Boolean rt_is_space (Int chr)
Int32 rt_is_alnum (Int character)
Int rt_to_uppercase (Int c)
Int rt_to_lower (Int c)
voidPtr rt_string_in_string (const Char *in, const Char *needle)
char * rt_string_has_char (Char *str, Char chr)
Int rt_copy_memory_safe (const voidPtr src, voidPtr dst, Size len, Size dst_size)
 Safe memory functions API =========================================================== ///.
voidPtr rt_set_memory_safe (voidPtr dst, UInt32 value, Size len, Size dst_size)
Int urt_string_cmp (const Utf8Char *src, const Utf8Char *cmp, Size len)
 UNICODE API =========================================================== ///.
Void urt_set_memory (const voidPtr src, UInt32 dst, Size len)
Int urt_copy_memory (const voidPtr src, voidPtr dst, Size len)
Size urt_string_len (const Utf8Char *str)
template<typename CharType = Char>
SizeT oe_string_len (const CharType *str)
 OpenEncoding API =========================================================== ///.
struct Kernel::IPC_MSG ALIGN (8) IPC_MSG
 IPC connection header, message cannot be greater than 6K.
BOOL ipc_sanitize_packet (_Input IPC_MSG *pckt_in)
 Sanitize packet function.
BOOL ipc_construct_packet (_Output _Input IPC_MSG **pckt_in)
 Construct packet function.
template<rt_signal_kind Sig, SizeT Seed = kUserSignalSeed>
rt_signal_kind sig_generate_unique ()
 Generate signal from Sig.
template<SizeT Seed>
BOOL sig_matches_seed (rt_signal_kind sig)
 Checks if the signal matches the seed (user_seed or kernel_seed).
BOOL sig_validate_unique (rt_signal_kind sig)
 Validate signal from sig and whtether the signal is greater than SIGDTCH.
Char rt_to_char (UInt64 value, Int32 base)
Void io_drv_input (DriveTrait::DrivePacket &pckt)
 reads from an ATA drive.
Void io_drv_output (DriveTrait::DrivePacket &pckt)
 Writes to an ATA drive.
Void io_drv_init (DriveTrait::DrivePacket &pckt)
 Executes a disk check on the ATA drive.
Void io_drv_unimplemented (DriveTrait::DrivePacket &pckt)
 Unimplemented drive function.
DriveTrait io_construct_blank_drive ()
 Makes a new drive.
DriveTrait io_construct_main_drive ()
 Fetches the main drive.
EXTERN_C Void hal_switch_kernel_task (HAL::StackFramePtr frame, KID kid)
Bool ipc_int_sanitize_packet (IPC_MSG *pckt)
Bool ipc_sanitize_packet (IPC_MSG *pckt)
 Sanitize packet function.
Bool ipc_construct_packet (_Output IPC_MSG **pckt_in)
 Construct packet function.
void construct_prdt (Ref< PRDT > &prd)
 constructs a new PRD.
template<typename T>
STATIC T * sched_try_go_upper_ptr_tree (T *tree)
 Allocate pointer to heap tree.
template<typename T>
STATIC Void sched_free_ptr_tree (T *tree)
 Free heap tree.
EXTERN_C Int32 apm_send_io_command (UInt16 cmd)
 Send a APM command into it's controller. (Shutdown, Reboot, Sleep...).
BOOL busi_test_mmio (_Input struct IMBCIHost *host, _Input const UInt32 test)
MBCIAuthKeyType mbci_read_auth_key (_Input struct IMBCIHost *host)
 Read Auth key for MBCI host.
template<Int32 Opcode>
Bool nvme_create_admin_command (HAL_NVME_QUEUE *entry, UInt32 nsid, UInt32 prpTransfer[3], UInt32 startingLba[2], UInt32 lowTransferBlocks)
 Creates an admin command for a DMA operation.
template<Int32 Opcode>
Bool nvme_create_io_command (HAL_NVME_QUEUE *entry, UInt64 baseAddress, UInt32 identLoAndQueueSizeHi, UInt32 flagsLoAndQueueComplIdHi, UInt32 identify, Bool provideIdentify=false, Bool namespaceIdentify=false)
 Creates an I/O command for a DMA operation.
HardwareThreadScheduler

Class to manage the thread scheduling.

void mp_wakeup_thread (HAL::StackFramePtr stack)
 wakes up thread. wakes up thread from hang.
void mp_hang_thread (HAL::StackFramePtr stack)
 makes thread sleep. hooks and hangs thread to prevent code from executing.

Variables

UInt8kDmaPoolPtr = (UInt8*) kNeDMAPoolStart
 DMA pool base pointer, here we're sure that AHCI or whatever tricky standard sees it.
const UInt8kDmaPoolEnd = (UInt8*) (kNeDMAPoolStart + kNeDMAPoolSize)
constexpr ATime kOpenHeFSTimeInvalid = 0x0000000000000000
constexpr ATime kOpenHeFSTimeMax = 0xFFFFFFFFFFFFFFFF - 1
STATIC HAL_HARDWARE_THREAD kHWThread [kMaxAPInsideSched] = {{nullptr}}
constexpr auto kDebugPort = 51820
constexpr auto kDebugMagic = "VMK1.0.0;"
constexpr auto kDebugVersion = 0x0100
constexpr SizeT kDebugCmdLen = 256U
STATIC const auto kRestrictStrLen = 8U
KPCError kErrorLocalNumber = 0UL
constexpr KPCError kErrorSuccess = 0
constexpr KPCError kErrorExecutable = 33
constexpr KPCError kErrorExecutableLib = 34
constexpr KPCError kErrorFileNotFound = 35
constexpr KPCError kErrorDirectoryNotFound = 36
constexpr KPCError kErrorDiskReadOnly = 37
constexpr KPCError kErrorDiskIsFull = 38
constexpr KPCError kErrorProcessFault = 39
constexpr KPCError kErrorSocketHangUp = 40
constexpr KPCError kErrorThreadLocalStorage = 41
constexpr KPCError kErrorMath = 42
constexpr KPCError kErrorNoNetwork = 43
constexpr KPCError kErrorHeapOutOfMemory = 44
constexpr KPCError kErrorNoSuchDisk = 45
constexpr KPCError kErrorFileExists = 46
constexpr KPCError kErrorFormatFailed = 47
constexpr KPCError kErrorNetworkTimeout = 48
constexpr KPCError kErrorInternal = 49
constexpr KPCError kErrorForkAlreadyExists = 50
constexpr KPCError kErrorOutOfTeamSlot = 51
constexpr KPCError kErrorHeapNotPresent = 52
constexpr KPCError kErrorNoEntrypoint = 53
constexpr KPCError kErrorDiskIsCorrupted = 54
constexpr KPCError kErrorDisk = 55
constexpr KPCError kErrorInvalidData = 56
constexpr KPCError kErrorAsync = 57
constexpr KPCError kErrorNonBlocking = 58
constexpr KPCError kErrorIPC = 59
constexpr KPCError kErrorSign = 60
constexpr KPCError kErrorInvalidCreds = 61
constexpr KPCError kErrorCDTrayBroken = 62
constexpr KPCError kErrorUnrecoverableDisk = 63
constexpr KPCError kErrorFileLocked = 64
constexpr KPCError kErrorDiskIsTooTiny = 65
constexpr KPCError kErrorDmaExhausted = 66
constexpr KPCError kErrorOutOfBitMapMemory = 67
constexpr KPCError kErrorTimeout = 68
constexpr KPCError kErrorAccessDenied = 69
constexpr KPCError kErrorUnavailable = 70
constexpr KPCError kErrorUnimplemented = -1
 Generic errors.
constexpr UInt16 kMaxPorts = 16
constexpr Int16 kTimeUnit = 1000
UserkCurrentUser = nullptr
UserkRootUser = nullptr
constexpr Int kMinimumStringSize = 8196
constexpr auto kIPCMsgSize = 6094U
constexpr auto kUserSignalSeed = 0x0895034fUL
 Standard signal seed for general purpose usage.
constexpr auto kKernelSignalSeed = 0x0895034f9fUL
 Special signal seed for kernel usage.
constexpr STATIC const auto kMinACPIVer = 1U
UInt32 kChecksumPolys [kCrcCnt]
 The CRC32 seed table.
STATIC IFilesystemMgrkMountedFilesystem = nullptr
STATIC HardwareThreadScheduler kHardwareThreadScheduler
STATIC PageMgr kPageMgr
STATIC Bool kRaiseOnBugCheck = false
EXTERN_C Int32 kPRDTTransferStatus
const scsi_packet_type_12 kCDRomPacketTemplate

PE32Loader

PE32+ loader class.

enum  { kPEPlatformInvalid , kPEPlatformAMD64 = 100 , kPEPlatformARM64 }
enum  { kPETypeInvalid , kPETypeText = 100 , kPETypeData , kPETypeBSS }
typedef LDR_SECTION_HEADER PE_SECTION_INFO
ProcessID rtl_create_user_process (PE32Loader &exec, const Int32 &process_kind)

Detailed Description

UPS inline definitions.

! BUGS: 0

!

Signal Generation API.

The Kernel namespace.

Note
This applies only if we compile with AHCI as a default disk driver.
Author
Amlal El Mahrouss (amlal.nosp@m.@nek.nosp@m.ernel.nosp@m..org)
Date
Tue Apr 22 22:01:07 CEST 2025
Note
Can either work with: Ethernet, GPRS, WiFi
Author
Amlal El Mahrouss
Amlal El Mahrouss (amlal.nosp@m.@nek.nosp@m.ernel.nosp@m..org)

Typedef Documentation

◆ Any

using Kernel::Any = void*

◆ APMPowerCmd

◆ AsciiJsonStream

AsciiJsonStream type definition.

================================================================================

autotoc_md113

◆ ATime

Access time type.

Used to keep track of the INode, INodeDir allocation status.

◆ Bool

using Kernel::Bool = bool

◆ Boolean

using Kernel::Boolean = bool

◆ BootDevice

◆ BTNetworkDevice

Bluetooth device.

◆ Char

using Kernel::Char = char

◆ Char16

using Kernel::Char16 = char16_t

◆ Char8

◆ CursorType

◆ DBGNetworkDevice

Debug device.

◆ DiskDevice

◆ Double

using Kernel::Double = double

◆ DriveTraitPtr

! drive as a device.

◆ ErrorOrAny

◆ ErrorT

◆ FBColorProfile

◆ FBCoord2x2

◆ FBDim2x2

◆ FBFlags

◆ FileStreamASCII

◆ FileStreamUTF16

◆ FileStreamUTF8

◆ Float

using Kernel::Float = float

◆ FunctionOr

template<typename T, typename... Args>
using Kernel::FunctionOr = ErrorOr<Function<T, Args...>>

◆ GPRSNetworkDevice

◆ GSMNetworkDevice

◆ hal_ap_kind

hardware thread indentification type.

◆ HAL_HARDWARE_THREAD

typedef struct Kernel::HAL_HARDWARE_THREAD Kernel::HAL_HARDWARE_THREAD

Hardware thread information structure.

◆ IDylibRef

typedef IPEFDylibObject* Kernel::IDylibRef

◆ ImagePtr

Helper type to describe a code image.

◆ Int

using Kernel::Int = int

◆ Int16

using Kernel::Int16 = __INT16_TYPE__

◆ Int32

using Kernel::Int32 = __INT32_TYPE__

◆ Int64

using Kernel::Int64 = __INT64_TYPE__

◆ Int8

using Kernel::Int8 = __INT8_TYPE__

◆ IntFast

using Kernel::IntFast = __INT_FAST32_TYPE__

◆ IntFast64

using Kernel::IntFast64 = __INT_FAST64_TYPE__

◆ IntPtr

using Kernel::IntPtr = __INTPTR_TYPE__

◆ IOArray16

◆ IPC_ADDR

typedef struct IPC_ADDR Kernel::IPC_ADDR

◆ IPCNetworkDevice

◆ KID

◆ KPCError

◆ KString

◆ KStringOr

◆ Lba

◆ LockPtr

Lock condition pointer.

◆ Long

using Kernel::Long = __INT64_TYPE__

◆ LongDouble

using Kernel::LongDouble = long double

◆ LTENetworkDevice

◆ MBCIAuthKeyType

An AuthKey is a context used to tokenize data for an MBCI packet.

◆ NetworkDevice

◆ NodePtr

◆ NonNullRefAny

◆ NullPtr

using Kernel::NullPtr = decltype(nullptr)

◆ nullPtr

using Kernel::nullPtr = decltype(nullptr)

◆ OwnOr

template<typename T>
using Kernel::OwnOr = ErrorOr<OwnPtr<T>>

◆ PairOr

template<typename T1, typename T2>
using Kernel::PairOr = ErrorOr<Pair<T1, T2>>

◆ PE_SECTION_INFO

◆ PEFCommandHeader

typedef struct Kernel::PEFCommandHeader Kernel::PEFCommandHeader

◆ PEFContainer

typedef struct Kernel::PEFContainer Kernel::PEFContainer

◆ PhysicalAddressKind

◆ PowerFactoryInterface

typedef ACPIFactoryInterface Kernel::PowerFactoryInterface

◆ PPPNetworkDevice

◆ PrinterNetworkDevice

◆ ProcessCtx

◆ ProcessID

Local Process Identifier type.

◆ ProcessTime

◆ PTime

◆ Ptr32

◆ Ptr64

◆ Ptr8

typedef UInt8* Kernel::Ptr8

◆ PtrDiff

using Kernel::PtrDiff = __PTRDIFF_TYPE__

◆ RefAny

◆ rt_debug_cmd

typedef Char Kernel::rt_debug_cmd[kDebugCmdLen]

◆ rt_signal_kind

◆ rtl_cxx_ctor_kind

typedef void(* Kernel::rtl_cxx_ctor_kind) (void)

C++ Constructor entrypoint.

◆ rtl_cxx_dtor_kind

typedef void(* Kernel::rtl_cxx_dtor_kind) (void)

C++ Destructor entrypoint.

◆ rtl_start_kind

typedef void(* Kernel::rtl_start_kind) (void)

Image process entrypoint.

◆ scsi_packet_type

template<Int32 PacketBitLen>
using Kernel::scsi_packet_type = Kernel::UInt16[PacketBitLen]

◆ scsi_packet_type_12

◆ SemaphoreArr

typedef UInt64 Kernel::SemaphoreArr[kSemaphoreCount]

Semaphore structure used for synchronization.

◆ Short

using Kernel::Short = short

◆ SInt16

◆ SInt32

◆ SInt64

◆ Size

using Kernel::Size = __SIZE_TYPE__

◆ SizeT

using Kernel::SizeT = __SIZE_TYPE__

◆ SSize

using Kernel::SSize = long

◆ SSizeT

using Kernel::SSizeT = long

◆ TCPNetworkDevice

◆ ThreadID

◆ ThreadKind

◆ UChar

using Kernel::UChar = __UINT8_TYPE__

◆ UDPNetworkDevice

◆ UInt

using Kernel::UInt = __UINT32_TYPE__

◆ UInt16

using Kernel::UInt16 = __UINT16_TYPE__

◆ UInt32

using Kernel::UInt32 = __UINT32_TYPE__

◆ UInt64

using Kernel::UInt64 = __UINT64_TYPE__

◆ UInt8

using Kernel::UInt8 = __UINT8_TYPE__

◆ UIntPtr

using Kernel::UIntPtr = __UINTPTR_TYPE__

◆ ULong

using Kernel::ULong = __UINT64_TYPE__

◆ USBCommandRegister

typedef struct Kernel::USBCommandRegister Kernel::USBCommandRegister

◆ USBInterruptEnableRegister

typedef struct Kernel::USBInterruptEnableRegister Kernel::USBInterruptEnableRegister

◆ USBStatusRegister

typedef struct Kernel::USBStatusRegister Kernel::USBStatusRegister

◆ USER_PROCESS_ARRAY

◆ USER_PROCESS_REF

typedef Ref<USER_PROCESS> Kernel::USER_PROCESS_REF

◆ UserPublicKey

◆ UserPublicKeyType

◆ UShort

using Kernel::UShort = __UINT16_TYPE__

◆ Utf16Char

using Kernel::Utf16Char = char16_t

◆ Utf32Char

using Kernel::Utf32Char = char32_t

◆ Utf8Char

◆ VirtualAddressKind

◆ Void

using Kernel::Void = void

◆ VoidPtr

using Kernel::VoidPtr = void*

◆ voidPtr

using Kernel::voidPtr = void*

◆ WideChar

using Kernel::WideChar = wchar_t

◆ ZXD_EXEC_HEADER_PTR

◆ ZXD_STUB_HEADER_PTR

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kPefSubArchGeneric 
kPefSubArchAMD 
kPefSubArchIntel 
kPefSubArchARM 
kPefSubArchIBM 

◆ anonymous enum

anonymous enum
Enumerator
kPETypeInvalid 
kPETypeText 
kPETypeData 
kPETypeBSS 

◆ anonymous enum

anonymous enum
Enumerator
kInvalidDrive 
kBlockDevice 

Storage types, combine with flags.

kMassStorageDrive 
kFloppyDrive 
kOpticalDrive 
kTapeDrive 
kReadOnlyDrive 

Storage flags, combine with types.

kEPMDrive 
kVEPMDrive 
kMBRDrive 
kGPTDrive 
kUnformattedDrive 
kStorageCount 

◆ anonymous enum

anonymous enum
Enumerator
kLockInvalid 
kLockDone 
kLockTimedOut 
kLockCount 

◆ anonymous enum

anonymous enum

Tranfer information about PRD.

Enumerator
kPRDTTransferInProgress 
kPRDTTransferIsDone 
kPRDTTransferCount 

◆ anonymous enum

anonymous enum

Resource fork kind.

Enumerator
kNeFSRsrcForkKind 
kNeFSDataForkKind 

◆ anonymous enum

anonymous enum
Enumerator
kPefInvalid 
kPefCode 
kPefData 
kPefZero 
kPefLinkerID 
kPefCount 

◆ anonymous enum

anonymous enum
Enumerator
kInvalidTreeKind 
kRedTreeKind 
kBlackTreeKind 
kTreeKindCount 

◆ anonymous enum

anonymous enum
Enumerator
kAPMPowerCommandInvalid 
kAPMPowerCommandStop 
kAPMPowerCommandStart 
kAPMPowerCommandSleep 
kAPMPowerCommandWakeup 
kAPMPowerCommandShutdown 
kAPMPowerCommandReboot 

◆ anonymous enum

anonymous enum

!

Device enum types.

Enumerator
kDeviceTypeInvalid 
kDeviceTypeIDE 
kDeviceTypeEthernet 
kDeviceTypeWiFi 
kDeviceTypeFW 
kDeviceTypeBT 
kDeviceTypeRS232 
kDeviceTypeSCSI 
kDeviceTypeAHCI 
kDeviceTypeMBCI 
kDeviceTypeATA 
kDeviceTypeUSB 
kDeviceTypeAPM 
kDeviceTypePCI 
kDeviceTypeVGA 
kDeviceTypeGPU 
kDeviceTypeCount 

◆ anonymous enum

anonymous enum
Enumerator
kPefArchIntel86S 
kPefArchAMD64 
kPefArchRISCV 
kPefArch64x0 
kPefArch32x0 
kPefArchPowerPC 
kPefArchARM64 
kPefArchCount 
kPefArchInvalid 

◆ anonymous enum

anonymous enum
Enumerator
kFileIOInvalid 
kFileWriteAll 
kFileReadAll 
kFileReadChunk 
kFileWriteChunk 
kFileFlagRsrc 
kFileFlagData 
kFileIOCnt 

◆ anonymous enum

anonymous enum
Enumerator
kMBCISpeedDeviceInvalid 
kMBCILowSpeedDevice 
kMBCIHighSpeedDevice 
kMBCISpeedDeviceCount 

◆ anonymous enum

anonymous enum
Enumerator
kOpenHeFSInvalidColor 
kOpenHeFSRed 
kOpenHeFSBlack 
kOpenHeFSColorCount 

◆ anonymous enum

anonymous enum
Enumerator
kIPCLockInvalid 
kIPCLockFree 
kIPCLockUsed 

◆ anonymous enum

anonymous enum
Enumerator
kPefKindInvalid 
kPefKindExec 
kPefKindDylib 
kPefKindObject 
kPefKindDebug 
kPefKindDriver 
kPefKindCount 

◆ anonymous enum

anonymous enum
Enumerator
kIPCLittleEndian 
kIPCBigEndian 
kIPCMixedEndian 

◆ anonymous enum

anonymous enum
Enumerator
kInvalidNVME 
kCreateCompletionQueueNVME 
kCreateSubmissionQueueNVME 
kIdentifyNVME 
kReadNVME 
kWriteNVME 
kCountNVME 

◆ anonymous enum

anonymous enum
Enumerator
kNeFSSubDriveA 
kNeFSSubDriveB 
kNeFSSubDriveC 
kNeFSSubDriveD 
kNeFSSubDriveInvalid 
kNeFSSubDriveCount 

◆ anonymous enum

anonymous enum
Enumerator
kPEPlatformInvalid 
kPEPlatformAMD64 
kPEPlatformARM64 

◆ ACPI_ADDRESS_SPACE_KIND

Enumerator
eSystemMemory 
eSystemIO 
ePci 
eController 
eSmBus 
eCount 
eInvalid 

◆ AffinityKind

enum class Kernel::AffinityKind : Int32
strong

Affinity is the amount of nano-seconds this process is going to run.

Enumerator
kInvalid 
kRealTime 
kVeryHigh 
kHigh 
kStandard 
kLowUsage 
kVeryLowUsage 

◆ CommStatus

Enumerator
kStateInvalid 
kStateReady 
kStateTransmit 
kStateCnt 

◆ DmaKind

enum class Kernel::DmaKind
strong
Enumerator
PCI 
ISA 
Count 
Invalid 

◆ Endian

enum class Kernel::Endian : UInt8
strong
Enumerator
kEndianInvalid 
kEndianBig 
kEndianLittle 
kEndianMixed 
kEndianCount 

◆ HeFSJournalKind

This enum defines the opcode of the journal, here mentioned as 'kinds'.

Enumerator
kJournalKindInvalid 
kJournalKindWrite 
kJournalKindRename 
kJournalKindDelete 
kJournalKindFlagEdit 
kJournalKindCreate 
kJournalKindCount 

◆ MBCIHostFlags

MBCI host flags.

Enumerator
kMBCIHostFlagsSupportsNothing 
kMBCIHostFlagsSupportsAPM 
kMBCIHostFlagsSupportsDaisyChain 
kMBCIHostFlagsSupportsHWInterrupts 
kMBCIHostFlagsSupportsDMA 
kMBCIHostFlagsExtended 

◆ MBCIHostKind

MBCI host kind.

Enumerator
kMBCIHostKindHardDisk 
kMBCIHostKindOpticalDisk 
kMBCIHostKindKeyboardLow 
kMBCIHostKindMouseLow 
kMBCIHostKindMouseHigh 
kMBCIHostKindKeyboardHigh 
kMBCIHostKindNetworkInterface 
kMBCIHostKindDaisyChain 
kMBCIHostKindStartExtended 

◆ MBCIHostState

Enumerator
kMBCIHostStateInvalid 
kMBCIHostStateReset 
kMBCIHostStateSuccess 
kMBCIHostStateReady 
kMBCIHostStateDmaStart 
kMBCIHostStateDmaEnd 
kMBCIHostStateFail 
kMBCIHostStateCount 

◆ ProcessLevelRing

enum class Kernel::ProcessLevelRing : Int32
strong
Note
For User manager, tells where we run the code.
Enumerator
kRingStdUser 
kRingSuperUser 
kRingGuestUser 
kRingCount 

◆ ProcessStatusKind

enum class Kernel::ProcessStatusKind : Int32
strong

Local Process status enum.

Enumerator
kInvalid 
kStarting 
kRunning 
kKilled 
kFrozen 
kFinished 
kCount 

◆ ProcessSubsystem

enum class Kernel::ProcessSubsystem : Int32
strong

Subsystem enum type.

Enumerator
kProcessSubsystemSecurity 
kProcessSubsystemUser 
kProcessSubsystemService 
kProcessSubsystemDriver 
kProcessSubsystemKernel 
kProcessSubsystemCount 
kProcessSubsystemInvalid 

◆ ThreadKind

Enumerator
kAPInvalid 
kAPSystemReserved 
kAPStandard 
kAPRealTime 
kAPBoot 
kAPCount 

◆ UserRingKind

enum class Kernel::UserRingKind : Int32
strong
Enumerator
kRingInvalid 
kRingStdUser 
kRingSuperUser 
kRingGuestUser 
kRingCount 

◆ ZXD_FLAGS

Enumerator
kZXDFlagsInvalid 
kZXDFlagsDriver 
kZXDFlagsBoot 
kZXDFlagsKernel 
kZXDFlagsCount 

Function Documentation

◆ __ne_pure_call() [1/2]

EXTERN_C Void Kernel::__ne_pure_call ( USER_PROCESS * process)

Unimplemented function (crashes by default).

Parameters
processThe process handle.

◆ __ne_pure_call() [2/2]

EXTERN_C void Kernel::__ne_pure_call ( void )

Pure implementation, missing method/function handler.

◆ ALIGN()

struct Kernel::SWAP_DISK_HEADER Kernel::ALIGN ( 8 )

IPC connection header, message cannot be greater than 6K.

Swap disk header, containing information about the held virtual memory.

Parameters
fMagicIdent number.
fHeaderSzThis header size.
fTeamIDProcess Team ID.
fProcessIDProcess ID.
fVirtualAddressVirtual address pointed by data.
fBlobSzBlob's size.
fBlobData blob.

◆ apm_send_io_command()

EXTERN_C Int32 Kernel::apm_send_io_command ( UInt16 cmd)

Send a APM command into it's controller. (Shutdown, Reboot, Sleep...).

Parameters
base_dmathe IO base port.
cmdthe command.
Returns
status code of the APM command.

◆ bell()

TerminalDevice Kernel::bell ( )
inline

emulate a terminal bell, like the VT100 does.

◆ busi_test_mmio()

BOOL Kernel::busi_test_mmio ( _Input struct IMBCIHost * host,
_Input const UInt32 test )
inline

◆ carriage_return()

TerminalDevice Kernel::carriage_return ( )
inline

◆ construct_prdt()

void Kernel::construct_prdt ( Ref< PRDT > & prd)

constructs a new PRD.

Parameters
prdPRD reference.
Note
This doesnt construct a valid, please fill it by yourself.

◆ end_line()

TerminalDevice Kernel::end_line ( )
inline

◆ ENUM_STRING() [1/10]

Kernel::ENUM_STRING ( Bhyve ,
"bhyve bhyve "  )

◆ ENUM_STRING() [2/10]

Kernel::ENUM_STRING ( KVM ,
" KVMKVMKVM "  )

◆ ENUM_STRING() [3/10]

Kernel::ENUM_STRING ( Microsoft ,
"Microsoft Hv"  )

◆ ENUM_STRING() [4/10]

Kernel::ENUM_STRING ( Parallels ,
" prl hyperv "  )

◆ ENUM_STRING() [5/10]

Kernel::ENUM_STRING ( ParallelsAlt ,
" lrpepyh vr "  )

◆ ENUM_STRING() [6/10]

Kernel::ENUM_STRING ( Qemu ,
"TCGTCGTCGTCG"  )

◆ ENUM_STRING() [7/10]

Kernel::ENUM_STRING ( Qnx ,
" QNXQVMBSQG "  )

◆ ENUM_STRING() [8/10]

Kernel::ENUM_STRING ( VirtualBox ,
"VBoxVBoxVBox"  )

◆ ENUM_STRING() [9/10]

Kernel::ENUM_STRING ( VMWare ,
"VMwareVMware"  )

◆ ENUM_STRING() [10/10]

Kernel::ENUM_STRING ( Xen ,
"XenVMMXenVMM"  )

◆ err_bug_check_raise()

Boolean Kernel::err_bug_check_raise ( Void )

Does a system wide bug check.

Parameters
voidno params are needed.
Returns
if error-free: false, otherwise true.

◆ ext2_load_inode()

Kernel::ErrorOr< Ext2Node * > Kernel::ext2_load_inode ( Ext2Context * ctx,
Kernel::UInt32 inodeNumber )
inline

◆ ext2_load_superblock()

Kernel::ErrorOr< EXT2_SUPER_BLOCK * > Kernel::ext2_load_superblock ( Ext2Context * ctx)
inline

◆ ext2_read_block()

BOOL Kernel::ext2_read_block ( Kernel::DriveTrait * drv,
Kernel::UInt32 lba,
VoidPtr buffer,
Kernel::UInt32 size )
inline

======================================================================= /// IFS FUNCTIONS ======================================================================= ///

◆ ext2_write_block()

BOOL Kernel::ext2_write_block ( Kernel::DriveTrait * drv,
Kernel::UInt32 lba,
const VoidPtr buffer,
Kernel::UInt32 size )
inline

◆ forward()

template<typename Args>
Args && Kernel::forward ( Args & arg)
inline

Forward object.

Template Parameters
Argsthe object type.
Parameters
argthe object.
Returns
object's rvalue

◆ fs_ifs_read()

Int32 Kernel::fs_ifs_read ( IMountpoint * Mnt,
DriveTrait & DrvTrait,
Int32 DrvIndex )

Read from IFS disk.

Read from fs disk.

Parameters
Mntmounted interface.
DrvTraitdrive info
DrvIndexdrive index.
Returns

◆ fs_ifs_write()

Int32 Kernel::fs_ifs_write ( IMountpoint * Mnt,
DriveTrait & DrvTrait,
Int32 DrvIndex )

Write to IFS disk.

Write to fs disk.

Parameters
Mntmounted interface.
DrvTraitdrive info
DrvIndexdrive index.
Returns

◆ get_console_in()

TerminalDevice Kernel::get_console_in ( Char * buf)
inline

◆ hal_check_task()

EXTERN_C Bool Kernel::hal_check_task ( HAL::StackFramePtr stack_ptr)

Validate user stack.

Parameters
stack_ptrthe frame pointer.
Note
Those symbols are needed in order to switch and validate the stack.

◆ hal_set_pc_to_hart()

EXTERN_C Kernel::Void Kernel::hal_set_pc_to_hart ( HAL_HARDWARE_THREAD * hart,
Kernel::VoidPtr epc )

Set PC to specific hart.

Parameters
hartthe hart
epcthe pc.
Returns

◆ hal_switch_kernel_task()

EXTERN_C Void Kernel::hal_switch_kernel_task ( HAL::StackFramePtr frame,
KID kid )

◆ hex_number()

TerminalDevice Kernel::hex_number ( const Long & x)
inline

◆ io_construct_blank_drive() [1/2]

DriveTrait Kernel::io_construct_blank_drive ( )

Makes a new drive.

Returns
the new blank drive.

◆ io_construct_blank_drive() [2/2]

DriveTrait Kernel::io_construct_blank_drive ( Void )

Makes a new drive.

Returns
the new drive as a trait.

◆ io_construct_main_drive() [1/3]

DriveTrait Kernel::io_construct_main_drive ( )

Fetches the main drive.

Returns
the new drive. (returns kEPMDrive if EPM formatted)

◆ io_construct_main_drive() [2/3]

Void Kernel::io_construct_main_drive ( DriveTrait & trait)

Fetches the main drive.

Replacement for io_construct_main_drive that works with IMountpoint.

Parameters
traitthe new drive as a trait.
Returns
the new drive. (returns kEPMDrive if EPM formatted)

◆ io_construct_main_drive() [3/3]

DriveTrait Kernel::io_construct_main_drive ( Void )

Fetches the main drive.

Returns
the new drive as a trait.
Deprecated
use io_construct_main_drive(DriveTrait& trait) instead.

◆ io_drv_init()

Void Kernel::io_drv_init ( DriveTrait::DrivePacket & pckt)

Executes a disk check on the ATA drive.

Parameters
pcktthe packet to read.
Returns

◆ io_drv_input() [1/2]

Void Kernel::io_drv_input ( DriveTrait::DrivePacket & pckt)

reads from an ATA drive.

Parameters
pcktPacket structure (fPacketContent must be non null)
Returns

◆ io_drv_input() [2/2]

Void Kernel::io_drv_input ( DriveTrait::DrivePacket pckt)

◆ io_drv_kind()

const Char * Kernel::io_drv_kind ( Void )

Gets the drive kind (ATA, SCSI, AHCI...).

Parameters
voidnone.
Returns
the drive kind (ATA, Flash, NVM)
Parameters
voidno arguments.
Returns
no arguments.

◆ io_drv_output() [1/2]

Void Kernel::io_drv_output ( DriveTrait::DrivePacket & pckt)

Writes to an ATA drive.

Parameters
pcktthe packet to write.
Returns

◆ io_drv_output() [2/2]

Void Kernel::io_drv_output ( DriveTrait::DrivePacket pckt)

◆ io_drv_unimplemented() [1/2]

Void Kernel::io_drv_unimplemented ( DriveTrait::DrivePacket & pckt)

Unimplemented drive function.

Parameters
pcktthe packet to read.

◆ io_drv_unimplemented() [2/2]

Void Kernel::io_drv_unimplemented ( DriveTrait::DrivePacket * pckt)

Unimplemented drive.

Parameters
pcktthe packet to read.
Returns

◆ ipc_construct_packet() [1/2]

BOOL Kernel::ipc_construct_packet ( _Output _Input IPC_MSG ** pckt_in)

Construct packet function.

Return values
truepacket is correct.
falsepacket is incorrect and process has crashed.

◆ ipc_construct_packet() [2/2]

Bool Kernel::ipc_construct_packet ( _Output IPC_MSG ** pckt_in)

Construct packet function.

Return values
truepacket is correct.
falsepacket is incorrect and process has crashed.

◆ ipc_int_sanitize_packet()

Bool Kernel::ipc_int_sanitize_packet ( IPC_MSG * pckt)

◆ ipc_sanitize_packet() [1/2]

BOOL Kernel::ipc_sanitize_packet ( _Input IPC_MSG * pckt_in)

Sanitize packet function.

Return values
truepacket is correct.
falsepacket is incorrect and process has crashed.

◆ ipc_sanitize_packet() [2/2]

Bool Kernel::ipc_sanitize_packet ( IPC_MSG * pckt)

Sanitize packet function.

Return values
truepacket is correct.
falsepacket is incorrect and process has crashed.

◆ ke_calculate_crc32()

UInt32 Kernel::ke_calculate_crc32 ( const VoidPtr inp,
Int32 len )

Calculate CRC32 of p.

Parameters
inthe data to compute.
lenthe length of the data.
Returns
CRC32 of in.

◆ ke_dma_read()

template<typename DataKind>
UInt32 Kernel::ke_dma_read ( UIntPtr base,
DataKind reg )
inline

read from mapped memory register.

Parameters
basebase address
regthe register.
Returns
the value inside the register.

◆ ke_dma_write()

template<typename DataKind>
Void Kernel::ke_dma_write ( UIntPtr base,
DataKind reg,
DataKind value )
inline

write to mapped memory register

Parameters
basethe base address.
regthe register.
valuethe write to write on it.

◆ ke_io_read()

EXTERN_C void Kernel::ke_io_read ( DeviceInterface< const Char * > * self,
const Char * bytes )

◆ ke_io_write()

EXTERN_C void Kernel::ke_io_write ( DeviceInterface< const Char * > * obj,
const Char * bytes )

◆ ke_panic()

void Kernel::ke_panic ( const Kernel::Int32 & id,
const Char * message )

Stops execution of the kernel.

Parameters
idkernel stop ID.

◆ ke_runtime_check()

void Kernel::ke_runtime_check ( bool expr,
const Char * file,
const Char * line )

◆ ke_utf_io_write()

EXTERN_C void Kernel::ke_utf_io_write ( DeviceInterface< const Utf8Char * > * obj,
const Utf8Char * bytes )

◆ make_list() [1/2]

template<typename ValueType>
auto Kernel::make_list ( ValueType val)

◆ make_list() [2/2]

template<typename ValueType>
ArrayList< ValueType > Kernel::make_list ( ValueType val)

◆ make_ports()

template<SizeT Sz>
Array< UShort, Sz > Kernel::make_ports ( UShort base)
inline

◆ make_ptr()

template<typename T, typename... Args>
OwnPtr< T > Kernel::make_ptr ( Args &&... args)
inline

◆ mbci_read_auth_key()

MBCIAuthKeyType Kernel::mbci_read_auth_key ( _Input struct IMBCIHost * host)
inline

Read Auth key for MBCI host.

Parameters
hostthe mbci host to get the key on.
Returns
the 24-bit key.

◆ mm_alloc_ptr()

_Output VoidPtr Kernel::mm_alloc_ptr ( SizeT sz,
Bool wr,
Bool user,
SizeT pad_amount = 0 )

Allocate chunk of memory.

Parameters
szSize of pointer
wrRead Write bit.
userUser enable bit.
Returns
The newly allocated pointer, or nullptr.
Parameters
szSize of pointer
wrRead Write bit.
userUser enable bit.
Returns
The newly allocated pointer.

◆ mm_delete_class()

template<typename T>
Void Kernel::mm_delete_class ( _Input _Output T ** cls)
inline

Delete and nullify C++ class.

Parameters
clsThe class to delete.

◆ mm_free_ptr()

_Output Int32 Kernel::mm_free_ptr ( VoidPtr heap_ptr)

Declare pointer as free.

Parameters
heap_ptrthe pointer.
Returns
a status code regarding the deallocation.
Parameters
heap_ptrthe pointer.
Returns

◆ mm_get_ptr_flags()

_Output UInt64 Kernel::mm_get_ptr_flags ( VoidPtr heap_ptr)

Gets the flags of a heap header.

Parameters
heap_ptrthe pointer to get.

◆ mm_is_valid_ptr()

_Output Boolean Kernel::mm_is_valid_ptr ( VoidPtr heap_ptr)

Check if pointer is a valid Kernel pointer.

Parameters
heap_ptrthe pointer
Returns
if it exists it returns true.
Parameters
heap_ptrthe pointer
Returns
if it exists.

◆ mm_make_page()

_Output Int32 Kernel::mm_make_page ( VoidPtr heap_ptr)

Makes a Kernel page.

Makes a page heap.

Parameters
heap_ptrthe page pointer.
Returns
status code
Parameters
heap_ptrthe pointer to make a page heap.
Returns
kErrorSuccess if successful, otherwise an error code.

◆ mm_new_class()

template<typename T, typename... Args>
BOOL Kernel::mm_new_class ( _Input _Output T ** cls,
_Input Args &&... args )
inline

Allocate C++ class.

Parameters
clsThe class to allocate.
argsThe args to pass.

◆ mm_protect_ptr()

_Output Boolean Kernel::mm_protect_ptr ( VoidPtr heap_ptr)

Protect the heap with a CRC value.

Parameters
heap_ptrpointer.
Returns
if it valid: point has crc now., otherwise fail.
Parameters
heap_ptrHIB pointer.
Returns
if it valid: point has crc now., otherwise fail.

AMLALE: if valid, present and is heap header, then compute crc32

AMLALE: Protect only the header, information in it may change.

◆ mm_set_ptr_flags()

_Output Int32 Kernel::mm_set_ptr_flags ( VoidPtr heap_ptr,
UInt64 flags )

Overwrites and set the flags of a heap header.

Parameters
heap_ptrthe pointer to update.
flagsthe flags to set.

◆ move()

template<typename Args>
Args && Kernel::move ( Args && arg)
inline

Move object.

Template Parameters
Argsthe object type.
Parameters
argthe object.
Returns
object's rvalue

◆ mp_get_current_task()

EXTERN_C HAL::StackFramePtr Kernel::mp_get_current_task ( ProcessID thrdid)

Get current stack frame for a thread.

Parameters
thrdidThe thread ID.

◆ mp_hang_thread() [1/2]

Void Kernel::mp_hang_thread ( HAL::StackFrame * stack)

makes the thread sleep on a loop. hooks and hangs thread to prevent code from executing.

◆ mp_hang_thread() [2/2]

Void Kernel::mp_hang_thread ( HAL::StackFramePtr stack)

makes thread sleep. hooks and hangs thread to prevent code from executing.

◆ mp_init_cores()

Void Kernel::mp_init_cores ( Void )

Initialize the Global Interrupt Controller.

◆ mp_register_task()

EXTERN_C Bool Kernel::mp_register_task ( HAL::StackFramePtr stack_frame,
ProcessID thrdid )

Register current stack frame for a thread.

Parameters
stack_frameThe current stack frame.
thrdidThe thread ID.

◆ mp_wakeup_thread() [1/2]

Void Kernel::mp_wakeup_thread ( HAL::StackFrame * stack)

Wakes up thread. Wakes up thread from the hang state.

◆ mp_wakeup_thread() [2/2]

Void Kernel::mp_wakeup_thread ( HAL::StackFramePtr stack)

wakes up thread. wakes up thread from hang.

◆ number()

TerminalDevice Kernel::number ( const Long & x)
inline

◆ nvme_create_admin_command()

template<Int32 Opcode>
Bool Kernel::nvme_create_admin_command ( HAL_NVME_QUEUE * entry,
UInt32 nsid,
UInt32 prpTransfer[3],
UInt32 startingLba[2],
UInt32 lowTransferBlocks )
inline

Creates an admin command for a DMA operation.

◆ nvme_create_io_command()

template<Int32 Opcode>
Bool Kernel::nvme_create_io_command ( HAL_NVME_QUEUE * entry,
UInt64 baseAddress,
UInt32 identLoAndQueueSizeHi,
UInt32 flagsLoAndQueueComplIdHi,
UInt32 identify,
Bool provideIdentify = false,
Bool namespaceIdentify = false )
inline

Creates an I/O command for a DMA operation.

◆ oe_string_len()

template<typename CharType = Char>
SizeT Kernel::oe_string_len ( const CharType * str)
inline

OpenEncoding API =========================================================== ///.

=========================================================== ///

◆ operator<()

bool Kernel::operator< ( AffinityKind lhs,
AffinityKind rhs )
inline

Operators for AffinityKind.

◆ operator<<()

TerminalDevice & Kernel::operator<< ( TerminalDevice & src,
const Long & num )
inline

◆ operator<=()

bool Kernel::operator<= ( AffinityKind lhs,
AffinityKind rhs )
inline

◆ operator>()

bool Kernel::operator> ( AffinityKind lhs,
AffinityKind rhs )
inline

◆ operator>=()

bool Kernel::operator>= ( AffinityKind lhs,
AffinityKind rhs )
inline

◆ ort_string_append()

template<typename CharKind>
void Kernel::ort_string_append ( CharKind * lhs,
const CharKind * rhs,
Int32 cur )
inline

◆ rt_alloc_string()

const Char * Kernel::rt_alloc_string ( const Char * text)

◆ rt_copy_memory()

Int32 Kernel::rt_copy_memory ( const voidPtr src,
voidPtr dst,
Size len )

ASCII API =========================================================== ///.

=========================================================== ///

◆ rt_copy_memory_safe()

Int32 Kernel::rt_copy_memory_safe ( const voidPtr src,
voidPtr dst,
Size len,
Size dst_size )

Safe memory functions API =========================================================== ///.

=========================================================== ///

◆ rt_hash_seed()

SizeT Kernel::rt_hash_seed ( const Char * seed,
UInt32 mul )
inline

◆ rt_is_alnum()

Int32 Kernel::rt_is_alnum ( Int character)

◆ rt_is_newln()

Boolean Kernel::rt_is_newln ( Int chr)

◆ rt_is_space()

Boolean Kernel::rt_is_space ( Int chr)

◆ rt_move_memory()

Int Kernel::rt_move_memory ( const voidPtr src,
voidPtr dst,
Size len )

◆ rt_set_memory()

voidPtr Kernel::rt_set_memory ( voidPtr dst,
UInt32 val,
Size len )

◆ rt_set_memory_safe()

voidPtr Kernel::rt_set_memory_safe ( voidPtr dst,
UInt32 value,
Size len,
Size dst_size )

◆ rt_string_cmp()

Int32 Kernel::rt_string_cmp ( const Char * src,
const Char * cmp,
Size len )

◆ rt_string_has_char()

Char * Kernel::rt_string_has_char ( Char * str,
Char chr )

◆ rt_string_in_string()

VoidPtr Kernel::rt_string_in_string ( const Char * in,
const Char * needle )

◆ rt_string_len() [1/2]

Size Kernel::rt_string_len ( const Char * str)

◆ rt_string_len() [2/2]

SizeT Kernel::rt_string_len ( const Char * str,
SizeT _len )

◆ rt_to_char()

Char Kernel::rt_to_char ( UInt64 value,
Int32 base )

◆ rt_to_lower()

Int32 Kernel::rt_to_lower ( Int c)

◆ rt_to_string()

Bool Kernel::rt_to_string ( Char * str_out,
UInt64 base,
Int32 limit )

◆ rt_to_uppercase()

Int32 Kernel::rt_to_uppercase ( Int c)

◆ rt_zero_memory()

Void Kernel::rt_zero_memory ( voidPtr pointer,
Size len )

◆ rtl_create_kernel_task()

BOOL Kernel::rtl_create_kernel_task ( HAL::StackFramePtr task,
const KID kid )

Executes a new process from a function. Kernel code only.

Note
This sets up a new stack, anything on the main function that calls the Kernel will not be accessible.
Parameters
mainthe start of the process.
Returns
The team's process id.

◆ rtl_create_user_process() [1/2]

ProcessID Kernel::rtl_create_user_process ( PE32Loader & exec,
const Int32 & process_kind )

◆ rtl_create_user_process() [2/2]

ProcessID Kernel::rtl_create_user_process ( rtl_start_kind main,
const Char * process_name )

Executes a new process from a function. User code only.

Executes a new process from a function. Kernel code only.

Note
This sets up a new stack, anything on the main function that calls the Kernel will not be accessible.
Parameters
mainthe start of the process.
Returns
The team's process id.
Note
This sets up a new stack, anything on the main function that calls the Kernel will not be accessible.
Parameters
mainthe start of the process.
Returns
if the process was started or not.

◆ rtl_dma_alloc()

VoidPtr Kernel::rtl_dma_alloc ( SizeT size,
SizeT align )
inline

allocate from the rtl_dma_alloc system.

Parameters
sizethe size of the chunk to allocate.
alignalignement of pointer.

Check alignement according to architecture.

here we just align the address according to a align variable, i'd rather be a power of two really.

◆ rtl_dma_flush()

Void Kernel::rtl_dma_flush ( VoidPtr ptr,
SizeT size_buffer )
inline

Flush DMA pointer.

◆ rtl_dma_free()

Void Kernel::rtl_dma_free ( SizeT size)
inline

Free DMA pointer.

◆ rtl_fini_dylib_pef()

EXTERN_C Void Kernel::rtl_fini_dylib_pef ( USER_PROCESS & header,
IDylibRef lib,
Bool * successful )

◆ rtl_init_dylib_pef()

EXTERN_C IDylibRef Kernel::rtl_init_dylib_pef ( USER_PROCESS & header)

◆ rtl_microseconds()

UInt64 Kernel::rtl_microseconds ( UInt64 time)
inline

◆ rtl_milliseconds()

UInt64 Kernel::rtl_milliseconds ( UInt64 time)
inline

◆ rtl_sem_acquire()

BOOL Kernel::rtl_sem_acquire ( SemaphoreArr & sem,
UInt64 owner )
inline

Initializes the semaphore with an owner and a count of zero.

Parameters
semthe semaphore array to use.
ownerthe owner to set, could be anything identifitable.
Returns

◆ rtl_sem_is_valid()

BOOL Kernel::rtl_sem_is_valid ( const SemaphoreArr & sem,
UInt64 owner = 0 )
inline

Checks if the semaphore is valid.

◆ rtl_sem_release()

BOOL Kernel::rtl_sem_release ( SemaphoreArr & sem)
inline

Releases the semaphore, resetting its owner and count.

Parameters
sem
Returns

◆ rtl_sem_wait()

BOOL Kernel::rtl_sem_wait ( SemaphoreArr & sem,
UInt64 owner,
UInt64 timeout,
BOOL * condition = nullptr )
inline

Waits for the semaphore to be available, blocking until it is.

Parameters
sem
timeout
conditioncondition pointer.
Returns

◆ sched_free_ptr_tree()

template<typename T>
STATIC Void Kernel::sched_free_ptr_tree ( T * tree)

Free heap tree.

◆ sched_try_go_upper_ptr_tree()

template<typename T>
STATIC T * Kernel::sched_try_go_upper_ptr_tree ( T * tree)

Allocate pointer to heap tree.

Parameters
treeThe tree to calibrate

◆ sig_generate_unique()

template<rt_signal_kind Sig, SizeT Seed = kUserSignalSeed>
rt_signal_kind Kernel::sig_generate_unique ( )
inline

Generate signal from Sig.

◆ sig_matches_seed()

template<SizeT Seed>
BOOL Kernel::sig_matches_seed ( rt_signal_kind sig)
inline

Checks if the signal matches the seed (user_seed or kernel_seed).

◆ sig_validate_unique()

BOOL Kernel::sig_validate_unique ( rt_signal_kind sig)
inline

Validate signal from sig and whtether the signal is greater than SIGDTCH.

◆ sk_acquire_ahci_device()

ErrorOr< AHCIDeviceInterface > Kernel::sk_acquire_ahci_device ( UInt32 drv_index)

Acquires a new AHCI device with drv_index in mind.

Parameters
drv_indexThe drive index to assign.
Returns
A wrapped device interface if successful, or error code.

◆ sk_acquire_ata_device()

ErrorOr< ATADeviceInterface > Kernel::sk_acquire_ata_device ( Int32 drv_index)

Acquires a new PIO device with drv_index in mind.

Parameters
drv_indexThe drive index to assign.
Returns
A wrapped device interface if successful, or error code.

here we don't check if we probed ATA, since we'd need to grab IO after that.

◆ sk_init_ahci_device()

UInt16 Kernel::sk_init_ahci_device ( BOOL atapi)

Initialize an AHCI device (StorageKit).

◆ sk_init_ata_device()

BOOL Kernel::sk_init_ata_device ( BOOL is_master,
UInt16 & io,
UInt8 & master )

Initialize an PIO device (StorageKit function).

Parameters
is_masteris the current PIO master?
Returns
[io:master] for PIO device.

◆ tabulate()

TerminalDevice Kernel::tabulate ( )
inline

◆ urt_copy_memory()

Int32 Kernel::urt_copy_memory ( const voidPtr src,
voidPtr dst,
Size len )

◆ urt_set_memory()

Void Kernel::urt_set_memory ( const voidPtr src,
UInt32 dst,
Size len )

◆ urt_string_cmp()

Int32 Kernel::urt_string_cmp ( const Utf8Char * src,
const Utf8Char * cmp,
Size len )

UNICODE API =========================================================== ///.

=========================================================== ///

◆ urt_string_len()

Size Kernel::urt_string_len ( const Utf8Char * str)

◆ utf_end_line()

Utf8TerminalDevice Kernel::utf_end_line ( )
inline

Variable Documentation

◆ kCDRomPacketTemplate

const scsi_packet_type_12 Kernel::kCDRomPacketTemplate
extern

◆ kChecksumPolys

UInt32 Kernel::kChecksumPolys[kCrcCnt]

The CRC32 seed table.

◆ kCurrentUser

User* Kernel::kCurrentUser = nullptr
inline

◆ kDebugCmdLen

SizeT Kernel::kDebugCmdLen = 256U
inlineconstexpr

◆ kDebugMagic

auto Kernel::kDebugMagic = "VMK1.0.0;"
inlineconstexpr

◆ kDebugPort

auto Kernel::kDebugPort = 51820
inlineconstexpr

◆ kDebugVersion

auto Kernel::kDebugVersion = 0x0100
inlineconstexpr

◆ kDmaPoolEnd

const UInt8* Kernel::kDmaPoolEnd = (UInt8*) (kNeDMAPoolStart + kNeDMAPoolSize)
inline

◆ kDmaPoolPtr

UInt8* Kernel::kDmaPoolPtr = (UInt8*) kNeDMAPoolStart
inline

DMA pool base pointer, here we're sure that AHCI or whatever tricky standard sees it.

◆ kErrorAccessDenied

KPCError Kernel::kErrorAccessDenied = 69
inlineconstexpr

◆ kErrorAsync

KPCError Kernel::kErrorAsync = 57
inlineconstexpr

◆ kErrorCDTrayBroken

KPCError Kernel::kErrorCDTrayBroken = 62
inlineconstexpr

◆ kErrorDirectoryNotFound

KPCError Kernel::kErrorDirectoryNotFound = 36
inlineconstexpr

◆ kErrorDisk

KPCError Kernel::kErrorDisk = 55
inlineconstexpr

◆ kErrorDiskIsCorrupted

KPCError Kernel::kErrorDiskIsCorrupted = 54
inlineconstexpr

◆ kErrorDiskIsFull

KPCError Kernel::kErrorDiskIsFull = 38
inlineconstexpr

◆ kErrorDiskIsTooTiny

KPCError Kernel::kErrorDiskIsTooTiny = 65
inlineconstexpr

◆ kErrorDiskReadOnly

KPCError Kernel::kErrorDiskReadOnly = 37
inlineconstexpr

◆ kErrorDmaExhausted

KPCError Kernel::kErrorDmaExhausted = 66
inlineconstexpr

◆ kErrorExecutable

KPCError Kernel::kErrorExecutable = 33
inlineconstexpr

◆ kErrorExecutableLib

KPCError Kernel::kErrorExecutableLib = 34
inlineconstexpr

◆ kErrorFileExists

KPCError Kernel::kErrorFileExists = 46
inlineconstexpr

◆ kErrorFileLocked

KPCError Kernel::kErrorFileLocked = 64
inlineconstexpr

◆ kErrorFileNotFound

KPCError Kernel::kErrorFileNotFound = 35
inlineconstexpr

◆ kErrorForkAlreadyExists

KPCError Kernel::kErrorForkAlreadyExists = 50
inlineconstexpr

◆ kErrorFormatFailed

KPCError Kernel::kErrorFormatFailed = 47
inlineconstexpr

◆ kErrorHeapNotPresent

KPCError Kernel::kErrorHeapNotPresent = 52
inlineconstexpr

◆ kErrorHeapOutOfMemory

KPCError Kernel::kErrorHeapOutOfMemory = 44
inlineconstexpr

◆ kErrorInternal

KPCError Kernel::kErrorInternal = 49
inlineconstexpr

◆ kErrorInvalidCreds

KPCError Kernel::kErrorInvalidCreds = 61
inlineconstexpr

◆ kErrorInvalidData

KPCError Kernel::kErrorInvalidData = 56
inlineconstexpr

◆ kErrorIPC

KPCError Kernel::kErrorIPC = 59
inlineconstexpr

◆ kErrorLocalNumber

KPCError Kernel::kErrorLocalNumber = 0UL
inline

◆ kErrorMath

KPCError Kernel::kErrorMath = 42
inlineconstexpr

◆ kErrorNetworkTimeout

KPCError Kernel::kErrorNetworkTimeout = 48
inlineconstexpr

◆ kErrorNoEntrypoint

KPCError Kernel::kErrorNoEntrypoint = 53
inlineconstexpr

◆ kErrorNonBlocking

KPCError Kernel::kErrorNonBlocking = 58
inlineconstexpr

◆ kErrorNoNetwork

KPCError Kernel::kErrorNoNetwork = 43
inlineconstexpr

◆ kErrorNoSuchDisk

KPCError Kernel::kErrorNoSuchDisk = 45
inlineconstexpr

◆ kErrorOutOfBitMapMemory

KPCError Kernel::kErrorOutOfBitMapMemory = 67
inlineconstexpr

◆ kErrorOutOfTeamSlot

KPCError Kernel::kErrorOutOfTeamSlot = 51
inlineconstexpr

◆ kErrorProcessFault

KPCError Kernel::kErrorProcessFault = 39
inlineconstexpr

◆ kErrorSign

KPCError Kernel::kErrorSign = 60
inlineconstexpr

◆ kErrorSocketHangUp

KPCError Kernel::kErrorSocketHangUp = 40
inlineconstexpr

◆ kErrorSuccess

KPCError Kernel::kErrorSuccess = 0
inlineconstexpr

◆ kErrorThreadLocalStorage

KPCError Kernel::kErrorThreadLocalStorage = 41
inlineconstexpr

◆ kErrorTimeout

KPCError Kernel::kErrorTimeout = 68
inlineconstexpr

◆ kErrorUnavailable

KPCError Kernel::kErrorUnavailable = 70
inlineconstexpr

◆ kErrorUnimplemented

KPCError Kernel::kErrorUnimplemented = -1
inlineconstexpr

Generic errors.

◆ kErrorUnrecoverableDisk

KPCError Kernel::kErrorUnrecoverableDisk = 63
inlineconstexpr

◆ kHardwareThreadScheduler

STATIC HardwareThreadScheduler Kernel::kHardwareThreadScheduler

◆ kHWThread

STATIC HAL_HARDWARE_THREAD Kernel::kHWThread[kMaxAPInsideSched] = {{nullptr}}

◆ kIPCMsgSize

auto Kernel::kIPCMsgSize = 6094U
inlineconstexpr

◆ kKernelSignalSeed

auto Kernel::kKernelSignalSeed = 0x0895034f9fUL
inlineconstexpr

Special signal seed for kernel usage.

◆ kMaxPorts

UInt16 Kernel::kMaxPorts = 16
inlineconstexpr

◆ kMinACPIVer

STATIC const auto Kernel::kMinACPIVer = 1U
constexpr

◆ kMinimumStringSize

Int Kernel::kMinimumStringSize = 8196
inlineconstexpr

◆ kMountedFilesystem

STATIC IFilesystemMgr* Kernel::kMountedFilesystem = nullptr

◆ kOpenHeFSTimeInvalid

ATime Kernel::kOpenHeFSTimeInvalid = 0x0000000000000000
inlineconstexpr

◆ kOpenHeFSTimeMax

ATime Kernel::kOpenHeFSTimeMax = 0xFFFFFFFFFFFFFFFF - 1
inlineconstexpr

◆ kPageMgr

STATIC PageMgr Kernel::kPageMgr

◆ kPRDTTransferStatus

EXTERN_C Int32 Kernel::kPRDTTransferStatus

◆ kRaiseOnBugCheck

STATIC Bool Kernel::kRaiseOnBugCheck = false

◆ kRestrictStrLen

STATIC const auto Kernel::kRestrictStrLen = 8U
inline

◆ kRootUser

User* Kernel::kRootUser = nullptr
inline

◆ kTimeUnit

Int16 Kernel::kTimeUnit = 1000
inlineconstexpr

◆ kUserSignalSeed

auto Kernel::kUserSignalSeed = 0x0895034fUL
inlineconstexpr

Standard signal seed for general purpose usage.