Difference between revisions of "2ndboot"

From MILEDROPEDIA
Jump to: navigation, search
m (Updated 2ndboot page, because now it works well)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
=== Overview ===
 
=== Overview ===
  
This is bootloader, which can boot custom boot image even droid-family phone has locked bootloader.  
+
A minature bootloader that is called from the original kernel and boots custom one.  
  
 
It consist from:
 
It consist from:
 
* small kernel module, for creating device for booting/controlling boot
 
* small kernel module, for creating device for booting/controlling boot
 
* small userspace program, which give for module boot image and flags   
 
* small userspace program, which give for module boot image and flags   
* universal bootloader, which can uses many places for booting
+
* tiny bootloader making space for subsequent kernel boot (kexec like)
  
It's derived from collaborative work of '''yakk''' and '''dimichxp''' for creating bootloader for older motorola phones,
+
It's derived from collaborative work of '''yakk''' and '''dimichxp''' for creating bootloader for older Motorola phones (Freescale based),
before their RSA have been cracked.
+
before their RSA signature protection have been bypassed.
  
Now, this project ported to the Milestone hardware and can boot custom kernel fully, except of baseband part.
+
As of 11/10/2012, '''czechop''' created a patch to keep Wrigley 3G modem working under the child kernel (when called at “sh hijack” time). Now the only issue on Motorola Milestone is sluggishness for cca. 10 - 20 minutes after the boot until the kernel suspends, after which it operates normally.
  
Here you can find current development sources of 2ndboot: [http://bitbucket.org/droiddev/2ndboot/overview]
+
You will need UART debugging for development of hboot binary and kernel: [[Debugging]]
  
See published binaries: [http://www.droid-developers.org/files/2ndboot.rar|here (build number 1.03)] and [http://www.droid-developers.org/files/uploads/kern0231.rar|here (build number 2.31)].
+
=== Download ===
  
Here you can fin howto build 2ndboot from sources: [[Compiling]]
+
Current development for MS is on https://github.com/nadlabak/2ndboot
 +
Patched kernel for 2ndboot: https://github.com/nadlabak/kernel
  
Also it is necesseary for developing 2ndboot and custom bootloader/kernel to debug over serial port: [[Debugging]]
+
=== Compilation ===
 +
 
 +
# Download Froyo kernel sources from Moto (Build number 5.26.0 (2.6.32.9 kernel))
 +
# Install arm toolchain (you can use the one coming from Android)
 +
# Compile "hbootmod" as a module for 2.6.32.9 kernel
 +
# Compile "hboot" as a standalone binary
 +
# Compile "hbootuser" as a normal Android application
 +
 
 +
Keep in mind that all parts have to have the same configuration. You can find all info about compilation of kernel and toolchain [[Compiling | here]]
  
 
=== Progress ===
 
=== Progress ===
  
Latest attempt: '''Yakk''' patched 2nd-boot to make it work on the Milestone, but his source code remains partly unpublished at this time. Status: boots another kernel, which Yakk has also patched to get serial output over the USB connector (using custom hardware to connect to it). Currently the booted kernel has some problems with USB and fails to initialize the phone's modem so it crashes. See published code and binaries: [http://www.droid-developers.org/files/2ndboot.rar here (build number 1.03)] and [http://www.droid-developers.org/files/uploads/kern0231.rar here (build number 2.31)]. All current development of 2ndboot now going [http://hg.droid-developers.org/droiddev/2ndboot here] When GSM is disabled this kexec module is able to boot the system with the recompiled kernel, but it is not really useful as a phone then. WiFi works fine, though. Yakk is now trying to use 2ndboot to start a patched version of mbm, which should be able to initialize the modem and then pass control to a custom Linux kernel. This is still under development, so don't get too excited. We'll keep you posted.
+
==== Previos attempt ====
 +
'''Yakk''' patched 2nd-boot to make it work on the Milestone, but his source code remains partly unpublished at this time. Status: boots another kernel, which Yakk has also patched to get serial output over the USB connector (using custom hardware to connect to it). Currently the booted kernel has some problems with USB and fails to initialize the phone's modem so it crashes. All current development of 2ndboot now going [http://hg.droid-developers.org/droiddev/2ndboot here] When GSM is disabled this kexec module is able to boot the system with the recompiled kernel, but it is not really useful as a phone then. WiFi works fine, though. Yakk is now trying to use 2ndboot to start a patched version of mbm, which should be able to initialize the modem and then pass control to a custom Linux kernel. This is still under development, so don't get too excited. We'll keep you posted.
 +
 
 +
==== Current state ====
 +
 
 +
It works fine.
 +
 
 +
== Further testing ==
 +
 
 +
=== USB Monitoring ===
 +
 
 +
<pre>
 +
mount -t debugfs none_debugs /sys/kernel/debug
 +
cat /sys/kernel/debug/usbmon/1t
 +
</pre>

Latest revision as of 21:53, 19 October 2012

Overview

A minature bootloader that is called from the original kernel and boots custom one.

It consist from:

  • small kernel module, for creating device for booting/controlling boot
  • small userspace program, which give for module boot image and flags
  • tiny bootloader making space for subsequent kernel boot (kexec like)

It's derived from collaborative work of yakk and dimichxp for creating bootloader for older Motorola phones (Freescale based), before their RSA signature protection have been bypassed.

As of 11/10/2012, czechop created a patch to keep Wrigley 3G modem working under the child kernel (when called at “sh hijack” time). Now the only issue on Motorola Milestone is sluggishness for cca. 10 - 20 minutes after the boot until the kernel suspends, after which it operates normally.

You will need UART debugging for development of hboot binary and kernel: Debugging

Download

Current development for MS is on https://github.com/nadlabak/2ndboot Patched kernel for 2ndboot: https://github.com/nadlabak/kernel

Compilation

  1. Download Froyo kernel sources from Moto (Build number 5.26.0 (2.6.32.9 kernel))
  2. Install arm toolchain (you can use the one coming from Android)
  3. Compile "hbootmod" as a module for 2.6.32.9 kernel
  4. Compile "hboot" as a standalone binary
  5. Compile "hbootuser" as a normal Android application

Keep in mind that all parts have to have the same configuration. You can find all info about compilation of kernel and toolchain here

Progress

Previos attempt

Yakk patched 2nd-boot to make it work on the Milestone, but his source code remains partly unpublished at this time. Status: boots another kernel, which Yakk has also patched to get serial output over the USB connector (using custom hardware to connect to it). Currently the booted kernel has some problems with USB and fails to initialize the phone's modem so it crashes. All current development of 2ndboot now going here When GSM is disabled this kexec module is able to boot the system with the recompiled kernel, but it is not really useful as a phone then. WiFi works fine, though. Yakk is now trying to use 2ndboot to start a patched version of mbm, which should be able to initialize the modem and then pass control to a custom Linux kernel. This is still under development, so don't get too excited. We'll keep you posted.

Current state

It works fine.

Further testing

USB Monitoring

mount -t debugfs none_debugs /sys/kernel/debug
cat /sys/kernel/debug/usbmon/1t