Move StartupInformation struct to its own file
This commit is contained in:
parent
35997c61b6
commit
ef15019757
4 changed files with 71 additions and 14 deletions
|
@ -12,26 +12,13 @@
|
||||||
#include "Attributes.hh"
|
#include "Attributes.hh"
|
||||||
#include "Console.hh"
|
#include "Console.hh"
|
||||||
#include "Multiboot.hh"
|
#include "Multiboot.hh"
|
||||||
|
#include "StartupInformation.hh"
|
||||||
#include "kstd/Types.hh"
|
#include "kstd/Types.hh"
|
||||||
#include "memory/Memory.hh"
|
#include "memory/Memory.hh"
|
||||||
|
|
||||||
|
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
||||||
/** Collection of useful tidbits for setting up the system. */
|
|
||||||
struct StartupInformation
|
|
||||||
{
|
|
||||||
/** Starting address of the kernel. */
|
|
||||||
u32 kernelStart;
|
|
||||||
/** Ending address (the first address *after* the last) of the kernel. */
|
|
||||||
u32 kernelEnd;
|
|
||||||
/** Multiboot's magic value. This should be verified. */
|
|
||||||
u32 multibootMagic;
|
|
||||||
/** Pointer to the multiboot information struct. */
|
|
||||||
multiboot::Information* multibootInformation;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/** The kernel itself. */
|
/** The kernel itself. */
|
||||||
struct Kernel
|
struct Kernel
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@ files = [
|
||||||
'Interrupts.cc',
|
'Interrupts.cc',
|
||||||
'Kernel.cc',
|
'Kernel.cc',
|
||||||
'Multiboot.cc',
|
'Multiboot.cc',
|
||||||
|
'StartupInformation.cc',
|
||||||
'PIC.cc',
|
'PIC.cc',
|
||||||
'cxa.cc',
|
'cxa.cc',
|
||||||
'isr.S',
|
'isr.S',
|
||||||
|
|
24
src/StartupInformation.cc
Normal file
24
src/StartupInformation.cc
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/* StartupInformation.cc
|
||||||
|
* vim: set tw=80:
|
||||||
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Definition of the StartupInformation struct.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "StartupInformation.hh"
|
||||||
|
|
||||||
|
namespace kernel {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Public
|
||||||
|
*/
|
||||||
|
|
||||||
|
u32
|
||||||
|
StartupInformation::kernelSize()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return kernelEnd - kernelStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace kernel */
|
45
src/StartupInformation.hh
Normal file
45
src/StartupInformation.hh
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/* StartupInformation.hh
|
||||||
|
* vim: set tw=80:
|
||||||
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Declaration of the StartupInformation struct.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STARTUPINFORMATION_HH__
|
||||||
|
#define __STARTUPINFORMATION_HH__
|
||||||
|
|
||||||
|
#include "Multiboot.hh"
|
||||||
|
#include "kstd/Types.hh"
|
||||||
|
|
||||||
|
|
||||||
|
namespace kernel {
|
||||||
|
|
||||||
|
/** Collection of useful tidbits for setting up the system. */
|
||||||
|
struct StartupInformation
|
||||||
|
{
|
||||||
|
/** Starting address of the kernel. 4K aligned. */
|
||||||
|
u32 kernelStart;
|
||||||
|
/** Ending address (the first valid address *after* the last) of the kernel. 4K aligned. */
|
||||||
|
u32 kernelEnd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup Memory
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/** System page size in bytes. */
|
||||||
|
u32 pageSize;
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
/** Multiboot's magic value. This should be verified. */
|
||||||
|
u32 multibootMagic;
|
||||||
|
/** Pointer to the multiboot information struct. */
|
||||||
|
multiboot::Information* multibootInformation;
|
||||||
|
|
||||||
|
/** Size of the kernel image in bytes. */
|
||||||
|
u32 kernelSize() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace kernel */
|
||||||
|
|
||||||
|
#endif /* __STARTUPINFORMATION_HH__ */
|
Loading…
Add table
Add a link
Reference in a new issue