Using the Block Device
For development and testing purposes it may be useful to use the underlying block front-end device driver in order to read data from, or write data to an external disk image file. This documentation provides clear instructions on how to configure Stardust to be compiled with support for a rudimentary file system that uses the block device.
Creating the disk image
The first step is to create an adequate disk image file that can be used by Stardust. Please follow these instructions:
Create a file which is occupied with zeros
This will create a disk image file, but you can change the configuration to alter the size as needed.
Create a partition
By executing the above command, a number of questions will be presented in your terminal and the following example shows how to typically answer these questions:
Create the file system disk image
Following the execution of the above command, the disk image file will be ready for use.
Populating the disk image with some data
If you would like to populate the disk image with some data, you can simply mount the disk image in a local directory, insert data into it and then demount it. In order to mount the disk image you need to execute the following steps for example:
Now you can create or copy files in the location where the disk image has been mounted.
Similarly you can demount the disk image using the following command:
Configuring and building Stardust
In order to configure Stardust's build system to compile the kernel with the front-end block device driver and support for a rudimentary file system you will need to:
Modify the kernel's configuration header file config.h by enabling the labels defined to support both the block front-end device driver and the file system
Clone the software packages repository which contains the source code of the file system library and set its path correctly in the Makefile of the operating system
Once these steps have been performed you can compile Stardust by executing make.
Please note that the file system library contains simple tests for reading files from or writing files to the file disk image.
Last updated