2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A /* All HdrS versions support these fields. */ 2N/A /* HdrS versions 0x0201 and higher only */ 2N/A /* HdrS versions 0x0202 and higher only */ 2N/A /* HdrS versions 0x0301 and higher only */ 2N/A /* Any pointer we dereference in the kernel image must be relocated 2N/A to where we actually loaded the kernel. */ 2N/A /* Set the command line arguments, unless the kernel has been 2N/A built with a fixed CONFIG_CMDLINE. */ 2N/A /* The kernel expects the physical address, adjusted relative 2N/A to the lowest address advertised in "/memory"'s available 2N/A The history of this is that back when the kernel only supported 2N/A specifying a 32-bit ramdisk address, this was the way to still 2N/A be able to specify the ramdisk physical address even if memory 2N/A started at some place above 4GB. 2N/A The magic 0x400000 is KERNBASE, I have no idea why SILO adds 2N/A that term into the address, but it does and thus we have to do 2N/A it too as this is what the kernel expects. */ 2N/A /* Boot the kernel. */ 2N/A asm volatile (
"sethi %hi(grub_ieee1275_entry_fn), %o1\n" 2N/A "ldx [%o1 + %lo(grub_ieee1275_entry_fn)], %o4\n" 2N/A "sethi %hi(grub_ieee1275_original_stack), %o1\n" 2N/A "ldx [%o1 + %lo(grub_ieee1275_original_stack)], %o6\n" 2N/A "sethi %hi(linux_addr), %o1\n" 2N/A "ldx [%o1 + %lo(linux_addr)], %o5\n" 2N/A "couldn't allocate physical memory");
2N/A "couldn't map physical memory");
2N/A grub_dprintf (
"loader",
"Loading Linux at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n",
2N/A /* Now load the segments into the area we claimed. */ 2N/A /* Adjust the program load address to linux_addr. */ 2N/A "this ELF file is not of the right type");
2N/A /* Release the previously used memory. */ 2N/A /* Create kernel command line. */ 2N/A "couldn't allocate physical memory");
2N/A "couldn't map physical memory");
2N/A grub_dprintf (
"loader",
"Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n",