Move StartupInformation struct to its own file

This commit is contained in:
Eryn Wells 2016-04-09 13:30:18 -04:00
parent 35997c61b6
commit ef15019757
4 changed files with 71 additions and 14 deletions

View file

@ -12,26 +12,13 @@
#include "Attributes.hh"
#include "Console.hh"
#include "Multiboot.hh"
#include "StartupInformation.hh"
#include "kstd/Types.hh"
#include "memory/Memory.hh"
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. */
struct Kernel
{

View file

@ -15,6 +15,7 @@ files = [
'Interrupts.cc',
'Kernel.cc',
'Multiboot.cc',
'StartupInformation.cc',
'PIC.cc',
'cxa.cc',
'isr.S',

24
src/StartupInformation.cc Normal file
View 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
View 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__ */