diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 22:29:30 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 22:29:30 +0100 |
| commit | 025593a068bc83f64386325b826179cafd95a03f (patch) | |
| tree | d6724e71e4cb855dc747699cb380c01b3e7a10bf /Private/NewBoot/BootKit/BootKit.hxx | |
| parent | 9700c31e4958856ea9e4fa755a43d196fcf50614 (diff) | |
Bootloader: Improve PATA support, but will use UEFI SimpleFile to get
the kernel image.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit/BootKit.hxx')
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 73bbce37..edd8015b 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -83,7 +83,7 @@ class BFileReader final { CharacterType mPath[255]; private: - ATAHelper mHelper; + BATADevice mDevice; }; /***********************************************************************************/ @@ -92,3 +92,40 @@ class BFileReader final { #include <BootKit/Platform.hxx> #include <BootKit/Protocol.hxx> + +#ifdef __EFI_x86_64__ + +inline void out8(UInt16 port, UInt8 value) { + asm volatile("outb %%al, %1" : : "a"(value), "Nd"(port) : "memory"); +} + +inline void out16(UInt16 port, UInt16 value) { + asm volatile("outw %%ax, %1" : : "a"(value), "Nd"(port) : "memory"); +} + +inline void out32(UInt16 port, UInt32 value) { + asm volatile("outl %%eax, %1" : : "a"(value), "Nd"(port) : "memory"); +} + +inline UInt8 in8(UInt16 port) { + UInt8 value = 0UL; + asm volatile("inb %1, %%al" : "=a"(value) : "Nd"(port) : "memory"); + + return value; +} + +inline UInt16 in16(UInt16 port) { + UInt16 value = 0UL; + asm volatile("inw %1, %%ax" : "=a"(value) : "Nd"(port) : "memory"); + + return value; +} + +inline UInt32 in32(UInt16 port) { + UInt32 value = 0UL; + asm volatile("inl %1, %%eax" : "=a"(value) : "Nd"(port) : "memory"); + + return value; +} + +#endif // __EFI_x86_64__
\ No newline at end of file |
