summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-16 14:21:16 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-16 14:21:16 +0100
commita4d3338e4f9ce011180b6d4f599acb4f34bba617 (patch)
treea22155808898df7b9bf9b5f0254b6ceb3086ab88 /lib
parent31eb508f29c88c4468c0b83616561a08521a1878 (diff)
meta: important document improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/30pin.h10
-rw-r--r--lib/boot.h4
-rw-r--r--lib/bootnet.h2
-rw-r--r--lib/cxx-abi.hpp5
-rw-r--r--lib/fd.h20
-rw-r--r--lib/mp-bit.h2
-rw-r--r--lib/partition-map.h4
-rw-r--r--lib/pci-tree.h6
-rw-r--r--lib/string.h2
-rw-r--r--lib/xcoff.h2
10 files changed, 29 insertions, 28 deletions
diff --git a/lib/30pin.h b/lib/30pin.h
index 7128c3f..9de524f 100644
--- a/lib/30pin.h
+++ b/lib/30pin.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -13,7 +13,7 @@
/// @details This file contains the definitions and structures used for the 30pin recovery protocol.
#define NB_30PIN_MAG "TP"
-#define CP_30PIN_MAG_LEN (2)
+#define NB_30PIN_MAG_LEN (2)
#define NB_30PIN_BUFFER_LEN (498)
#define NB_30PIN_EOP_LEN (11)
@@ -23,8 +23,8 @@
/// @param kind kind of packet we deal with.
/// @param buffer the data of the packet.
/// @param eop end of packet data.
-struct _cb_tpin_recovery_packet {
- uint8_t mag[CP_30PIN_MAG_LEN];
+struct _nb_tpin_recovery_packet {
+ uint8_t mag[NB_30PIN_MAG_LEN];
uint8_t kind;
uint8_t buffer[NB_30PIN_BUFFER_LEN];
uint8_t eop[NB_30PIN_EOP_LEN];
@@ -40,4 +40,4 @@ enum {
TPIN_RECOVERY_PACKET_KIND_EOP_NACK = 5,
};
-typedef struct _cb_tpin_recovery_packet cb_tpin_recovery_packet_t; \ No newline at end of file
+typedef struct _nb_tpin_recovery_packet cb_tpin_recovery_packet_t; \ No newline at end of file
diff --git a/lib/boot.h b/lib/boot.h
index 8a28eff..719f782 100644
--- a/lib/boot.h
+++ b/lib/boot.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -180,7 +180,7 @@ typedef void (*cb_proc_t)();
typedef char ascii_char_t;
/// @brief Linear Executable Header
-/// @author Amlal EL Mahrouss (Amlal EL Mahrouss)
+/// @author Amlal El Mahrouss (Amlal El Mahrouss)
struct __attribute__((aligned(4))) cb_boot_header {
const ascii_char_t h_mag[2]; // magic number
const ascii_char_t h_name[10]; // operating system name
diff --git a/lib/bootnet.h b/lib/bootnet.h
index b0c3fd9..f9f421d 100644
--- a/lib/bootnet.h
+++ b/lib/bootnet.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
diff --git a/lib/cxx-abi.hpp b/lib/cxx-abi.hpp
index 61225fc..681a926 100644
--- a/lib/cxx-abi.hpp
+++ b/lib/cxx-abi.hpp
@@ -1,6 +1,7 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -8,7 +9,7 @@
#define DSO_MAX_OBJECTS (128)
-struct atexit_func_entry_t {
+struct atexit_func_entry_t final {
void (*destructor_func)(void*);
void* obj_ptr;
void* dso_handle;
diff --git a/lib/fd.h b/lib/fd.h
index 1949c48..967afa7 100644
--- a/lib/fd.h
+++ b/lib/fd.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -8,21 +8,21 @@
#include <lib/boot.h>
-struct _cb_file_descriptor;
+struct _nb_file_descriptor;
/// @brief NeBoot file/device descriptor.
/// @version 1
-typedef struct _cb_file_descriptor {
+typedef struct _nb_file_descriptor {
int32_t f_kind;
int32_t f_filesystem;
- size_t (*f_write)(void* ptr, size_t size, size_t nitems, struct _cb_file_descriptor* self);
- size_t (*f_read)(void* ptr, size_t size, size_t nitems, struct _cb_file_descriptor* self);
- int (*f_seek)(struct _cb_file_descriptor* self, size_t off, int whence);
- int (*f_tell)(struct _cb_file_descriptor* self);
- int (*f_rewind)(struct _cb_file_descriptor* self);
- int (*f_eof)(struct _cb_file_descriptor* self);
- int (*f_close)(struct _cb_file_descriptor* self);
+ size_t (*f_write)(void* ptr, size_t size, size_t nitems, struct _nb_file_descriptor* self);
+ size_t (*f_read)(void* ptr, size_t size, size_t nitems, struct _nb_file_descriptor* self);
+ int (*f_seek)(struct _nb_file_descriptor* self, size_t off, int whence);
+ int (*f_tell)(struct _nb_file_descriptor* self);
+ int (*f_rewind)(struct _nb_file_descriptor* self);
+ int (*f_eof)(struct _nb_file_descriptor* self);
+ int (*f_close)(struct _nb_file_descriptor* self);
} cb_file_descriptor_t;
/// @brief Grabs a new device reference.
diff --git a/lib/mp-bit.h b/lib/mp-bit.h
index 924fcdf..6fb174e 100644
--- a/lib/mp-bit.h
+++ b/lib/mp-bit.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
diff --git a/lib/partition-map.h b/lib/partition-map.h
index f034335..55e0407 100644
--- a/lib/partition-map.h
+++ b/lib/partition-map.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -87,7 +87,7 @@ enum {
EPM_LINUX = 0x8f,
EPM_BSD = 0x9f,
EPM_NEKERNEL_OS = 0x1f,
- EPM_SNU_OS = 0x2f,
+ EPM_LEGACY_OS = 0x2f,
};
/// @brief check for supported filesystem.
diff --git a/lib/pci-tree.h b/lib/pci-tree.h
index a68fd4c..b73d827 100644
--- a/lib/pci-tree.h
+++ b/lib/pci-tree.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
@@ -8,7 +8,7 @@
/// @file pci-tree.h
/// @brief PCI Tree layout.
-/// @author Amlal EL Mahrouss
+/// @author Amlal El Mahrouss
#include <lib/boot.h>
@@ -42,7 +42,7 @@ typedef uint8_t cb_pci_device_t;
/// @brief hardware tree header
/// used by guest to resolve hardware peripherals.
-struct hw_cb_pci_tree {
+struct hw_nb_pci_tree {
cb_pci_num_t d_magic;
cb_pci_num_t d_version;
cb_pci_num_t d_off_props;
diff --git a/lib/string.h b/lib/string.h
index 1ea01da..3fbe399 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
diff --git a/lib/xcoff.h b/lib/xcoff.h
index 180b42a..c4eef88 100644
--- a/lib/xcoff.h
+++ b/lib/xcoff.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal El Mahrouss, all rights reserved.
File: xcoff.h
Purpose: XCOFF for NeBoot.