Kernel cares where it should reside?
Hi there, Using Gentoo (and have to configure kernel). When I do the command - file - on kernel file I just built it says, among other things, root_dev 0x801. The working kernel says - root_dev 0x10. Where is this parameter determined and since when does the kernel care where it resides? -- Regards. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: Kernel cares where it should reside?
On Thu, Apr 02, 2009 at 12:32:53PM +0300, David Harel wrote: Hi there, Using Gentoo (and have to configure kernel). When I do the command - file - on kernel file I just built it says, among other things, root_dev 0x801. The working kernel says - root_dev 0x10. Where is this parameter determined Not sure exactly, somewhere in the build process. You can change it with 'rdev', but you do not need to: and since when does the kernel care where it resides? It's not 'since', but 'until when'. It was so since the very beginning. The kernel had a small boot loader in its start. You could 'cat zImage /dev/fd0' and get a bootable floppy. No standard boot loader (lilo, grub) care{s,ed} about this. IIRC today it does not work anymore, perhaps never worked with bzImage. The reason it cared is obvious - you had to tell it which FS to mount as root. And had no config file to write 'root=something'. -- Didi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: Kernel cares where it should reside?
David Harel harel...@gmail.com writes: Hi there, Using Gentoo (and have to configure kernel). When I do the command - file - on kernel file I just built it says, among other things, root_dev 0x801. The working kernel says - root_dev 0x10. Where is this parameter determined and since when does the kernel care where it resides? I don't think it is related to where the kernel resides, but to where the root filesystem resides - this is the rootfs device number - and the kernel does care, obviously. You can add this as a boot parameter with root=/dev/sda1 or sth of the kind. The root device may change (more than once) during boot. E.g., if you use initrd then the initrd root device may point to the ramdisk (/dev/ram0 or similar). Then at some point you'll want the regular root device to be engaged - the pivot_root syscall (for more info, see the pivot_root(2), pivot_root(8), rdev(8), initrd(4) man pages, the kernel Documentation, etc.) will change the root device as appropriate (/dev/sda1 or whatever). This may explain why your just-built kernel and the working kernel have different root_dev. I *think* there is a registry for device numbers in Documentation/devices.txt, if you want to find out what 0x801 or 0x10 are. Hope it helps, -- Oleg Goldshmidt | p...@goldshmidt.org ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il