about the source of loader

Dan Nelson dnelson at allantgroup.com
Mon Feb 28 15:57:37 GMT 2005


In the last episode (Feb 28), ?? ?? said:
> I have some questions of source of loader
> 
> 1. Where is the source of the "ls" command?

/sys/boot/common/ls.c

> 2. How it mount the ufs boot partition as "/" when it start,Is it a
>    function or something else?.

The loader can't mount anything, since it isn't the kernel.  Since it
can read UFS filesystems, though, if it can find an /etc/fstab, it will
try and pass the path to the root volume to the kernel in the tunable
"vfs.root.mountfrom".  See /sys/boot/common/boot.c:getrootmount() and
/sys/kern/vfs_mount.c:vfs_mountroot() .

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list