[PATCH openfirmware] ARM initramfs loading fixes

Daniel Drake dsd at laptop.org
Fri Sep 2 12:13:20 EDT 2011


Fix a stack underflow in linux-place-ramdisk which was eating 'adr'
in calculation.

Don't append a root=/dev/ram0 argument if using an initramfs. The
document suggesting this is outdated.
The kernel will boot from an initramfs if it is present regardless of
a root= parameter, and our initramfs expects no root= parameter to exist
(then it will try to autodetect which disk to boot from).

Change linux-base to 10.0000 to avoid trying to load the kernel and initramfs
in the same memory area.
(is this the right way to do this? I'm trying to hardcode the runtime fix of
 "10.0000 to linux-base")

Index: cpu/arm/linux.fth
===================================================================
--- cpu/arm/linux.fth	(revisiĆ³n: 2496)
+++ cpu/arm/linux.fth	(copia de trabajo)
@@ -31,17 +31,11 @@
    +                                 ( limit )
 ;
 
-: add-root-dev  ( cmdline$ -- cmdline$' )
-   /ramdisk  if                  ( cmdline$ )
-      "  root=/dev/ram0" $cat2   ( cmdline$' )
-   then                          ( cmdline$ )
-;
-
 \ see http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
 
 0 value arm-linux-machine-type  \ Set this after loading this file
 h# 100 value linux-params       \ The location recommended by the above article
-def-load-base value linux-base
+h# 10.0000 value linux-base     \ Different from ramdisk load location
 0 value rootdev#                \ Set externally
 
 0 value tag-adr
@@ -80,7 +74,6 @@
    then
 
    \ Command line
-   ( cmdline$ ) add-root-dev 
    ( cmdline$ )                  ( adr len )
    dup  if                       ( adr len )
       1+ 4 round-up              ( adr len+null_rounded )
@@ -121,7 +114,7 @@
 : linux-place-ramdisk  ( adr len -- )
    to /ramdisk                                    ( adr )
 
-   memory-limit  umin  /ramdisk -                 ( adr new-ramdisk-adr )
+   dup memory-limit  umin  /ramdisk -             ( adr new-ramdisk-adr )
    tuck /ramdisk move                             ( new-ramdisk-adr )
 \  dup to linux-memtop
    to ramdisk-adr



More information about the Devel mailing list