summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-23 21:40:37 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-23 21:40:37 +0100
commit09383c793fe953da6441902b4f66b1382df46738 (patch)
tree9c4e4040ad28818c6f13c96375221609cfc773a5 /Private/NewBoot/Source
parentd9477b8a80ee0dc9a6d05c0353aa989ceaedae8a (diff)
Kernel: See below.
Fix BUG inside ATA driver: Due to bad cast on lba select. Add ToolBox APIs for kernel GUI. Userland: See below. Worked a bit on System.Core, just wrapped Thread.hxx into the System namespace. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot/Source')
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx16
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx4
-rw-r--r--Private/NewBoot/Source/makefile2
3 files changed, 13 insertions, 9 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index 110bdf08..50bab4b7 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -131,7 +131,7 @@ ATAInit_Retry:
return true;
}
-Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
+Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
SizeT SectorSz, SizeT Size) {
UInt8 Command = (!Master ? 0xE0 : 0xF0);
@@ -140,9 +140,9 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0xF));
Out8(IO + ATA_REG_SEC_COUNT0, SectorSz);
- Out8(IO + ATA_REG_LBA0, (UInt8)(Lba));
- Out8(IO + ATA_REG_LBA1, (UInt8)(Lba) >> 8);
- Out8(IO + ATA_REG_LBA2, (UInt8)(Lba) >> 16);
+ Out8(IO + ATA_REG_LBA0, (Lba));
+ Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
+ Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
Out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO);
@@ -164,7 +164,7 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
}
}
-Void boot_ata_write(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
+Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
SizeT SectorSz, SizeT Size) {
UInt8 Command = (!Master ? 0xE0 : 0xF0);
@@ -173,9 +173,9 @@ Void boot_ata_write(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0xF));
Out8(IO + ATA_REG_SEC_COUNT0, SectorSz);
- Out8(IO + ATA_REG_LBA0, (UInt8)(Lba));
- Out8(IO + ATA_REG_LBA1, (UInt8)(Lba) >> 8);
- Out8(IO + ATA_REG_LBA2, (UInt8)(Lba) >> 16);
+ Out8(IO + ATA_REG_LBA0, (Lba));
+ Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
+ Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
Out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO);
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index b9e59db4..ffe7af73 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -162,6 +162,8 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
writer.Write(L"NewBoot.exe: Installing NewKernel and it's components...\r\n");
+ ST->ConOut->ClearScreen(ST->ConOut);
+
EFI::ExitBootServices(MapKey, ImageHandle);
Main(handoverHdrPtr);
@@ -172,6 +174,8 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
writer.Write(L"NewBoot.exe: Running NewKernel...\r\n");
+ ST->ConOut->ClearScreen(ST->ConOut);
+
EFI::ExitBootServices(MapKey, ImageHandle);
}
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 0bded801..e4ed6cbe 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -17,7 +17,7 @@ EMU=qemu-system-x86_64w.exe
endif
IMG=epm.img
-EMU_FLAGS=-net none -smp 2 -m 4G -M q35 -bios OVMF.fd -device piix3-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -drive file=fat:rw:CDROM,index=2,format=raw -d int
+EMU_FLAGS=-net none -smp 2 -m 4G -M q35 -bios OVMF.fd -device piix3-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -drive file=fat:rw:CDROM,index=2,format=raw -serial stdio
LD_FLAGS=-e efi_main --subsystem=10
OBJ=$(wildcard *.o) $(wildcard ../../Objects/*.obj) $(wildcard HEL/AMD64/*.obj)