aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* tests: Only test initrd addresses on debugMiquel Sabaté Solà2024-11-251-4/+11
| | | | | | | | | | | | | | | | In initrd tests, and in general, we only need to check that the function did something. As in, that it set the entry addresses somewhere and did not leave them NULL. This is going to be performed from now on on CI and regular tests. And, just if you want to go the extra mile, we will run specific tests that check on memory addresses but that are not guaranteed to work. This is to be replaced in the future by having some proper debugging output. As in, having a message at kernel boot time specifying the addresses being used among other info. This needs a more complex printk utility, of course. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* test: Fix test on initrdMiquel Sabaté Solà2024-11-241-6/+9
| | | | | | | | | | | | This was broken since I first introduced the test on initrd on 40ffc517e20c ("Initial parsing of the provided initrd file") but it always was as a work in progress test. Now that the initrd parsing has separation of concerns with the global 'tasks' variable since f4986dab75fa ("Accept tasks as a parameter on initrd extraction"), we can have a proper test written for this. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Accept tasks as a parameter on initrd extractionMiquel Sabaté Solà2024-11-241-1/+1
| | | | | | This allows this functionality to be properly extracted for unit tests. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add basic parsing for underlying ELF executablesMiquel Sabaté Solà2024-11-221-1/+12
| | | | | | | | | | | | | The given initrd is a CPIO archive of multiple ELF executables. We are already able to parse the CPIO archive to detect where each file is located, this commit adds the mapping for each ELF executable to the corresponding task_struct. Note that this is still heavily under construction, since we cannot simply jump into the entry point of an executable as we have not yet setup the proper layout from performing context switches. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Initial parsing of the provided initrd fileMiquel Sabaté Solà2024-11-211-0/+28
| | | | | | | | | | | | We expect a CPIO archive with the 'newc' format for the initrd. Parse this archive from the given initrd address and fetch the address for each ELF executable while also pairing which task correspond to which ELF. This commit leaves to do the actual parsing of the ELF file for each task, while also leaving some string utilities to be refined. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Fetch the initrd address from the DTB blobMiquel Sabaté Solà2024-11-202-0/+29
The kernel entry has a pointer to the DTB blob as a parameter. From this pointer we can parse the the DTB blob to find the properties "chosen->linux,initrd-start" and "chosen->linux,initrd-start". These properties are guaranteed to have 64-bit addresses which point where the initrd is in memory, which we need to fetch the binaries to be loaded. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>