Xyris
0.5
Handoff.hpp
Go to the documentation of this file.
1
/**
2
* @file Handoff.hpp
3
* @author Keeton Feavel (
[email protected]
)
4
* @brief
5
* @version 0.1
6
* @date 2021-06-02
7
*
8
* @copyright Copyright the Xyris Contributors (c) 2021
9
*
10
*/
11
#pragma once
12
#include <
Devices/Graphics/framebuffer.hpp
>
13
#include <
Memory/MemoryMap.hpp
>
14
#include <stdint.h>
15
16
namespace
Boot
{
17
18
enum
HandoffBootloaderType
{
19
Stivale2
= 0,
20
};
21
22
// Unused for now.
23
class
HandoffRSDPDescriptor
{
24
public
:
25
// Constructors
26
// TODO: Parameters
27
HandoffRSDPDescriptor
();
28
~HandoffRSDPDescriptor
();
29
// Getters
30
const
char
*
getSignature
() {
return
m_signature
; }
31
uint8_t
getChecksum
() {
return
m_checksum
; }
32
const
char
*
getOEMID
() {
return
m_OEMID
; }
33
uint8_t
getRevision
() {
return
m_revision
; }
34
uint32_t
getRSDTAddress
() {
return
m_rsdtAddress
; }
35
36
private
:
37
char
m_signature
[8];
38
uint8_t
m_checksum
;
39
char
m_OEMID
[6];
40
uint8_t
m_revision
;
41
uint32_t
m_rsdtAddress
;
42
};
43
44
// Unused for now.
45
class
HandoffCPUDescriptor
{
46
public
:
47
// Constructors
48
// TODO: Parameters
49
HandoffCPUDescriptor
();
50
~HandoffCPUDescriptor
();
51
// Getters
52
uint32_t
getCPUID
() {
return
m_cpuID
; }
53
uint32_t
getLAPICID
() {
return
m_lapicID
; }
54
void
*
getStackAddr
() {
return
m_stackAddr
; }
55
void
*
getGotoAddr
() {
return
m_gotoAddr
; }
56
void
*
getArguments
() {
return
m_arguments
; }
57
58
private
:
59
uint32_t
m_cpuID
;
60
uint32_t
m_lapicID
;
61
void
*
m_stackAddr
;
62
void
*
m_gotoAddr
;
63
void
*
m_arguments
;
64
};
65
66
// Unused for now.
67
class
HandoffSMPDescriptor
{
68
public
:
69
// Constructors
70
// TODO: Parameters
71
HandoffSMPDescriptor
();
72
~HandoffSMPDescriptor
();
73
// Getters
74
bool
getX2Available
() {
return
m_x2Available
; }
75
uint32_t
getLAPICID
() {
return
m_lapicID
; }
76
uint64_t
getCPUCount
() {
return
m_cpuCount
; }
77
78
private
:
79
bool
m_x2Available
;
80
uint32_t
m_lapicID
;
81
uint64_t
m_cpuCount
;
82
};
83
84
// TODO: Remaining information to be made obtainable
85
// * PXE IP address (once we have a nice IP struct)
86
// * Update Stivale2 to latest version & add missing
87
// * Kernel modules (linked list of some sort?)
88
class
Handoff
{
89
public
:
90
// Constructors
91
Handoff
();
92
Handoff
(
void
* handoff, uint32_t magic);
93
// Getters
94
const
char
*
CmdLine
() {
return
m_cmdline
; }
95
const
void
*
Handle
() {
return
m_handle
; }
96
Graphics::Framebuffer
*
FramebufferInfo
() {
return
&
m_framebuffer
; }
97
HandoffBootloaderType
*
BootType
() {
return
&
m_bootType
; }
98
Memory::MemoryMap
*
MemoryMap
() {
return
&
m_memoryMap
; }
99
100
private
:
101
static
void
parseStivale2
(
Handoff
* that,
void
* handoff);
102
103
void
*
m_handle
;
104
char
*
m_cmdline
;
105
uint32_t
m_magic
;
106
Graphics::Framebuffer
m_framebuffer
;
107
HandoffBootloaderType
m_bootType
;
108
Memory::MemoryMap
m_memoryMap
;
109
};
110
111
};
// !namespace Boot
Boot::Handoff::BootType
HandoffBootloaderType * BootType()
Definition:
Handoff.hpp:97
Boot::Handoff
Definition:
Handoff.hpp:88
Boot::Handoff::CmdLine
const char * CmdLine()
Definition:
Handoff.hpp:94
Boot::Handoff::MemoryMap
Memory::MemoryMap * MemoryMap()
Definition:
Handoff.hpp:98
Boot::HandoffSMPDescriptor::HandoffSMPDescriptor
HandoffSMPDescriptor()
Boot::Handoff::Handle
const void * Handle()
Definition:
Handoff.hpp:95
Boot::HandoffSMPDescriptor::getLAPICID
uint32_t getLAPICID()
Definition:
Handoff.hpp:75
Boot::Handoff::parseStivale2
static void parseStivale2(Handoff *that, void *handoff)
Definition:
Handoff.cpp:66
Boot::HandoffCPUDescriptor::~HandoffCPUDescriptor
~HandoffCPUDescriptor()
Boot::HandoffCPUDescriptor::getStackAddr
void * getStackAddr()
Definition:
Handoff.hpp:54
Boot::HandoffRSDPDescriptor::HandoffRSDPDescriptor
HandoffRSDPDescriptor()
Boot::HandoffCPUDescriptor::getGotoAddr
void * getGotoAddr()
Definition:
Handoff.hpp:55
Boot::HandoffRSDPDescriptor::m_OEMID
char m_OEMID[6]
Definition:
Handoff.hpp:39
Boot::Handoff::Handoff
Handoff()
Definition:
Handoff.cpp:38
Boot::HandoffRSDPDescriptor
Definition:
Handoff.hpp:23
Boot::HandoffCPUDescriptor::m_stackAddr
void * m_stackAddr
Definition:
Handoff.hpp:61
framebuffer.hpp
Boot::HandoffCPUDescriptor
Definition:
Handoff.hpp:45
Boot::HandoffRSDPDescriptor::getRevision
uint8_t getRevision()
Definition:
Handoff.hpp:33
Boot::HandoffRSDPDescriptor::getSignature
const char * getSignature()
Definition:
Handoff.hpp:30
Boot::HandoffRSDPDescriptor::m_revision
uint8_t m_revision
Definition:
Handoff.hpp:40
Boot::HandoffSMPDescriptor::m_cpuCount
uint64_t m_cpuCount
Definition:
Handoff.hpp:81
Memory::MemoryMap
Definition:
MemoryMap.hpp:17
Boot::HandoffCPUDescriptor::getArguments
void * getArguments()
Definition:
Handoff.hpp:56
MemoryMap.hpp
Memory map containing a number of Memory sections that describe the physical memory layout.
Boot::HandoffRSDPDescriptor::m_signature
char m_signature[8]
Definition:
Handoff.hpp:37
Boot::Handoff::m_handle
void * m_handle
Definition:
Handoff.hpp:103
Boot::Handoff::m_bootType
HandoffBootloaderType m_bootType
Definition:
Handoff.hpp:107
Boot::HandoffCPUDescriptor::m_lapicID
uint32_t m_lapicID
Definition:
Handoff.hpp:60
Boot::HandoffRSDPDescriptor::m_checksum
uint8_t m_checksum
Definition:
Handoff.hpp:38
Graphics::Framebuffer
Definition:
framebuffer.hpp:21
Boot::HandoffCPUDescriptor::getLAPICID
uint32_t getLAPICID()
Definition:
Handoff.hpp:53
Boot::HandoffRSDPDescriptor::getChecksum
uint8_t getChecksum()
Definition:
Handoff.hpp:31
Boot::HandoffSMPDescriptor::getCPUCount
uint64_t getCPUCount()
Definition:
Handoff.hpp:76
Boot::HandoffRSDPDescriptor::~HandoffRSDPDescriptor
~HandoffRSDPDescriptor()
Boot::HandoffSMPDescriptor::~HandoffSMPDescriptor
~HandoffSMPDescriptor()
Boot::HandoffRSDPDescriptor::m_rsdtAddress
uint32_t m_rsdtAddress
Definition:
Handoff.hpp:41
Boot::HandoffCPUDescriptor::HandoffCPUDescriptor
HandoffCPUDescriptor()
Boot::Handoff::m_magic
uint32_t m_magic
Definition:
Handoff.hpp:105
Boot::Handoff::FramebufferInfo
Graphics::Framebuffer * FramebufferInfo()
Definition:
Handoff.hpp:96
Boot::HandoffBootloaderType
HandoffBootloaderType
Definition:
Handoff.hpp:18
Boot::HandoffSMPDescriptor::getX2Available
bool getX2Available()
Definition:
Handoff.hpp:74
Boot::HandoffSMPDescriptor::m_lapicID
uint32_t m_lapicID
Definition:
Handoff.hpp:80
Boot::HandoffSMPDescriptor::m_x2Available
bool m_x2Available
Definition:
Handoff.hpp:79
Boot::Handoff::m_framebuffer
Graphics::Framebuffer m_framebuffer
Definition:
Handoff.hpp:106
Boot::HandoffCPUDescriptor::m_arguments
void * m_arguments
Definition:
Handoff.hpp:63
Boot::HandoffCPUDescriptor::getCPUID
uint32_t getCPUID()
Definition:
Handoff.hpp:52
Boot::Handoff::m_memoryMap
Memory::MemoryMap m_memoryMap
Definition:
Handoff.hpp:108
Boot::HandoffCPUDescriptor::m_cpuID
uint32_t m_cpuID
Definition:
Handoff.hpp:59
Boot::HandoffCPUDescriptor::m_gotoAddr
void * m_gotoAddr
Definition:
Handoff.hpp:62
Boot::HandoffRSDPDescriptor::getRSDTAddress
uint32_t getRSDTAddress()
Definition:
Handoff.hpp:34
Boot
Definition:
Arguments.cpp:15
Boot::HandoffSMPDescriptor
Definition:
Handoff.hpp:67
Boot::HandoffRSDPDescriptor::getOEMID
const char * getOEMID()
Definition:
Handoff.hpp:32
Boot::Handoff::m_cmdline
char * m_cmdline
Definition:
Handoff.hpp:104
Boot::Stivale2
@ Stivale2
Definition:
Handoff.hpp:19
Kernel
Bootloader
Handoff.hpp
Generated by
1.8.17