2ndboot-ng icon indicating copy to clipboard operation
2ndboot-ng copied to clipboard

Motorola Milestone second bootloader from running kernel without reboot

2ndboot-ng – this is a bootloader, which can boot custom boot image (including custom kernel + initrd) from any place/file.

It consists from:

  • small kernel module, for creating device for booting/controlling boot
  • small userspace program, which give for module boot image and flags
  • universal bootloader, which can uses many places for booting: boot image file from nand flash, boot image from SD card, USB booting, and network booting

!!! FIRST YOU NEED THIS !!!

OMAP3430 Reference Manual http://www.xvilka.org/files/SWPU117D_FinalEPDF_02_18_2010.pdf Linux Kernel Programming Book http://www.xvilka.org/files/ldd3_pdf.tar.bz2

For creating this program we need read thease resorses:

http://wiki.davincidsp.com/index.php/Secondary_Bootloaders_on_OMAP-L1x http://wiki.omap.com/index.php/Main_Page https://gforge.ti.com/gf/project/omapzoom/wiki/?pagename=FAQ-7%3A+Zoom-II+Android+NAND+booting http://elinux.org/Kernel_XIP_Instructions_For_OMAP http://lists.infradead.org/pipermail/barebox/2009-December/000162.html http://209.85.135.132/search?q=cache:etUMZlUjOZkJ:not.freedsoftware.org/lemote-misc/git-mirror/linux_loongson.git/arch/arm/plat-mxc/include/mach/mx31.h+L2CC_BASE_ADDR&cd=5&hl=ru&ct=clnk&gl=ru http://omappedia.org/wiki/Main_Page http://omappedia.org/wiki/Bootloader_Project http://elinux.org/OMAP_Power_Management http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:example_on-chip_sram http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:porting http://omappedia.org/wiki/Linux_OMAP_Kernel_Project http://omappedia.org/wiki/Linux_Getting_Started http://git.openinkpot.org/contrib/reloaded-2.6.git/tree/

-----------------------------------BUILDING 2NDBOOT-NG------------------------

This is small reaceipts how you can build 2ndboot-ng

  1. Download your device kernel, unpack this and create configs and headers:

make mapphone_defconfig make headers_install ARCH=arm INSTALL_HDR_PATH=~/build/kern_h/

We have Motorola Milestone - so processor chip is TI OMAP3430 - ARM Cortex a8 (armv7-a arch) (http://en.wikipedia.org/wiki/ARM_architecture). So you need use configs with -omap3430 suffix. Set enviroment variable for building options:

export _XXCFLAGS=" -march=armv7-a -mtune=cortex-a8 -mfpu=neon"

  1. Download crosstool-ng (http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool), Unpack, build (you need for: make,install,bash,cut,sed,grep,gcc,awk,bison,flex,automake,libtool,stat, wget,cvs,patch,tar,gzip,bzip2,lzma,readlink,ncurses, mpfr-dev, gmp-dev)

.configure make make install

  1. Create dir toolchain-android, cd to it and copy files: XVilka-crosstool-.config in .config XVilka-uClibc-.config in uClibc.config and then run:

ct-ng menuconfig

change anything, if you need, and save to .config then exec:

ct-ng build

  1. Done! We have toolchain in build/x-tools. All tools have this triplet: arm-android-linux-uclibsgnueabi-* just add them in PATH

export PATH=$HOME/build/x-tools/arm-android-linux-uclibcgnueabi/bin:$PATH export CROSS_COMPILE=arm-android-linux-uclibcgnueabi- export KERNEL_CROSS_COMPILE=arm-android-linux-uclibcgnueabi- export CFLAGS=" -march=armv7-a -mtune=cortex-a8 -mfpu=neon"

So we can run:

arm-android-linux-uclibcgnueabi-gcc

Also we have system root directory in: $HOME/build/x-tools/arm-android-linux-uclibcgnueabi/arm-android-linux-uclibcgnueabi/sys-root For some reasons we just copy it in $HOME/build/cross/sys-root chmod +w sys-root chmod +w sys-root/usr chmod +w sys-root/usr/lib

  1. Build kernel

make mapphone_defconfig make

  1. Building module

In directory hbootmod run:

make -C $HOME/build/kernel M=pwd modules

or simply "make"

You can clean directory by command:

make -C $HOME/build/kernel M=pwd clean

or simply "make clean"