Overview   API Reference  

raw_image Struct Reference

Class providing access to raw disk images, that is files storing all sectors as is. More...

#include <raw_image.hpp>

Inheritance diagram for raw_image:

Inheritance graph
[legend]
Collaboration diagram for raw_image:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 raw_image (const string &filename, const state_flags flags=0)
virtual l4_sector_t sectors (void) const
 Returns the number of disk sectors the underlying medium (e.g a file) provides.
virtual int read_sectors (uint8_t *buffer, l4_sector_t sector, l4_sector_t number)
 Reads (from disk) the specified number of sectors starting at the specified sector (inclusive) into the specified data buffer (which must be big enough).
virtual int write_sectors (uint8_t *buffer, l4_sector_t sector, l4_sector_t number)
 Writes (to disk) the specified number of sectors starting at the specified sector (inclusive) from the specified data buffer (which must be big enough).
virtual int flush_sectors (void)
 Flushes all currently pending operations.

Protected Attributes

const string driver_name
l4vmm_file file


Detailed Description

Class providing access to raw disk images, that is files storing all sectors as is.

Member Function Documentation

virtual int raw_image::read_sectors ( uint8_t *  buffer,
l4_sector_t  sector,
l4_sector_t  number 
) [inline, virtual]

Reads (from disk) the specified number of sectors starting at the specified sector (inclusive) into the specified data buffer (which must be big enough).

Returns 0 on success. Negative error codes otherwise.

Implements block_driver.

References block_driver_base::is(), and block_driver_constants::READY.

virtual int raw_image::write_sectors ( uint8_t *  buffer,
l4_sector_t  sector,
l4_sector_t  number 
) [inline, virtual]

Writes (to disk) the specified number of sectors starting at the specified sector (inclusive) from the specified data buffer (which must be big enough).

Returns 0 on success. Negative error codes otherwise.

Implements block_driver.

References block_driver_base::is(), and block_driver_constants::READY.

virtual int raw_image::flush_sectors ( void   )  [inline, virtual]

Flushes all currently pending operations.

That is requests to write to the backend, if the driver provides some mechanism to cache blocks. Returns 0 on success. Negative error codes otherwise.

Reimplemented from block_driver_base.


The documentation for this struct was generated from the following file:

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008