summaryrefslogtreecommitdiffhomepage
path: root/dev/user/ProcessCodes.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 20:35:24 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-27 20:35:24 +0100
commita3da0eaaf7569948f83c65ff7997c4d1fc868603 (patch)
tree735b9feba07568c802365169761efe0bc730f16b /dev/user/ProcessCodes.h
parente263653c2c1d1858827ac45061ecaefd9047fbb2 (diff)
BootZ: Introduce NetBoot module & consolidate STANDALONE macro
- Renamed __BOOTLDR_STANDALONE__ → __BOOTZ_STANDALONE__ across all modules. - Introduced NetBoot module to support fallback booting via packets. - Updated amd64-desktop build to bundle netboot.sys as part of system image. - NetBoot now properly zeroes out its header and performs sanity check on PatchLength. - Boot flow now attempts to fallback to NetBoot if neoskrnl.exe fails to start. - Reorganized disk formatting logic for clarity and better failure recovery. - HeFS & NeFS minimum disk size lowered (64GiB → 256MiB and 4GiB → 8MiB). - Renamed `IndexProperty` to `Index` in FSKit::Indexer. - Moved HintKit → hint/, updated includes and guards. - Removed deprecated LPC.{cc,h}, replaced by ProcessCodes.h. - Modernized SystemCalls.h typedefs: SCIObject → Ref, ThreadObject → ThreadRef, etc. - Updated userland tools `make_app` and `open` with copyright and behavior fixes. This prepares the BootZ infrastructure for headless/network environments. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/user/ProcessCodes.h')
-rw-r--r--dev/user/ProcessCodes.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/dev/user/ProcessCodes.h b/dev/user/ProcessCodes.h
new file mode 100644
index 00000000..2b740784
--- /dev/null
+++ b/dev/user/ProcessCodes.h
@@ -0,0 +1,56 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <user/Macros.h>
+
+/// @file ProcessCodes.h
+/// @brief Process Codes type and values.
+
+#define err_local_ok() (kLastError == kErrorSuccess)
+#define err_local_fail() (kLastError != kErrorSuccess)
+#define err_local_get() (kLastError)
+
+typedef SInt32 ErrKind;
+
+inline constexpr ErrKind kErrorSuccess = 0;
+inline constexpr ErrKind kErrorExecutable = 33;
+inline constexpr ErrKind kErrorExecutableLib = 34;
+inline constexpr ErrKind kErrorFileNotFound = 35;
+inline constexpr ErrKind kErrorDirectoryNotFound = 36;
+inline constexpr ErrKind kErrorDiskReadOnly = 37;
+inline constexpr ErrKind kErrorDiskIsFull = 38;
+inline constexpr ErrKind kErrorProcessFault = 39;
+inline constexpr ErrKind kErrorSocketHangUp = 40;
+inline constexpr ErrKind kErrorThreadLocalStorage = 41;
+inline constexpr ErrKind kErrorMath = 42;
+inline constexpr ErrKind kErrorNoNetwork = 43;
+inline constexpr ErrKind kErrorHeapOutOfMemory = 44;
+inline constexpr ErrKind kErrorNoSuchDisk = 45;
+inline constexpr ErrKind kErrorFileExists = 46;
+inline constexpr ErrKind kErrorFormatFailed = 47;
+inline constexpr ErrKind kErrorNetworkTimeout = 48;
+inline constexpr ErrKind kErrorInternal = 49;
+inline constexpr ErrKind kErrorForkAlreadyExists = 50;
+inline constexpr ErrKind kErrorOutOfTeamSlot = 51;
+inline constexpr ErrKind kErrorHeapNotPresent = 52;
+inline constexpr ErrKind kErrorNoEntrypoint = 53;
+inline constexpr ErrKind kErrorDiskIsCorrupted = 54;
+inline constexpr ErrKind kErrorDisk = 55;
+inline constexpr ErrKind kErrorInvalidData = 56;
+inline constexpr ErrKind kErrorAsync = 57;
+inline constexpr ErrKind kErrorNonBlocking = 58;
+inline constexpr ErrKind kErrorIPC = 59;
+inline constexpr ErrKind kErrorSign = 60;
+inline constexpr ErrKind kErrorInvalidCreds = 61;
+inline constexpr ErrKind kErrorCDTrayBroken = 62;
+inline constexpr ErrKind kErrorUnrecoverableDisk = 63;
+inline constexpr ErrKind kErrorFileLocked = 64;
+inline constexpr ErrKind kErrorUnimplemented = -1;
+
+/// @brief The last error reported by the system to the process.
+IMPORT_C ErrKind kLastError;