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