Re: during fedora boot, what picks up the initrd.img from /boot?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Nov 2007, Mikkel L. Ellertson wrote:

> I don't believe the kernel is ever told the location of the file on
> the disk. The initrd option tells grub the file to load. Grub then
> loads the file into system memory. I am not sure, but I believe the
> address that Grub loaded it to in memory is passed in a register.
> But it may be in a fixed place in the block of data passed to the
> kernel, along with the options in the kernel line. I suspect that
> this is covered in the Grub info page if you want to know exactly
> how it is managed. I have never cared enough about the exact method
> to dig into it. It is also possible to boot a kernel without using
> an initrd file if you build all the drivers needed to access the
> root file system into the kernel.
>
> You may also want to take a look at the initrd.txt file in the
> kernel documentation tree.

i've learned the hard way not to trust the in-kernel documentation,
but i did eventually track down what i was after.

for interested parties, in the kernel source tree,
include/asm-x86/bootparam.h:

/* The so-called "zeropage" */
struct boot_params {
	...
	struct setup_header hdr;    /* setup header */
	...
}

and at the top of that very same file, we have:

struct setup_header {
	...
        __u32   ramdisk_image;
        __u32   ramdisk_size;
	...
}

in the 32-bit case, that info is extracted during system boot in
arch/x86/kernel/setup_32.c thusly:

#ifdef CONFIG_BLK_DEV_INITRD
        if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
                unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
                unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
                unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
                unsigned long end_of_lowmem = max_low_pfn << PAGE_SHIFT;
...

etc, etc.

  so i'm good.

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux