Kernel: Use enums in boot info instead of magic values

This commit is contained in:
2024-10-14 11:36:51 +03:00
parent 4ba33175cf
commit 2b43569927
4 changed files with 82 additions and 42 deletions

View File

@@ -8,36 +8,45 @@
namespace Kernel
{
enum class FramebufferType
{
NONE,
UNKNOWN,
RGB
};
struct FramebufferInfo
{
paddr_t address;
uint32_t pitch;
uint32_t width;
uint32_t height;
uint8_t bpp;
FramebufferType type = FramebufferType::NONE;
enum class Type
{
None,
Unknown,
RGB,
};
paddr_t address;
uint32_t pitch;
uint32_t width;
uint32_t height;
uint8_t bpp;
Type type;
};
struct MemoryMapEntry
{
uint32_t type;
paddr_t address;
uint64_t length;
enum class Type
{
Available,
Reserved,
ACPIReclaim,
ACPINVS,
};
paddr_t address;
uint64_t length;
Type type;
};
struct BootInfo
{
BAN::String command_line;
FramebufferInfo framebuffer {};
RSDP rsdp {};
paddr_t kernel_paddr {};
BAN::String command_line;
FramebufferInfo framebuffer {};
RSDP rsdp {};
paddr_t kernel_paddr {};
BAN::Vector<MemoryMapEntry> memory_map_entries;
};