Hi Bjarke,
Briefly the call flow here:
The bootCommand() function in RecoverySystem.java calls the
pm.reboot() with the user passed argument as "recovery".
The pm.reboot() is implemented in PowerManager.java, where it calls
the mService.reboot() with the reason code as "recovery".
The mService.reboot() is implemented in PowerManagerService.java,
where it calls ShutdownThread.reboot(mContext, finalReason, false);
The PowerManagerService.java communicates with the recovery.c through
JNI, where the reboot() is called with reason code.
The __reboot system call
__reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
LINUX_REBOOT_CMD_RESTART2, "recovery");
is called in init.c
There are some methods which update/pass the commands to the
bootloader in firmware.c and bootloader.c
The __reboot sys call enters to the Kernel from sys.c, where the cmds
are passed to the Kernel and kernel_restart() function gets called.
kernel_restart_prepare(cmd); and machine_restart(cmd); are called
futher from here based on the linux reboot arguments.
Hope this helps and let us discuss/know if you have any furhter info.
-
On Mar 31, 4:14 pm, "Bjarke F." <[email protected]> wrote:
> Hi Robin
>
> The steps you outline seems like a solution that we can use. Thanks.
>
> One detail though, when I issue a "adb reboot recovery" or "adb reboot
> bootloader" I need to somehow write something that informs the
> bootloader to do the right thing. Do you know how to do this?
>
> On Mar 31, 10:43 am, Robin Gujjar <[email protected]> wrote:
>
>
>
> > Hi Bjarke,
>
> > Hmm .... i implemented it, what ever you are looking. foloow the below
> > Step :
>
> > =={ I am assuming your recovery image is already implemented and ready
> > to boot }===
> > Step : 1 : Open a simple file in android data or Cache partitions.
> > from Java file ex: RecoverySystem.java, in which very first call come
> > for recovery. and write any string in that File ex: "xyz" . Do this
> > stuff from java code.
>
> > Step 2: Now Go to Uboot main file and when there a read happen for
> > boot cmd, read the this file( i hope you can implement this by reading
> > your file system from uboot code :) Option one read the file , second
> > read the number of character in the file and then compare in uboot
> > code and if match with your defind set go ahead for boot recovery
> > image.). i hope you know , at this point , you will be changing your
> > boot cmd ---> ponting on recovery Image.
>
> > Step 3 : dis works , very few change is required for the above
> > solution. hope you will enjoy the above step : )
> > Step 4; --> think about the above opened file, what you can do for
> > next step.
>
> > -- Robin
>
> > On Mar 31, 11:43 am, "Bjarke F." <[email protected]> wrote:
>
> > > Hi.
>
> > > Thanks for the link. This describes pretty much what I already have
> > > discovered myself.
>
> > > What I am interested in in is the exact method used for passing on a
> > > command to the bootloader.
> > > Where in the kernel source is the functionality and where in the
> > > bootloader source is it picked up?
>
> > > I would really appreciate if anyone can enlighten me on this, I have
> > > spend quite a lot of time searching for this without much luck.
>
> > > /Bjarke- Hide quoted text -
>
> - Show quoted text -
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting