|
AquilaOS documentation
How it works, and its code
|
The RAM disk: the initial RAM disk the boot loader loaded, as block device 1, 0. More...
#include <core/system.h>#include <core/panic.h>#include <core/arch.h>#include <core/module.h>#include <core/string.h>#include <boot/boot.h>#include <dev/dev.h>#include <mm/vm.h>Go to the source code of this file.
Functions | |
| static ssize_t | rd_read (struct devid *dd, off_t offset, size_t size, void *buf) |
| Reads from the RAM disk: up to size bytes at offset, fewer at its end. | |
| static ssize_t | rd_write (struct devid *dd, off_t offset, size_t size, void *buf) |
| Writes to the RAM disk: up to size bytes at offset, fewer at its end. | |
| static int | rd_probe () |
| Maps the RAM disk the boot loader loaded, and registers it as block device 1. | |
| static size_t | rd_getbs (struct devid *dd) |
| Returns the RAM disk's block size: 1, it is read byte by byte. | |
Variables | |
| static void * | rd_addr = NULL |
| size_t | rd_size = 0 |
| struct dev | rddev |
The RAM disk: the initial RAM disk the boot loader loaded, as block device 1, 0.
The boot loader puts the RAM disk (the first module) in memory; this driver maps it, and reads and writes it with plain copies. The kernel then unpacks the archive it holds as the first root filesystem (see load_ramdisk()). Without a module, the root is on a disk, and there is no RAM disk.
Definition in file ramdisk.c.
Returns the RAM disk's block size: 1, it is read byte by byte.
Definition at line 88 of file ramdisk.c.
References rd_getbs().
Referenced by rd_getbs().
|
static |
Maps the RAM disk the boot loader loaded, and registers it as block device 1.
Without one (the root is on a disk), it does nothing.
Definition at line 65 of file ramdisk.c.
References __kboot, arch_phys_map(), kdev_blkdev_register(), boot::modules, boot::modules_count, module_t::paddr, panic, rd_addr, rd_probe(), rd_size, rddev, and module_t::size.
Referenced by rd_probe().
Writes to the RAM disk: up to size bytes at offset, fewer at its end.
Returns how many were written, 0 past the end.
Definition at line 47 of file ramdisk.c.
References memcpy(), MIN, rd_addr, rd_size, and rd_write().
Referenced by rd_write().
|
static |
Definition at line 22 of file ramdisk.c.
Referenced by rd_probe(), rd_read(), and rd_write().
| size_t rd_size = 0 |
Definition at line 25 of file ramdisk.c.
Referenced by load_ramdisk(), rd_probe(), rd_read(), and rd_write().
| struct dev rddev |
Definition at line 93 of file ramdisk.c.
Referenced by rd_probe().