summaryrefslogtreecommitdiffhomepage
path: root/dev/boot
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 20:19:56 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 20:19:56 +0100
commit15493aad092a3e2f0ebacc4fe38d40de02ea67de (patch)
tree036ab95fdf6702b0a1dba53ca7f4670466329f05 /dev/boot
parentba7b3ed69cd24970a28b72c54982735cd120e663 (diff)
ahci: fix: report success when ahci is detected.
mbci: reintroduce NeKernel's MBCI. cfkit: rename: CFKit -> CF libuser: rename ErrKind to ErrRef. coregfx: fix last unconsistent things about the module. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/boot')
-rw-r--r--dev/boot/BootKit/HW/SATA.h2
-rw-r--r--dev/boot/modules/BootNet/BootNet.cc10
-rw-r--r--dev/boot/modules/BootNet/BootNet.h16
-rw-r--r--dev/boot/src/BootThread.cc14
4 files changed, 19 insertions, 23 deletions
diff --git a/dev/boot/BootKit/HW/SATA.h b/dev/boot/BootKit/HW/SATA.h
index 6ae18740..41e454dd 100644
--- a/dev/boot/BootKit/HW/SATA.h
+++ b/dev/boot/BootKit/HW/SATA.h
@@ -19,7 +19,7 @@ public:
struct SATATrait final
{
- Kernel::SizeT mBase{1024};
+ Kernel::SizeT mBase{1024};
Kernel::Boolean mErr{false};
Kernel::Boolean mDetected{false};
diff --git a/dev/boot/modules/BootNet/BootNet.cc b/dev/boot/modules/BootNet/BootNet.cc
index 4b7e5c30..0ca0998c 100644
--- a/dev/boot/modules/BootNet/BootNet.cc
+++ b/dev/boot/modules/BootNet/BootNet.cc
@@ -13,13 +13,13 @@
EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover)
{
- NETBOOT_INTERNET_HEADER inet{};
+ BOOTNET_INTERNET_HEADER inet{};
- memset(&inet, 0, sizeof(NETBOOT_INTERNET_HEADER));
+ memset(&inet, 0, sizeof(BOOTNET_INTERNET_HEADER));
/// TODO: Read packet from JSON file 'bootnet.json'
- if (inet.PatchLength < 1)
+ if (inet.Length < 1)
{
Boot::BootTextWriter writer;
writer.Write("NetBootLauncher: No executable attached to the packet, aborting.\r");
@@ -27,9 +27,9 @@ EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover)
return kEfiFail;
}
- if (!inet.EEPROM)
+ if (!inet.ImpliesEEPROM)
{
- Boot::BootThread thread(inet.PatchData);
+ Boot::BootThread thread(inet.Data);
if (thread.IsValid())
return thread.Start(handover, YES);
diff --git a/dev/boot/modules/BootNet/BootNet.h b/dev/boot/modules/BootNet/BootNet.h
index 4f795861..c8432d93 100644
--- a/dev/boot/modules/BootNet/BootNet.h
+++ b/dev/boot/modules/BootNet/BootNet.h
@@ -17,17 +17,17 @@
#define kNetBootNameLen (256U)
/// @brief the internet header is used to download updates OTA.
-typedef struct NETBOOT_INTERNET_HEADER
+typedef struct BOOTNET_INTERNET_HEADER
{
Kernel::Char NB1; /// magic char 1 'N'
Kernel::Char NB2; /// magic char 2 'E'
Kernel::Char NB3; /// magic char 3 'T'
Kernel::Char NB4; /// magic char 4 'B'
- Kernel::Char PatchName[kNetBootNameLen]; /// example: Modjo
- Kernel::Int32 PatchLength; /// the patch length.
- Kernel::Char PatchTarget[kNetBootNameLen]; /// the target file.
- Kernel::Boolean EEPROM : 1; /// does it imply an EEPROM reprogram?
- Kernel::Boolean Preflight : 1; /// is it a preflight packet.
- Kernel::Char PatchData[]; /// non preflight packet has a patch blob for a **PatchTarget**
-} ATTRIBUTE(packed) NETBOOT_INTERNET_HEADER;
+ Kernel::Char Name[kNetBootNameLen]; /// example: Modjo
+ Kernel::Int32 Length; /// the patch length.
+ Kernel::Char Target[kNetBootNameLen]; /// the target file.
+ Kernel::Boolean ImpliesEEPROM : 1; /// does it imply an EEPROM reprogram?
+ Kernel::Boolean Preflight : 1; /// is it a preflight packet.
+ Kernel::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget**
+} ATTRIBUTE(packed) BOOTNET_INTERNET_HEADER;
diff --git a/dev/boot/src/BootThread.cc b/dev/boot/src/BootThread.cc
index eef2104b..c6fb9975 100644
--- a/dev/boot/src/BootThread.cc
+++ b/dev/boot/src/BootThread.cc
@@ -41,8 +41,8 @@ namespace Boot
if (blob_bytes[0] == kMagMz0 &&
blob_bytes[1] == kMagMz1)
{
- LDR_EXEC_HEADER_PTR header_ptr = CFKit::ldr_find_exec_header(blob_bytes);
- LDR_OPTIONAL_HEADER_PTR opt_header_ptr = CFKit::ldr_find_opt_exec_header(blob_bytes);
+ LDR_EXEC_HEADER_PTR header_ptr = CF::ldr_find_exec_header(blob_bytes);
+ LDR_OPTIONAL_HEADER_PTR opt_header_ptr = CF::ldr_find_opt_exec_header(blob_bytes);
if (!header_ptr || !opt_header_ptr)
return;
@@ -117,19 +117,15 @@ namespace Boot
if (handover_struc->HandoverArch != HEL::kArchAMD64)
{
fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF));
- ::Boot::Stop();
}
-#endif
-
-#ifdef __NE_ARM64__
+#elif defined(__NE_ARM64__)
if (handover_struc->HandoverArch != HEL::kArchARM64)
{
fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF));
- ::Boot::Stop();
}
#endif
- fb_render_string("BootZ: Not an handover header...", 40, 10, RGB(0xFF, 0xFF, 0xFF));
+ fb_render_string("BootZ: Not an handover header...", 40, 10, RGB(0xFF, 0xFF, 0xFF));
::Boot::Stop();
}
}
@@ -145,7 +141,7 @@ namespace Boot
blob_bytes[3] == kPefMagic[3])
{
// ========================================= //
- // PEF executable detected.
+ // PEF executable has been detected.
// ========================================= //
fStartAddress = nullptr;