From 7d37f8a8a1f8ceb38880f13f349ddeee95458645 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sun, 18 May 2025 19:45:09 +0000 Subject: [PATCH] feat(kernel): :art: update BGRT header --- CREDITS.md | 5 ++++ Kernel/include/acpi.hpp | 56 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index bf46d1da..5a365d0b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -127,6 +127,11 @@ License information can be found in the [LICENSES.md](LICENSES.md) file. - [Rust OS Development: UEFI](https://blog.malware.re/2023/09/01/rust-os-part2/index.html) - [GUIDs Database](https://github.com/DSecurity/efiSeek/blob/master/data/guids-db.ini) +## BGRT +- [BGRT on OSDev](https://wiki.osdev.org/BGRT) +- [BMP File Structure @ Gdansk University of Technology](http://www.ue.eti.pg.gda.pl/fpgalab/zadania.spartan3/zad_vga_struktura_pliku_bmp_en.html) +- [BGRT @ Purdue University](https://engineering.purdue.edu/ece264/16au/hw/HW13) + --- Special thanks to all contributors and the creators of the referenced projects and resources! diff --git a/Kernel/include/acpi.hpp b/Kernel/include/acpi.hpp index 31c531a1..55db6847 100644 --- a/Kernel/include/acpi.hpp +++ b/Kernel/include/acpi.hpp @@ -86,7 +86,7 @@ namespace ACPI SUBTYPE_SERIAL_RISC_V_SBI_Console = 0x0015, SUBTYPE_1394_IEEE1394_HCI = 0x0000, - + SUBTYPE_USB_XHCI = 0x0000, SUBTYPE_USB_EHCI = 0x0001, @@ -193,11 +193,63 @@ namespace ACPI struct BGRTHeader { ACPIHeader Header; + + /** + * Version. This value must be 1. + */ uint16_t Version; - uint8_t Status; + + /** + * Status of the image + */ + union + { + struct + { + /** + * Indicates that the image graphic is displayed. + */ + uint8_t Displayed : 1; + + /** + * Orientation + * + * 0b00 - 0˚ + * 0b01 - 90˚ + * 0b10 - 180˚ + * 0b11 - 270˚ + */ + uint8_t OrientationOffset : 2; + + /** + * This field is reserved and must be zero. + */ + uint8_t Reserved : 5; + }; + uint8_t raw; + } Status; + + /** + * Image type + * + * 0 - Bitmap + * 1-255 - Reserved + */ uint8_t ImageType; + + /** + * Physical address of the image pointing to firmware's in-memory copy of the image bitmap. + */ uint64_t ImageAddress; + + /** + * X-offset of the boot image. + */ uint32_t ImageOffsetX; + + /** + * Y-offset of the boot image. + */ uint32_t ImageOffsetY; } __packed;