18#include <FreeNOS/User.h>
23 : m_image(image !=
ZERO ? image : load())
49 ERROR(
"invalid BootImage: signature = " <<
84 ERROR(
"failed to map BootImage using VMCtl: result = " << (
int) r);
SystemDescriptorHeader header
Result
Enumeration of generic kernel API result codes.
const BootImage bootImage() const
Get BootImage header.
virtual FileSystem::Result initialize()
Initialize the Storage device.
virtual FileSystem::Result read(const u64 offset, void *buffer, const Size size) const
Reads data from the boot image.
const BootImage * load() const
Loads the BootImage into virtual memory.
const BootImage * m_image
Pointer to the BootImage.
virtual u64 capacity() const
Retrieve maximum storage capacity.
BootImageStorage(const BootImage *image=ZERO)
Constructor function.
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
API::Result VMCtl(const ProcessID procID, const MemoryOperation op, Memory::Range *range=ZERO)
Prototype for user applications.
#define BOOTIMAGE_MAGIC0
First magic byte.
#define BOOTIMAGE_REVISION
Version of the boot image layout.
#define BOOTIMAGE_MAGIC1
Second magic byte.
#define ERROR(msg)
Output an error message.
unsigned int Size
Any sane size indicator cannot go negative.
unsigned long long u64
Unsigned 64-bit number.
unsigned char u8
Unsigned 8-bit number.
Result
Result code for filesystem Actions.
BootImage contains executable programs to be loaded at system bootup.
u32 magic[2]
Magic numbers to detect a valid boot image.
u8 layoutRevision
Version of the boot image layout.
u32 bootImageSize
Total size of the boot image in bytes.
Size size
Size in number of bytes.
Address phys
Physical address.
Address virt
Virtual address.
Access access
Page access flags.