aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2020-01-17 18:59:45 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2020-01-17 18:59:45 +0100
commit69988f94dd97f481a87831400cdebf746ce6d1ed (patch)
treec9379d03d0bb68481f3f323f3dfd53e4475547bf
parentd08f2e452ef83abf9ec49a40d376a9d681070838 (diff)
downloadrpi-MMU-example-69988f94dd97f481a87831400cdebf746ce6d1ed.tar.gz
rpi-MMU-example-69988f94dd97f481a87831400cdebf746ce6d1ed.zip
start explaining ramfs
-rw-r--r--Ramfs-explained.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Ramfs-explained.txt b/Ramfs-explained.txt
new file mode 100644
index 0000000..c778d9d
--- /dev/null
+++ b/Ramfs-explained.txt
@@ -0,0 +1,17 @@
+A simple ram file system has been introduced to avoid having to embed too many files in the kernel in the future.
+
+The ram filesystem is created on the development machine and then embedded into the kernel. Kernel can then parse the ramfs and access files, that have been put in it.
+
+Ramfs contains a mapping from file's name to it's size and contents. Directories, file permissions, etc. as well as writing to filesystem are not supported.
+
+Currently this is used to access the code of PL0 test program by the kernel, which it then copies to the appropriate memory location. In case more user mode programs are later written, they can all be added to ramfs to enable the kernel to access them easily.
+
+Specification
+When ramfs is accessed in memory, it MUST be aligned to a multiple of 4.
+The filesystem itself consists of blocks of data, each containing one file. Blocks of data in the ramfs come one after another, with the requirement, that each block starts at a 4-aligned offset/address. If a block doesn't end at a 4-aligned address, there shall be up to 3 null-bytes of padding after it, so that the next block is properly aligned.
+Each block start with a C (null-terminated) string with the name of the file it contains. At the first 4-aligned offset after the string, file size is stored on 4 bytes in little endian. Null-bytes are used for padding between file name and file size if necessary. Immediately after the file size reside file contents, that take exactly the amount of bytes specified in file size.
+
+As obvious from the specification, files bigger than 4GB are not supported, which is not a problem in the case of this project.
+
+Implementation
+...