summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-23 00:59:31 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-23 01:04:00 +0100
commit77bf7cab39fef40797e8832aaef91abbdf0098f5 (patch)
tree157f6f82188c505f1333abf93aeda63b3373cf04 /Private
parent954285b6c9553a047d0789707ad520c84099e74a (diff)
Kernel and Bootloader: See below.
Kernel: Add kPefArchPowerPC type. Kernel: Working on NewFS support for NewKernel. Kernel: Cleaned-up DriveManager. Kernel: Use kernel mouse on install mode. Bootloader: Refactor and cleanup. FirmwareKit: Fix EPM header. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private')
-rw-r--r--Private/Builtins/PS2/PS2MouseInterface.hxx12
-rw-r--r--Private/CompilerKit/Version.hxx4
-rw-r--r--Private/FirmwareKit/EPM.hxx8
-rw-r--r--Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp14
-rw-r--r--Private/HALKit/AMD64/HalInterruptRouting.asm14
-rw-r--r--Private/HALKit/AMD64/HalKernelMain.cxx8
-rw-r--r--Private/HALKit/AMD64/HalKernelMouse.cxx27
-rw-r--r--Private/HALKit/AMD64/Storage/ATA.cxx10
-rw-r--r--Private/KernelKit/DeviceManager.hpp6
-rw-r--r--Private/KernelKit/DriveManager.hxx17
-rw-r--r--Private/KernelKit/PEF.hpp7
-rw-r--r--Private/LinkerScripts/16x0.json2
-rw-r--r--Private/LinkerScripts/32x0.json2
-rw-r--r--Private/LinkerScripts/64x0.json2
-rwxr-xr-xPrivate/MoveAll.sh2
-rw-r--r--Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx2
-rw-r--r--Private/NewBoot/Source/CDROM/INSTALLER/.gitkeep0
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx12
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx4
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx8
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx34
-rw-r--r--Private/NewBoot/Source/makefile3
-rw-r--r--Private/Source/CxxAbi.cxx2
-rw-r--r--Private/Source/KernelCheck.cxx2
-rw-r--r--Private/Source/NewFS+IO.cxx4
-rw-r--r--Private/Source/NewFS+Journal.cxx2
-rw-r--r--Private/Source/ThreadLocalStorage.cxx6
-rw-r--r--Private/makefile2
28 files changed, 98 insertions, 118 deletions
diff --git a/Private/Builtins/PS2/PS2MouseInterface.hxx b/Private/Builtins/PS2/PS2MouseInterface.hxx
index 682151e9..f37d294e 100644
--- a/Private/Builtins/PS2/PS2MouseInterface.hxx
+++ b/Private/Builtins/PS2/PS2MouseInterface.hxx
@@ -28,7 +28,7 @@ class PS2MouseInterface final {
public:
Void Init() noexcept {
- HCore::kcout << "HCoreKrnl.exe: Enabling PS/2 mouse...\r\n";
+ HCore::kcout << "NewKernel.exe: Enabling PS/2 mouse...\r\n";
this->Write(0xFF);
@@ -54,7 +54,7 @@ class PS2MouseInterface final {
this->Write(0xF4);
auto f4Dat = this->Read();
- HCore::kcout << "HCoreKrnl.exe: PS/2 mouse is OK: " << hex_number(f6Dat);
+ HCore::kcout << "NewKernel.exe: PS/2 mouse is OK: " << hex_number(f6Dat);
HCore::kcout << ", " << hex_number(f4Dat) << end_line();
}
@@ -64,14 +64,14 @@ class PS2MouseInterface final {
while (timeout) {
if ((HAL::In8(0x64) & 0x1)) {
- HCore::kcout << "HCoreKrnl.exe: Wait: OK\r\n";
+ HCore::kcout << "NewKernel.exe: Wait: OK\r\n";
return true;
}
--timeout;
} // wait until we can read
- HCore::kcout << "HCoreKrnl.exe: Wait: Timeout\r\n";
+ HCore::kcout << "NewKernel.exe: Wait: Timeout\r\n";
// return the ack bit.
return false;
}
@@ -81,14 +81,14 @@ class PS2MouseInterface final {
while (timeout) {
if ((HAL::In8(0x64) & 0b10) == 0) {
- HCore::kcout << "HCoreKrnl.exe: Wait: OK\r\n";
+ HCore::kcout << "NewKernel.exe: Wait: OK\r\n";
return true;
}
--timeout;
} // wait until we can read
- HCore::kcout << "HCoreKrnl.exe: Wait: Timeout\r\n";
+ HCore::kcout << "NewKernel.exe: Wait: Timeout\r\n";
// return the ack bit.
return false;
}
diff --git a/Private/CompilerKit/Version.hxx b/Private/CompilerKit/Version.hxx
index d21cc80f..068b2189 100644
--- a/Private/CompilerKit/Version.hxx
+++ b/Private/CompilerKit/Version.hxx
@@ -1,4 +1,4 @@
#pragma once
-#define BOOTLOADER_VERSION L"v1.14.1"
-#define KERNEL_VERSION "v1.14.1"
+#define BOOTLOADER_VERSION L"v1.14.2"
+#define KERNEL_VERSION "v1.14.2"
diff --git a/Private/FirmwareKit/EPM.hxx b/Private/FirmwareKit/EPM.hxx
index ae0a4a54..97ff8a57 100644
--- a/Private/FirmwareKit/EPM.hxx
+++ b/Private/FirmwareKit/EPM.hxx
@@ -21,10 +21,10 @@
/// @brief EPM GUID block.
typedef struct BlockGUID {
- UInt32 Data1;
- UInt16 Data2;
- UInt16 Data3;
- UInt8 Data4[8];
+ HCore::UInt32 Data1;
+ HCore::UInt16 Data2;
+ HCore::UInt16 Data3;
+ HCore::UInt8 Data4[8];
} BlockGUID;
/**
diff --git a/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp b/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp
index e95e8902..78b69bff 100644
--- a/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp
+++ b/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp
@@ -11,10 +11,10 @@
EXTERN_C void idt_handle_gpf(HCore::UIntPtr rsp) {
MUST_PASS(HCore::ProcessManager::Shared().Leak().GetCurrent());
- HCore::kcout << "HCoreKrnl.exe: Stack Pointer: " << HCore::StringBuilder::FromInt("rsp{%}", rsp);
+ HCore::kcout << "NewKernel.exe: Stack Pointer: " << HCore::StringBuilder::FromInt("rsp{%}", rsp);
HCore::kcout
- << "HCoreKrnl.exe: General Protection Fault, caused by "
+ << "NewKernel.exe: General Protection Fault, caused by "
<< HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().GetName();
HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().Crash();
@@ -24,13 +24,13 @@ EXTERN_C void idt_handle_scheduler(HCore::UIntPtr rsp) {
HCore::kcout << HCore::StringBuilder::FromInt("rsp{%}", rsp);
HCore::kcout
- << "HCoreKrnl.exe: Will be scheduled back later "
+ << "NewKernel.exe: Will be scheduled back later "
<< HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().GetName()
<< HCore::end_line();
/// schedule another process.
if (!HCore::ProcessHelper::StartScheduling()) {
- HCore::kcout << "HCoreKrnl.exe: Continue schedule this process...\r\n";
+ HCore::kcout << "NewKernel.exe: Continue schedule this process...\r\n";
}
}
@@ -40,7 +40,7 @@ EXTERN_C void idt_handle_pf(HCore::UIntPtr rsp) {
MUST_PASS(HCore::ProcessManager::Shared().Leak().GetCurrent());
HCore::kcout
- << "HCoreKrnl.exe: Segmentation Fault, caused by "
+ << "NewKernel.exe: Segmentation Fault, caused by "
<< HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().GetName();
HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().Crash();
@@ -52,7 +52,7 @@ EXTERN_C void idt_handle_math(HCore::UIntPtr rsp) {
MUST_PASS(HCore::ProcessManager::Shared().Leak().GetCurrent());
HCore::kcout
- << "HCoreKrnl.exe: Math error, caused by "
+ << "NewKernel.exe: Math error, caused by "
<< HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().GetName();
HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().Crash();
@@ -64,7 +64,7 @@ EXTERN_C void idt_handle_generic(HCore::UIntPtr rsp) {
MUST_PASS(HCore::ProcessManager::Shared().Leak().GetCurrent());
HCore::kcout
- << "HCoreKrnl.exe: Execution error, caused by "
+ << "NewKernel.exe: Execution error, caused by "
<< HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().GetName();
HCore::ProcessManager::Shared().Leak().GetCurrent().Leak().Crash();
diff --git a/Private/HALKit/AMD64/HalInterruptRouting.asm b/Private/HALKit/AMD64/HalInterruptRouting.asm
index fe6fd2b5..384f775c 100644
--- a/Private/HALKit/AMD64/HalInterruptRouting.asm
+++ b/Private/HALKit/AMD64/HalInterruptRouting.asm
@@ -130,6 +130,7 @@ IntNormal 41
IntNormal 42
IntNormal 43
+;; Mapped according to PIC remap.
__HCR_INT_44:
cli
@@ -139,15 +140,6 @@ __HCR_INT_44:
pop rax
- push rax
-
- ;; Find and execute system call TODO
-
- mov rcx, kMouseLabelExit
- call ke_io_print
-
- pop rax
-
sti
iretq
@@ -220,6 +212,4 @@ kInterruptVectorTable:
%endrep
kSystemCallLabel:
- db "HCoreKrnl.exe: SystemCall: Enter SCM.", 0xa, 0xd, 0
-kMouseLabelExit:
- db "HCoreKrnl.exe: KernelMouse: Acknowledge Interrupt.", 0xa, 0xd, 0 \ No newline at end of file
+ db "NewKernel.exe: SystemCall: Enter SCM.", 0xa, 0xd, 0 \ No newline at end of file
diff --git a/Private/HALKit/AMD64/HalKernelMain.cxx b/Private/HALKit/AMD64/HalKernelMain.cxx
index abbf5feb..c2b6dfbb 100644
--- a/Private/HALKit/AMD64/HalKernelMain.cxx
+++ b/Private/HALKit/AMD64/HalKernelMain.cxx
@@ -19,6 +19,9 @@
///! @brief Disk contains HCore files.
#define kInstalledMedia 0xDD
+EXTERN_C HCore::Void _hal_draw_mouse();
+EXTERN_C HCore::Void _hal_init_mouse();
+
EXTERN_C HCore::VoidPtr kInterruptVectorTable[];
EXTERN_C void RuntimeMain(
@@ -83,6 +86,11 @@ EXTERN_C void RuntimeMain(
/// TODO: Parse system configuration.
} else {
/// TODO: Install hcore on host.
+ _hal_init_mouse();
+
+ while (true) {
+ _hal_draw_mouse();
+ }
}
HCore::ke_stop(RUNTIME_CHECK_BOOTSTRAP);
diff --git a/Private/HALKit/AMD64/HalKernelMouse.cxx b/Private/HALKit/AMD64/HalKernelMouse.cxx
index 2427ff2d..b71c00ed 100644
--- a/Private/HALKit/AMD64/HalKernelMouse.cxx
+++ b/Private/HALKit/AMD64/HalKernelMouse.cxx
@@ -33,7 +33,6 @@ using namespace HCore;
/// @brief Interrupt handler for the mouse.
/// @return
EXTERN_C Void _hal_mouse_handler() {
-#ifdef __DEBUG__
HCore::UInt8 data = HCore::HAL::In8(0x60);
switch (kMouseCycle) {
@@ -72,13 +71,11 @@ EXTERN_C Void _hal_mouse_handler() {
HCore::HAL::Out8(0x20, 0x20);
HCore::HAL::Out8(0xA0, 0x20);
-#endif
}
/// @brief Draws the kernel's mouse.
/// @return void
-EXTERN_C Void _hal_mouse_draw() {
-#ifdef __DEBUG__
+EXTERN_C Void _hal_draw_mouse() {
if (!kMousePacketReady) return;
bool xNeg, yNeg, xOvf, yOvf;
@@ -119,25 +116,7 @@ EXTERN_C Void _hal_mouse_draw() {
kPrevY = kMousePacket[2];
kMousePacketReady = false;
-#endif
}
-/// @brief Inital kernel mouse initializer
-/// @param
-EXTERN_C Void _hal_init_mouse(void) {
-#ifdef __DEBUG__
- kMousePS2.Init();
-
- auto pic1Port = 0x20;
- auto pic2Port = 0xA0;
-
- auto mask = 1 << 12;
- auto currentMask = HCore::HAL::In8(pic1Port + 1);
- auto newMask = currentMask & ~mask;
- HCore::HAL::Out8(pic1Port + 1, newMask);
-
- currentMask = HCore::HAL::In8(pic2Port + 1);
- newMask = currentMask & ~mask;
- HCore::HAL::Out8(pic2Port + 1, newMask);
-#endif
-} \ No newline at end of file
+/// @brief Init kernel mouse.
+EXTERN_C Void _hal_init_mouse() { kMousePS2.Init(); } \ No newline at end of file
diff --git a/Private/HALKit/AMD64/Storage/ATA.cxx b/Private/HALKit/AMD64/Storage/ATA.cxx
index 6a4a0252..854b166e 100644
--- a/Private/HALKit/AMD64/Storage/ATA.cxx
+++ b/Private/HALKit/AMD64/Storage/ATA.cxx
@@ -72,7 +72,7 @@ ATAInit_Retry:
auto statRdy = In8(IO + ATA_REG_STATUS);
if (statRdy & ATA_SR_ERR) {
- kcout << "HCoreKrnl.exe: ATA: Select error, not an IDE based hard-drive.\r\n";
+ kcout << "NewKernel.exe: ATA: Select error, not an IDE based hard-drive.\r\n";
return false;
}
@@ -107,21 +107,21 @@ ATAInit_Retry:
/* differentiate ATA, ATAPI, SATA and SATAPI */
if (cl == 0x14 && ch == 0xEB) {
- kcout << "HCoreKrnl.exe: PATAPI drive detected.\r\n";
+ kcout << "NewKernel.exe: PATAPI drive detected.\r\n";
kATADeviceType = kATADevicePATA_PI;
}
if (cl == 0x69 && ch == 0x96) {
- kcout << "HCoreKrnl.exe: SATAPI drive detected.\r\n";
+ kcout << "NewKernel.exe: SATAPI drive detected.\r\n";
kATADeviceType = kATADeviceSATA_PI;
}
if (cl == 0x0 && ch == 0x0) {
- kcout << "HCoreKrnl.exe: PATA drive detected.\r\n";
+ kcout << "NewKernel.exe: PATA drive detected.\r\n";
kATADeviceType = kATADevicePATA;
}
if (cl == 0x3c && ch == 0xc3) {
- kcout << "HCoreKrnl.exe: SATA drive detected.\r\n";
+ kcout << "NewKernel.exe: SATA drive detected.\r\n";
kATADeviceType = kATADeviceSATA;
}
diff --git a/Private/KernelKit/DeviceManager.hpp b/Private/KernelKit/DeviceManager.hpp
index 4c9c7970..4eada620 100644
--- a/Private/KernelKit/DeviceManager.hpp
+++ b/Private/KernelKit/DeviceManager.hpp
@@ -14,9 +14,9 @@
#pragma once
-/* HCore */
-/* File: KernelKit/Device.hpp */
-/* Device abstraction and I/O buffer. */
+/* HCore device interface manager. */
+/* @file KernelKit/DeviceManager.hpp */
+/* @brief Device abstraction and I/O buffer. */
#include <NewKit/ErrorOr.hpp>
#include <NewKit/Ref.hpp>
diff --git a/Private/KernelKit/DriveManager.hxx b/Private/KernelKit/DriveManager.hxx
index abca0ad3..40933aad 100644
--- a/Private/KernelKit/DriveManager.hxx
+++ b/Private/KernelKit/DriveManager.hxx
@@ -54,26 +54,21 @@ struct DriveTrait final {
Void (*fVerify)(DrivePacket* packetPtr);
};
-#define kDrivePacketBinary "file/x-binary"
-#define kDrivePacketSource "file/x-source"
-#define kDrivePacketASCII "file/x-ascii"
-#define kDrivePacketZip "file/x-zip"
-
//! drive as a device.
typedef DeviceInterface<DriveTrait> DriveDevice;
typedef DriveDevice* DriveDevicePtr;
/**
- * @brief Abstracted hard-drive container class.
+ * @brief Mounted drives interface.
* @note This class has all of it's drive set to nullptr, allocate them using
* GetAddressOf(index).
*/
-class Mountpoint final {
+class MountpointInterface final {
public:
- explicit Mountpoint() = default;
- ~Mountpoint() = default;
+ explicit MountpointInterface() = default;
+ ~MountpointInterface() = default;
- HCORE_COPY_DEFAULT(Mountpoint);
+ HCORE_COPY_DEFAULT(MountpointInterface);
public:
DriveDevicePtr A() { return mA; }
@@ -95,7 +90,7 @@ class Mountpoint final {
return &mD;
default: {
DbgLastError() = kErrorNoSuchDisk;
- kcout << "HCoreKrnl\\Mountpoint: Check HError.\n";
+ kcout << "NewKernel.exe: Check HError.\n";
break;
}
diff --git a/Private/KernelKit/PEF.hpp b/Private/KernelKit/PEF.hpp
index e1750242..df95d82e 100644
--- a/Private/KernelKit/PEF.hpp
+++ b/Private/KernelKit/PEF.hpp
@@ -39,7 +39,8 @@ enum {
kPefArchRISCV,
kPefArch64x0, /* 64x0. ISA */
kPefArch32x0, /* 32x0. ISA */
- kPefArchCount = (kPefArch32x0 - kPefArchIntel86S) + 1,
+ kPefArchPowerPC,
+ kPefArchCount = (kPefArchPowerPC - kPefArchIntel86S) + 1,
kPefArchInvalid = 0xFF,
};
@@ -47,7 +48,7 @@ enum {
kPefKindExec = 1, /* .exe */
kPefKindSharedObject = 2, /* .lib */
kPefKindObject = 4, /* .obj */
- kPefKindDebug = 5, /* .debug */
+ kPefKindDebug = 5, /* .dbg */
kPefKindDriver = 6,
kPefKindCount,
};
@@ -90,7 +91,7 @@ enum {
#define kPefDylibExt ".dll"
#define kPefLibExt ".lib"
#define kPefObjectExt ".obj"
-#define kPefDebugExt ".pdb"
+#define kPefDebugExt ".dbg"
// HCore System Binary Interface.
#define kPefAbi (0xDEAD2)
diff --git a/Private/LinkerScripts/16x0.json b/Private/LinkerScripts/16x0.json
index d5a106ce..1dd7abbd 100644
--- a/Private/LinkerScripts/16x0.json
+++ b/Private/LinkerScripts/16x0.json
@@ -1,6 +1,6 @@
{
"executable_type": "kernel",
- "output_name": "HCoreKrnl.exe",
+ "output_name": "NewKernel.exe",
"start_proc": "Main",
"format": "PEF"
}
diff --git a/Private/LinkerScripts/32x0.json b/Private/LinkerScripts/32x0.json
index d5a106ce..1dd7abbd 100644
--- a/Private/LinkerScripts/32x0.json
+++ b/Private/LinkerScripts/32x0.json
@@ -1,6 +1,6 @@
{
"executable_type": "kernel",
- "output_name": "HCoreKrnl.exe",
+ "output_name": "NewKernel.exe",
"start_proc": "Main",
"format": "PEF"
}
diff --git a/Private/LinkerScripts/64x0.json b/Private/LinkerScripts/64x0.json
index d5a106ce..1dd7abbd 100644
--- a/Private/LinkerScripts/64x0.json
+++ b/Private/LinkerScripts/64x0.json
@@ -1,6 +1,6 @@
{
"executable_type": "kernel",
- "output_name": "HCoreKrnl.exe",
+ "output_name": "NewKernel.exe",
"start_proc": "Main",
"format": "PEF"
}
diff --git a/Private/MoveAll.sh b/Private/MoveAll.sh
index 7170a262..664ad472 100755
--- a/Private/MoveAll.sh
+++ b/Private/MoveAll.sh
@@ -1,7 +1,7 @@
#! /bin/sh
for file in *.o; do
- mv -- "$file" "${file%.o}.obj"
+ mv -- "$file" "${file%.o}.obj"
done
mv *.obj HALKit/AMD64/*.obj Objects/ \ No newline at end of file
diff --git a/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx b/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx
index c6e09fe2..8adfc981 100644
--- a/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx
+++ b/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx
@@ -23,7 +23,7 @@ EXTERN_C void __unwind(void (**finis)(void), int cnt)
EXTERN_C Int32 EfiMain(EfiHandlePtr handle, EfiSystemTable* SystemTable)
{
- SystemTable->ConOut->OutputString(SystemTable->ConOut, L"NewBoot: C++ Runtime Add-in\r\n");
+ SystemTable->ConOut->OutputString(SystemTable->ConOut, L"NewBoot.exe: C++ Runtime Add-in\r\n");
return kEfiOk;
} \ No newline at end of file
diff --git a/Private/NewBoot/Source/CDROM/INSTALLER/.gitkeep b/Private/NewBoot/Source/CDROM/INSTALLER/.gitkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Private/NewBoot/Source/CDROM/INSTALLER/.gitkeep
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index 1d94c776..110bdf08 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -72,7 +72,7 @@ ATAInit_Retry:
if (statRdy & ATA_SR_ERR) {
writer.Write(
- L"NewBoot: ATA: Select error, not an IDE based hard-drive.\r\n");
+ L"NewBoot.exe: ATA: Select error, not an IDE based hard-drive.\r\n");
return false;
}
@@ -108,21 +108,21 @@ ATAInit_Retry:
/* differentiate ATA, ATAPI, SATA and SATAPI */
if (cl == 0x14 && ch == 0xEB) {
- writer.Write(L"NewBoot: PATAPI drive detected.\r\n");
+ writer.Write(L"NewBoot.exe: PATAPI drive detected.\r\n");
kATADeviceType = kATADevicePATA_PI;
}
if (cl == 0x69 && ch == 0x96) {
- writer.Write(L"NewBoot: SATAPI drive detected.\r\n");
+ writer.Write(L"NewBoot.exe: SATAPI drive detected.\r\n");
kATADeviceType = kATADeviceSATA_PI;
}
if (cl == 0x0 && ch == 0x0) {
- writer.Write(L"NewBoot: PATA drive detected.\r\n");
+ writer.Write(L"NewBoot.exe: PATA drive detected.\r\n");
kATADeviceType = kATADevicePATA;
}
if (cl == 0x3c && ch == 0xc3) {
- writer.Write(L"NewBoot: SATA drive detected.\r\n");
+ writer.Write(L"NewBoot.exe: SATA drive detected.\r\n");
kATADeviceType = kATADeviceSATA;
}
@@ -211,7 +211,7 @@ BDeviceATA::BDeviceATA() noexcept {
BTextWriter writer;
- writer.Write(L"NewBoot: Drive is OnLine.\r\n");
+ writer.Write(L"NewBoot.exe: Drive is OnLine.\r\n");
}
}
/**
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
index 6d2998f3..d59251e6 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
@@ -27,11 +27,11 @@ Void boot_try_write_partition_map(const Char* namePart, SizeT namePartLength,
BTextWriter writer;
- writer.Write(L"NewBoot: Reading EPM boot block..\r\n");
+ writer.Write(L"NewBoot.exe: Reading EPM boot block...\r\n");
for (SizeT i = 0; i < kEPMMagicLength; i++) {
if (buf[i] != kEPMMagic[i]) {
- writer.Write(L"NewBoot: Writing EPM boot block..\r\n");
+ writer.Write(L"NewBoot.exe: Writing EPM boot block...\r\n");
BootBlockType* bootBlock = (BootBlockType*)buf;
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
index b9cc7527..01f4787f 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
@@ -46,12 +46,12 @@ BFileReader::BFileReader(const CharacterTypeUTF16* path, EfiHandlePtr ImageHandl
EfiGUID guidImg = EfiGUID(EFI_LOADED_IMAGE_PROTOCOL_GUID);
if (BS->HandleProtocol(ImageHandle, &guidImg, (void**)&img) != kEfiOk) {
- mWriter.Write(L"NewBoot: Fetch-Protocol: No-Such-Protocol").Write(L"\r\n");
+ mWriter.Write(L"NewBoot.exe: Fetch-Protocol: No-Such-Protocol").Write(L"\r\n");
this->mErrorCode = kNotSupported;
}
if (BS->HandleProtocol(img->DeviceHandle, &guidEfp, (void**)&efp) != kEfiOk) {
- mWriter.Write(L"NewBoot: Fetch-Protocol: No-Such-Protocol").Write(L"\r\n");
+ mWriter.Write(L"NewBoot.exe: Fetch-Protocol: No-Such-Protocol").Write(L"\r\n");
this->mErrorCode = kNotSupported;
return;
}
@@ -59,7 +59,7 @@ BFileReader::BFileReader(const CharacterTypeUTF16* path, EfiHandlePtr ImageHandl
/// Start doing disk I/O
if (efp->OpenVolume(efp, &rootFs) != kEfiOk) {
- mWriter.Write(L"NewBoot: Fetch-Protocol: No-Such-Volume").Write(L"\r\n");
+ mWriter.Write(L"NewBoot.exe: Fetch-Protocol: No-Such-Volume").Write(L"\r\n");
this->mErrorCode = kNotSupported;
return;
}
@@ -68,7 +68,7 @@ BFileReader::BFileReader(const CharacterTypeUTF16* path, EfiHandlePtr ImageHandl
if (rootFs->Open(rootFs, &kernelFile, mPath, kEFIFileRead, kEFIReadOnly) !=
kEfiOk) {
- mWriter.Write(L"NewBoot: Fetch-Protocol: No-Such-Path: ")
+ mWriter.Write(L"NewBoot.exe: Fetch-Protocol: No-Such-Path: ")
.Write(mPath)
.Write(L"\r\n");
this->mErrorCode = kNotSupported;
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index b4e7b56d..9b7aa034 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -27,21 +27,22 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
InitGOP(); // Quick Toolkit for UI
BTextWriter writer;
- BDeviceATA ataDrv;
-
- Char namePart[kEPMNameLength] = { "NewKernel Standard System" };
-
- boot_try_write_partition_map(namePart, kEPMNameLength, &ataDrv);
-
/// Splash screen stuff
- writer.Write(L"MahroussLogic (R) NewBoot: ")
+ writer.Write(L"MahroussLogic (R) NewBoot.exe: ")
.Write(BVersionString::Shared());
- writer.Write(L"\r\nNewBoot: Firmware Vendor: ")
+ writer.Write(L"\r\nNewBoot.exe: Firmware Vendor: ")
.Write(SystemTable->FirmwareVendor)
.Write(L"\r\n");
+ BDeviceATA ataDrv;
+
+ if (ataDrv) {
+ Char namePart[kEPMNameLength] = { "HCoreSystemPartition" };
+ boot_try_write_partition_map(namePart, kEPMNameLength, &ataDrv);
+ }
+
/// Read Kernel blob.
BFileReader kernelImg(L".HCORE", ImageHandle);
@@ -123,7 +124,7 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
BCopyMem(handoverHdrPtr->f_FirmwareVendorName, SystemTable->FirmwareVendor,
handoverHdrPtr->f_FirmwareVendorLen);
- writer.Write(L"NewBoot: Fetch ACPI's 'RSD PTR'...").Write(L"\r\n");
+ writer.Write(L"NewBoot.exe: Fetching ACPI's 'RSD PTR'...").Write(L"\r\n");
for (SizeT indexVT = 0; indexVT < SystemTable->NumberOfTableEntries; ++indexVT)
{
@@ -138,14 +139,12 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
vendorTable[6] == 'R' &&
vendorTable[7] == ' ') {
handoverHdrPtr->f_HardwareTables.f_VendorTable = (VoidPtr)vendorTable;
- writer.Write(L"NewBoot: Found ACPI's 'RSD PTR' table on this machine.").Write(L"\r\n");
+ writer.Write(L"NewBoot.exe: Found ACPI's 'RSD PTR' table on this machine.").Write(L"\r\n");
break;
}
}
- EFI::ExitBootServices(MapKey, ImageHandle);
-
/// TODO: Set this to what we found inside NewFS partition.
bool isIniNotFound = true;
@@ -154,20 +153,27 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
handoverHdrPtr->f_Version = 0x1011;
handoverHdrPtr->f_Bootloader = 0x11; // Installer
+ writer.Write(L"NewBoot.exe: Installing NewKernel and it's components...\r\n");
+
+ EFI::ExitBootServices(MapKey, ImageHandle);
+
Main(handoverHdrPtr);
} else {
handoverHdrPtr->f_Magic = kHandoverMagic;
handoverHdrPtr->f_Version = 0x1011;
handoverHdrPtr->f_Bootloader = 0xDD; // System present
- Main(handoverHdrPtr);
+ writer.Write(L"NewBoot.exe: Running NewKernel...\r\n");
+
+ EFI::ExitBootServices(MapKey, ImageHandle);
+
}
EFI::Stop();
return kEfiOk;
} else {
- writer.Write(L"NewBoot: Error-Code: HLDR-0003\r\n");
+ writer.Write(L"NewBoot.exe: Error-Code: HLDR-0003\r\n");
}
EFI::Stop();
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 639fd114..e4ed6cbe 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -37,6 +37,7 @@ bootloader-amd64: compile-amd64
$(LD_GNU) $(OBJ) $(LD_FLAGS) -o NewBoot.exe
$(COPY) NewBoot.exe CDROM/EFI/BOOT/BOOTX64.EFI
$(COPY) NewBoot.exe CDROM/EFI/BOOT/NEWBOOT.EFI
+ $(COPY) ../../NewKernel.exe CDROM/INSTALLER/
.PHONY: compile-amd64
compile-amd64:
@@ -56,7 +57,7 @@ download-edk:
.PHONY: clean
clean:
- $(REM) $(REM_FLAG) $(OBJ) NewBoot.exe HCoreKrnl.exe OVMF.fd
+ $(REM) $(REM_FLAG) $(OBJ) NewBoot.exe NewKernel.exe OVMF.fd
.PHONY: help
help:
diff --git a/Private/Source/CxxAbi.cxx b/Private/Source/CxxAbi.cxx
index 619fe8e0..730e9f81 100644
--- a/Private/Source/CxxAbi.cxx
+++ b/Private/Source/CxxAbi.cxx
@@ -13,7 +13,7 @@ atexit_func_entry_t __atexit_funcs[kDSOMaxObjects];
uarch_t __atexit_func_count;
extern "C" void __cxa_pure_virtual() {
- HCore::kcout << "HCoreKrnl.exe: C++ placeholder method.\n";
+ HCore::kcout << "NewKernel.exe: C++ placeholder method.\n";
}
extern "C" void ___chkstk_ms() {
diff --git a/Private/Source/KernelCheck.cxx b/Private/Source/KernelCheck.cxx
index 0fb81d47..40833a87 100644
--- a/Private/Source/KernelCheck.cxx
+++ b/Private/Source/KernelCheck.cxx
@@ -22,7 +22,7 @@ extern "C" [[noreturn]] void ke_wait_for_debugger() {
namespace HCore {
void ke_stop(const HCore::Int &id) {
kcout << "*** STOP *** \r\n";
- kcout << "*** HCoreKrnl.exe has trigerred a runtime stop. *** \r\n";
+ kcout << "*** NewKernel.exe has trigerred a runtime stop. *** \r\n";
switch (id) {
case RUNTIME_CHECK_PROCESS: {
diff --git a/Private/Source/NewFS+IO.cxx b/Private/Source/NewFS+IO.cxx
index 9d03e3ae..a62970e7 100644
--- a/Private/Source/NewFS+IO.cxx
+++ b/Private/Source/NewFS+IO.cxx
@@ -33,7 +33,7 @@ enum {
kHCFSSubDriveCount,
};
-Int32 ke_newfs_read(Mountpoint* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
+Int32 ke_newfs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
if (!Mnt) return -1;
switch (DrvIndex) {
@@ -58,7 +58,7 @@ Int32 ke_newfs_read(Mountpoint* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
return DrvTrait.fPacket.fPacketGood;
}
-Int32 ke_newfs_write(Mountpoint* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
+Int32 ke_newfs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
if (!Mnt) return -1;
switch (DrvIndex) {
diff --git a/Private/Source/NewFS+Journal.cxx b/Private/Source/NewFS+Journal.cxx
index ec3c5eb7..b693e696 100644
--- a/Private/Source/NewFS+Journal.cxx
+++ b/Private/Source/NewFS+Journal.cxx
@@ -45,7 +45,7 @@ class NewFSJournalRunner final {
switch (operation) {
case kNewFSOpLog: {
if (!classPtr) {
- kcout << "HCoreKrnl.exe: Miss for classPtr at "
+ kcout << "NewKernel.exe: Miss for classPtr at "
"NewFSJournalManager::Run(classPtr) "
<< __FILE__ << "\n";
return false;
diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx
index ab3b8383..45a52e46 100644
--- a/Private/Source/ThreadLocalStorage.cxx
+++ b/Private/Source/ThreadLocalStorage.cxx
@@ -31,7 +31,7 @@ Boolean tls_check_tib(ThreadInformationBlock* tib) {
Encoder encoder;
const char* tibAsBytes = encoder.AsBytes(tib);
- kcout << "HCoreKrnl\\TLS: Checking for a valid cookie...\n";
+ kcout << "NewKernel.exe: Checking for a valid cookie...\n";
return tibAsBytes[0] == kCookieMag0 && tibAsBytes[1] == kCookieMag1 &&
tibAsBytes[2] == kCookieMag2;
@@ -46,9 +46,9 @@ EXTERN_C Void tls_check_syscall_impl(HCore::HAL::StackFramePtr stackPtr) noexcep
ThreadInformationBlock* tib = (ThreadInformationBlock*)stackPtr->Gs;
if (!tls_check_tib(tib)) {
- kcout << "HCoreKrnl\\TLS: Verification failed, Crashing...\n";
+ kcout << "NewKernel.exe: Verification failed, Crashing...\n";
ProcessManager::Shared().Leak().GetCurrent().Leak().Crash();
}
- kcout << "HCoreKrnl\\TLS: Verification succeeded! Keeping on...\n";
+ kcout << "NewKernel.exe: Verification succeeded! Keeping on...\n";
}
diff --git a/Private/makefile b/Private/makefile
index 262bba0f..f1971238 100644
--- a/Private/makefile
+++ b/Private/makefile
@@ -14,7 +14,7 @@ LDFLAGS = -e Main --subsystem=17
LDOBJ = $(wildcard Objects/*.obj)
# This file is the kernel, responsible of task management, memory, drivers and more.
-KERNEL = HCoreKrnl.exe
+KERNEL = NewKernel.exe
# The kernel entrypoint
SCRIPT = --script=Linker/Platforms/PC.lds