BarinkOS/source/kernel/drivers/acpi/rsdp.h
Nigel b07b4f0d38 Moving certain aspects into their own static library
Problem:
	As our kernel grows we need more complex datastructures and functions these would come from
	the standard C/C++ library with normal programs.
	The kernel is a freestanding programme and has no access to standard libraries.

Solution:
	We build a mini version of the standard C/C++ library which will contain the
	datastructures and functions we want. This library can then be statically linked
	into our kernel binary.

	Making it a statically linked library also gives more structure to the project.
	Keeping these random functions and datastructures in the kernel just clutters the
	kernel source code with less relevant source code.
2023-02-19 23:38:32 +01:00

35 lines
729 B
C

#pragma once
#include <stdint.h>
#include "./../../terminal/kterm.h"
#include <CoreLib/Memory.h>
struct RSDPTR {
char signature[8];
uint8_t Checksum ;
char OEMID [6];
uint8_t Revision;
uint32_t RsdtAddress;
}__attribute__((packed));
struct ACPISDTHeader{
char Signature[4];
uint32_t Length;
uint8_t CheckSum;
char OEMID[6];
char OEMTableID[8];
uint32_t OEMRevision;
uint32_t CreatorID;
uint32_t CreatorRevision;
}__attribute__((packed));
struct RSDT{
struct ACPISDTHeader header;
uint32_t PointerToSDT[]; // Length of array : (header.Length - sizeof(header))/ 4
}__attribute__((packed));
RSDPTR* FindRSD();
void printRSD(RSDPTR* rsd);
RSDT* getRSDT(RSDPTR* rsd);