summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-24 19:57:10 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-24 19:57:10 +0200
commit8153dc983802115951836f2b164af371ee6e3d73 (patch)
treeb06f35ba0d21f6d336b5be7af2a36672ea19fc43 /Private/NewBoot/Source
parentf7a7080d18ac2be758b242c22f020c018b1c4824 (diff)
MHR-16: Add QR-code when bootloader crashes alongside other welcomed changes.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/CDROM/SplashScreen.fmt2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootAHCI.cxx3
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx3
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx6
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootString.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Support.cxx32
-rw-r--r--Private/NewBoot/Source/makefile2
11 files changed, 51 insertions, 7 deletions
diff --git a/Private/NewBoot/Source/CDROM/SplashScreen.fmt b/Private/NewBoot/Source/CDROM/SplashScreen.fmt
index a3dba676..339b94e7 100644
--- a/Private/NewBoot/Source/CDROM/SplashScreen.fmt
+++ b/Private/NewBoot/Source/CDROM/SplashScreen.fmt
@@ -1,4 +1,4 @@
-Welcome to the NeWS.
+Welcome to NeWS.
Brought to you by:
* MicroKernel, Bootloader: Amlal EL Mahrouss.
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootAHCI.cxx b/Private/NewBoot/Source/HEL/AMD64/BootAHCI.cxx
index d736ac59..d04a94d3 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootAHCI.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootAHCI.cxx
@@ -15,4 +15,7 @@
*
*/
+
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/HW/SATA.hxx>
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index 4e41ba2e..d3573064 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -15,8 +15,9 @@
*
*/
-#include <BootKit/HW/ATA.hxx>
+#include <FirmwareKit/EFI.hxx>
#include <BootKit/BootKit.hxx>
+#include <BootKit/HW/ATA.hxx>
/// bugs: 0
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
index 33067380..aab5db1f 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
@@ -8,6 +8,8 @@
------------------------------------------- */
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
#include <FirmwareKit/Handover.hxx>
#include <cstddef>
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index 42852b5d..d314c949 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -4,6 +4,7 @@
------------------------------------------- */
+#include <FirmwareKit/EFI.hxx>
#include <BootKit/BootKit.hxx>
#include <BootKit/Rsrc/NewBoot.rsrc>
#include <Builtins/Toolbox/Toolbox.hxx>
@@ -58,9 +59,6 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
.Write(SystemTable->FirmwareVendor)
.Write(L"\r\n");
- BootDeviceATA ataDev;
- Boolean isGptFound = No;
-
UInt32 MapKey = 0;
UInt32* SizePtr = nullptr;
EfiMemoryDescriptor* Descriptor = nullptr;
@@ -185,7 +183,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
L"New Boot can't run this architecture.");
}
- BootMainKind main = (BootMainKind) nullptr;
+ NewOS::HEL::BootMainKind main = (NewOS::HEL::BootMainKind) nullptr;
if (!main) {
EFI::RaiseHardError(L"Bad-Exec",
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx b/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
index d0da09b7..f47e3532 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
@@ -4,6 +4,8 @@
------------------------------------------- */
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
EXTERN_C void rt_hlt() { asm volatile("hlt"); }
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootString.cxx b/Private/NewBoot/Source/HEL/AMD64/BootString.cxx
index 1c6b528e..ef0e4744 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootString.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootString.cxx
@@ -11,6 +11,8 @@
------------------------------------------- */
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
/// bugs 0
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
index 2ebde023..81aa6c9d 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
@@ -11,6 +11,8 @@
------------------------------------------- */
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
/// BUGS: 0
diff --git a/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx b/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
index 1bb2d9ca..77552ef8 100644
--- a/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
@@ -4,6 +4,8 @@
------------------------------------------- */
+#include <BootKit/Platform.hxx>
+#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
#include <cstddef> /* Since we're using GCC for this EFI program. */
diff --git a/Private/NewBoot/Source/HEL/AMD64/Support.cxx b/Private/NewBoot/Source/HEL/AMD64/Support.cxx
new file mode 100644
index 00000000..c6b62630
--- /dev/null
+++ b/Private/NewBoot/Source/HEL/AMD64/Support.cxx
@@ -0,0 +1,32 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <FirmwareKit/EFI/EFI.hxx>
+#include <FirmwareKit/Handover.hxx>
+#include <BootKit/Vendor/Support.hxx>
+
+/// @brief memset definition in C++.
+/// @param dst destination pointer.
+/// @param byte value to fill in.
+/// @param len length of of src.
+EXTERN_C VoidPtr memset(void *dst, int byte,
+ long long unsigned int len) {
+ SetMem(dst, byte, len);
+ return dst;
+}
+
+/// @brief memcpy definition in C++.
+/// @param dst destination pointer.
+/// @param src source pointer.
+/// @param len length of of src.
+EXTERN_C VoidPtr memcpy(void *dst, const void *src,
+ long long unsigned int len) {
+ CopyMem(dst, src, len);
+ return dst;
+}
+
+/// @brief somthing specific to the microsoft ABI, regarding checking the stack.
+EXTERN_C void ___chkstk_ms(void) {}
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 2f9e3756..11c1da75 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -36,7 +36,7 @@ FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mno-red-zone -D__KERNEL__ -D__NEWBOOT__
invalid-recipe:
@echo "invalid-recipe: Use make bootloader-<arch> instead."
-KERNEL_OBJ=kernel.bin
+KERNEL_OBJ=boot.bin
DD=dd
IMG_CREATE=qemu-img
MAX_KERNEL_SIZE=1024K