diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-18 00:38:11 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-18 00:38:11 +0100 |
commit | c1f2750e38fdb2dd5913292a892b2fc92e23f4c0 (patch) | |
tree | a7bcb49af3851e22e05d9f52486c7f948d482a3a | |
parent | 69988f94dd97f481a87831400cdebf746ce6d1ed (diff) | |
download | rpi-MMU-example-c1f2750e38fdb2dd5913292a892b2fc92e23f4c0.tar.gz rpi-MMU-example-c1f2750e38fdb2dd5913292a892b2fc92e23f4c0.zip |
finish explaining ramfs
-rw-r--r-- | Ramfs-explained.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Ramfs-explained.txt b/Ramfs-explained.txt index c778d9d..da70cb5 100644 --- a/Ramfs-explained.txt +++ b/Ramfs-explained.txt @@ -13,5 +13,7 @@ Each block start with a C (null-terminated) string with the name of the file it As obvious from the specification, files bigger than 4GB are not supported, which is not a problem in the case of this project. -Implementation -... +Implementations +Creation of ramfs is done by the makefs program (src/host/makefs.c). The program accepts file names as command line arguments, creates a ramfs containing all those files and writes it to stdout. As makefs is a very simple tool (just as our ramfs is a simple format), it puts files in ramfs under the names it got on the command line. No stripping or normalizing of path is performed. In case of errors (i.e. io errors) makefs prints information to stderr and exits. +Parsing/Reading of ramfs is done by a kernel driver (src/arm/PL1/kernel/ramfs.c). The driver allows for finding a file in ramfs by name. File size and pointers to file name string and file contents are returned through a structure from function find_file. +As ramfs is embedded in kernel image, it is easily accessible to kernel code. The alignment of ramfs to a multiple of 4 is assured in kernel's linker script (src/arm/PL1/kernel/kernel_stage2.ld). |