File:  [NetBSD Developer Wiki] / wikisrc / projects / project / kernel_setroot_tests.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Tue Mar 1 10:38:49 2022 UTC (8 months, 3 weeks ago) by martin
Branches: MAIN
CVS tags: HEAD
Adapt open gsoc project suggestion to new gsoc rules, mark as 175/350h

[[!template id=project

title="Test root device and root file system selection (350h)"


[Christoph Badura](



NetBSD has an extensive test suite that tests native kernel and userland

Mounting the root file system is one of the last steps the kernel does
during boot before starting the first process (init(8)).

Root file system selection is not covered by the current test suite.

How to find the root file system is specfied in the kernel configuration
file.  E.g.:

	config netbsd root on ? type ?  
	config netbsd root on sd0a type ?  

The first is a wildcard specification which causes the kernel to look for
the root file system on the device that the kernel was booted from.
The second form specifies the device and partition that contains the root
file system.  Other forms are also possible.

The selection process is a complex interaction between various global
variables that get initialized from the kernel configuration file and by
machine specific code that processes the information passed by the
bootloader about where the kernel was loaded from.

This selection process is performed mostly by a function named `setroot`
in the file `sys/kern/kern_subr.c`.

The project could be completed in a number of steps:

* Document the existing use cases and `config ...` syntax.
* Document the processing steps and functions called by `setroot`.
* Document how the various global variables interact.
* Write unit tests using rumpservers for the ATF framework for the
  documented use cases.

The project would initially be focussed on x86 (amd64 and i386).

[[!tag gsoc]]
[[!tag gsoc350h]]

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb