yashsingh1/xdaforums huggingface dataset:
[Acer Iconia A500] yaworski:
@Skrilax_CZ: you're doing really great work with bootloader :). One could wonder what would you be able to do if you had access to its sources :).

BTW I also have HTC Desire (s-offed with AlphaRev bootloader) and I can now flash bootloader with fastboot (fastboot flash hboot bl.img). Wouldn't it be also possible with this bootloader or is it missing this functionality all together?
[Acer Iconia A500] Skrilax_CZ:
Yes, in the .blob format (flash it to cache (CAC) partition with the cmd and reboot right away). Not actually a difficult thing to do.

EDIT: you can actually do it: "fastboot flash cache bootloader.blob", then "fastboot reboot" right away.
[Acer Iconia A500] Timelord83:
Love The Custom boot logo how can we make it bigger ;) right now i have little text. is there file size limitation? or what i'm very interested.
[Acer Iconia A500] Skrilax_CZ:
Right now it's limited to this size, there will be more space after removing other images and relocating the variables between them (but not very much more).
[Acer Iconia A500] dibb_nz:
thanks

its ok you answered what i needed thanks for that :)and to really say thanks:

Confirmation number: 3RS151308W729851W
[Acer Iconia A500] civato:
Modded the image and flash the bootloader.blob with cwm , working nice and easy.

Thanks !!

Here is the beer Confirmation number: 4VN45973V4114132L
[Acer Iconia A500] Skrilax_CZ:
I've fixed the bootlogo application, some issues when opening .blob bootloader file. DL / changelog link in OP
[Acer Iconia A500] Moscow Desire:
Maybe you can clear this up for us. I might be a little confused about flashing an *.blob through CWM.

I understand it, as I can flash a ver4 blob through recent version of CWM. Of course I am already running ver4 bootloader, so not a real reason to do that unless I want to change boot graphics. (:D).

My thought, was that the ver4 blob can be included in a rom install, and install the ver4 blob no matter what current bootloader a user has. Example, from HC 3.0.1 to version4.

Am I wrong in thinking this?
[Acer Iconia A500] Skrilax_CZ:
I will inculde basic multiboot support in next version soon (i.e at least just the booting itself between LNX (/dev/block/mmcblk0p2) and AKB (/dev/block/mmcblk0p7) partitions (it already works :D) and a binary with source to toggle), so people can run android and linux more comfortably without losing recovery. However I've also changed the bootloader version to 0.03.14-MUL to reflect that, so it can be recognised by the scripts. I'm saying this in forward so devs can update the detection scripts for unlocked / multiboot bootloader accordingly.

Well, yes, because stock bootloader.blobs have signature check on the *.blob update method, and it was removed in V4 (nothing will happen on the stock BLs though, it will say invalid blob image). It's however an option for futher BL updates.

This is alternative way of flashing (and I'll add a new one "fastboot flash bootloader bootloader.blob" in next version :p ).
[Acer Iconia A500] micky387:
You make hard work,thanks

Envoyé depuis mon A500 avec Tapatalk
[Acer Iconia A500] Moscow Desire:
OK, so the blob flash through CWM is only for future bootloader updates.

Thanks for clearing this up. Looks like it's still NVFlash time for the older bootloader users.
[Acer Iconia A500] Skrilax_CZ:
I've decided to post an experimental release of V5, please don't put it into guides until I update OP, thanks.

V5 changelog is as follows:

- as said before, version passed to cmdline is 0.03.14-MUL

- added command "fastboot flash bootloader bootloader.blob" for flashing blobs via fastboot (well, this is primarily comfort for myself :p ), the A500 will reboot, update the bootloader (in case of correct image) then reboot to fastboot again, passing incorrect blob will require running "fastboot erase cache"

- multiboot between LNX and AKB, so you can run android and native linux without having to lose recovery

How does multiboot work:

Multiboot is toggled, you don't hold any keys etc. when booting the tablet. On booting, bootloader writes which partition it boots from. There are two ways how to toggle booting partition:

A) using binary in attachment (precompiled and with source), running in cmd:

"setbootmode b1" for primary image (LNX, /dev/block/mmcblk0p2, size 8 MB)

"setbootmode b2" for secondary image (AKB, /dev/block/mmcblk0p7, size 10 MB)

B) using fastboot

"fastboot oem setboot b1" - primary

"fastboot oem setboot b2" - secondary

To flash the secondary kernel image, either use dd to /dev/block/mmcblk0p7 or you can use fastboot with "secboot" as partition:

"fastboot flash secboot boot.img" <- flashing

"fastboot erase secboot" <- erasing

Because AKB was initally used for checksums by HC bootloader, running itsmagic will corrupt the image in there. Running multiboot will not break any ROMs and you don't have to repartition, 10 MB more than enough for kernel image.

In attachment there is *.bin and *.blob file for A500 / A501 and setboot mode source + binary (both static and normal). From tech. point of view, I think the source is pretty self explanatory. While I did not find any probs so far, it would be good if you more skilled guys give it a shot too and see if you got some issues (in worst case recover with nvflash). Also the logo change tool is hardcoded for V4, so it won't work until I fix that :p
[Acer Iconia A500] yaworski:
@Skrilax_CZ: you are a hardcore :). With your current knowledge on how the bootloader works maybe you could help with porting u-boot? Or maybe it would be possible to use u-boot as a secondary bootloader (started from your unlocked bootloader istead of LNX or AKB) to allow dual/multi boot on-screen system selection. AKB could then hold u-boot image. Kernel images for other systems could be placed on internal sd partition as files (u-boot probably should be able to load kernel this way if the partition is mountable).
[Acer Iconia A500] Skrilax_CZ:
sp3dev started porting uboot to a500, right now it's in stage that it boots native linux uImage from eMMC partition. You can check his github here: https://github.com/astarasikov/uboot-tegra . I think that the only way to make the u-boot to work properly is to replace the Acer BL.

Some parts have to be REed from the A500 BL:

- key handling for booting recovery / fastboot

- the generetion of cmdline parameters

- wifi only check (A500 vs A501)

- there will most probably be some 3G initialization on A501

- processing bootloader blobs (toggling the APX interface)

I'll give a hand in these but will need some time. However I think that boot menu doesn't have a real advantage over the practically same thing in recovery.
[Acer Iconia A500] Skrilax_CZ:
Allright, I've noticed just a signle issue and that is that when using nvflash your AKB gets filled with checksums and the boot image there corrupted.

So in attachment there is updated bootloader_apx.bin used for connecting to apx, don't use on HC boot, only for ICS.
[Acer Iconia A500] taylor.fowler:
You guys may want to check out some of the cool stuff they've done with uboot on the Nook color and Tablet.... http://xdaforums.com/showthread.php?t=1526119 ... could be applicable.
[Acer Iconia A500] giacominos:
hard reset issue

I tried v4 bootloader but I'm unable to hard reset with v-/power on and lock switch as I many times do it with the old bootloader, and I need to format internal sd card is there another way with this bootloader ?
[Acer Iconia A500] Skrilax_CZ:
This way is not supported by the patched bootloader, you have to use fastboot: "fastboot erase userdata"
[Acer Iconia A500] giacominos:
Done . Thank you :)

I don't know if this can help someone .. but now that I erased internal storage I'm no more able to use 1.7.2 recovery I had to put 1.7
[Acer Iconia A500] civato:
So I go the V5 installed (used cwm flash) and now I can install secondary kernel(boot.img) where I can boot from , correct ? So I can toggle between ICS stock kernel and a tweaked one I build .
[Acer Iconia A500] Moscow Desire:
I don't know Mate. I was thinking it was more to do with running a linux installation on a separate partition.
[Acer Iconia A500] Skrilax_CZ:
Yes, use "fastboot flash secboot boot.img".

Well, it's the primary intention to have Android + Linux, but the kernel image can be normal Android too.
[Acer Iconia A500] Moscow Desire:
The best of both worlds :D
[Acer Iconia A500] apapousek:
For recovery, you should probably point to a gpl compliant recovery. Thor's work, while appreciated by many, is unfortunately warez.
[Acer Iconia A500] civato:
It's not as it runs on the stock Acer ICS kernel. So you need to ask Acer for source.

It's Thor cwm repacked on ICS stock kernel.

Not all the work of Thor is warez , google play store allows a app to install the Thor recovery ? Warez ?, the decrypter from Thor is still available here on xda , etc .....

Some side info:

I even used it in my guide for installing this Unlocked bootloader and custom recovery , the guide made front page news on xda so I would think if it wasn't OK , XDA admins would have told me.

So please don't turn this great thread into a Thor discussion.
[Acer Iconia A500] Skrilax_CZ:
Ah yeah, despite what the CWM says, the kernel is Acer stock.

OP updated with V5, changelog same as the prerelease (there was some polishing since then). Don't forget that bootloader_apx.bin was updated too (included with the V5 files).
[Acer Iconia A500] apapousek:
The version in the market is from before it went without sources.
[Acer Iconia A500] civato:
1.7 -ics is also in the market.

So again, don't turn it to Thor discussion.

I suggest if you have problems with it turn to xda admins ask them the question.
[Acer Iconia A500] blackthund3r:
This dual boot functionality looks very nice! Will be great for Linux. I have to say, the fact I'd have no recovery was the major off-put for me but this is fantastic! Nice work Skrilax!
[Acer Iconia A500] maris__:
Flashed V5 with blackthund3r's apx tool - without any issues. You guys are just great!

Best regards, maris
[Acer Iconia A500] Skrilax_CZ:
Well anyway, I haven't yet seen ezterry's open source version, but when (or if already) it is fully working and well tested, I'd pick that one. We'll have to do some patching for proper dualboot support (integrate setbootmode and add AKB partition to nandroid).
[Acer Iconia A500] micky387:
Flashed v5 with update cwm.zip .

Perfectly,no problem.

Thanks

Envoyé depuis mon A500 avec Tapatalk
[Acer Iconia A500] dxjak:
Likewise like taking candy from a baby......
[Acer Iconia A500] civato:
I tested ezterry open public cwm and works just fine, its just barebone cwm , no touch but it does what it needs to do. Clean and simple.
[Acer Iconia A500] Skrilax_CZ:
Well, I've changed my mind about this :p

But, it can be part of the stock BL too while built from source, setup a git in here: https://github.com/SkrilaxCZ/a500_bootmenu

Using make will compile it and merge with bootloader binary (bootloader_v6.bin), I've mapped some functions.

Ok, I'll update OP.
[Acer Iconia A500] civato:
Oh no a other update :D coming , you keep me busy.
[Acer Iconia A500] Skrilax_CZ:
It's just hello world in there now, so if other ppl are interested, they can play with it too :p

Oh just a note - the BL in repo won't boot in this "hello world" state of course - you'll have to flash back working bootloader with nvflash.
[Acer Iconia A500] yaworski:
How does this work? Is it like a wrapper around BL binary adding own functionality? Will this allow us to work around boot logo image size by displaying image from wrapper instead of letting BL do it itself? Just thinking out loud :).
[Acer Iconia A500] blackthund3r:
I was thinking more a touch screen boot menu that can launch imgs directly from a folder in /data (ie multiple recoveries and Linux kernels) as well as a quick recovery, kernel and bootloader updater (ie if it finds /data/media/bootloader/update.bin it'll flash it to EBT, rename it then reboot) or a button that let's the user quickly fix their kernel or CWM if they've screwed it up.

How about a skinnable UI? ;D once the main hardware is set up by Acer's BL we can have fun :P
[Acer Iconia A500] yaworski:
@blackthund3r: all this would be nice but I don't think this is doable because BL probably doesn't have filesystem support (or does it? @Skrilax_CZ). The same is with touchscreen support (in recovery and in Android touchscreen support is achieved through Linux kernel). To have touchscreen support in BL it would have to directly talk to the hardware and this probably would require to write lot of code in boot menu app.
[Acer Iconia A500] blackthund3r:
Yup I'm aware that it probably won't work but it's my dream for the bootloader hahaha

I reckon if it was a kernel that offered this support (and the kernel replaced recovery) the functionality could work. The BL definitely has access (obviously) to the flash to load a kernel image. I wouldn't think it has direct FS access though. That said, the BL is able to format partitions and has access to the framebuffer so much of the functionality could work. I'd like to play with the code actually when I get some time and see what I can make the BL so but I reckon it's pretty powerful.

EDIT: I say replace SOS because the BL kernel would provide the functionality to launch any recovery. That said, I believe much of the code is in the bootloader anyway (ie fastboot).
[Acer Iconia A500] Skrilax_CZ:
Right now this is in state:

BL initializes everything (well from "interesting point of view" say which key was pressed at boot, or what is in MSC partition, and sets which partition to boot from). Then it calls the "main" function from the bootmenu and gives control to it.

In there, you can do your stuff and modify the state (show menu, override CMD from MSC or override key state (such as forcibly set boot to recovery, whatever)).

Then either you can pass control back to bootloader (and either tell it to continue booting or reboot).

But, think of it this way: basically at some point (and it can be literally anywhere) the BL will call the "main" function, it's not wrapped from this way. In bl_0_03_14.h file are functions from the Acer stock BL (I've put there just some) that can be normally called, so this part is wrapped. And here, we can do anything we want, there is no "rule" that control has to be passed back to "stock" bootloader. So if we write (ehm, take from u-boot) a function to boot linux kernel from ext4 fs, we will be able to use it. So this can be a "sub-bootloader" or "second-stage bootloader" as well.

I've moreless reversed how bootlogo is called (pointer to the bootlogo structure + start offset in the function call). Only size will be a limit, but EBT can have up to 4 MB, so there is plenty of space behind the BL.

Well, it's not a good idea to keep recovery in FS, it should be completely separate. Simply if you press volume down, boot to recovery in SOS, if kernels are in FS, configuration file is also there which can be screwed (yeah in that case boot from SOS automatically etc.).

Anyway first I have to add there full framebuffer access for custom GUI (right now there are just basic functions mapped).
[Acer Iconia A500] blackthund3r:
Thanks for the info! I think a second stage bootloader is a great idea because of the sort of control (and frankly epicness) we'd have :P unlimited images etc and zero flashing once BL + stage 2 is installed assuming the imgs can be directly launched (or just have each one extracted into a folder so the folder is like the partition). There's plenty of scope here. Inbuilt image flasher like an on-device fastboot? UID/SBK calculator? Haha
[Acer Iconia A500] Skrilax_CZ:
Anyway, I've put to the git some basic bootmenu and fixed compilation / some functions offsets. Right now it has an option to continue booting, boot to recovery, fastboot mode, toggle primary / secondary kernel image (req's reboot to take effect) and wipe cache.
[Acer Iconia A500] gersma:
I don't know wether i should post this here or somewhere else but it seems that the bug with thors latest recovery (1.7.2) not loading apears only when a custom bootlogo is applied to the bootloader.

In other words : if bootloader v5 is installed as downloaded, thors recovery loads just fine, when a custom bootlogo is applied to V5, thors recovery fails to load. The same happens when using the V4 bootloader.
[Acer Iconia A500] civato:
Not here , I got custom bootloader logo and thor 1.7.2 recovery works fine.
[Acer Iconia A500] blackthund3r:
Hmm I've compiled it with arm-elf-gcc / arm-elf-ld (I ran export CROSS_COMPILE=arm-elf- and export PATH=$PATH:/cygdrive/c/Program\ Files/GNUARM/bin)

The compilation completes successfully albeit with a LOT of warnings.

I've now flashed it and it just freezes on "Skrilax_CZ's Bootloader V6 (0.03.14-MUL) and doesn't move. I tried holding buttons on startup but it won't even load the default kernel. Is my toolchain incompatible?
[Acer Iconia A500] gersma:
Can you post the exact method how you did it?

Thanks in advance.
[Acer Iconia A500] Skrilax_CZ:
Can you post one of the warnings? If it's about return type then it's ok (caused by binding with the BL functions, it should be in linker script, but I don't remember now how to specify thumb / arm mode in there for the functions). Also, the entry point is quite hacky now :o

I compiled fine with

make CROSS_COMPILE=/home/skrilax/arm/tools/arm-linux-gnueabi-4.4.7/bin/arm-linux-gnueabi- O=../obj

(I use obj / src directory structure). Output file is bootloader_v6.bin (not bootloader.bin, but that should not hang). Put mine compilation to attachment (today @ 13h, bootlogo application also updated).

Can you upload your: bootmenu.elf and bootmenu.bin files? I'll have a quick look on them. Also post "arm-elf-gcc -v".
[Acer Iconia A500] yaworski:
@Skrillax_CZ: is there a procedure/function to shutdown (not restart) tablet in BL? It would be nice to add some kind of timeout to menu (number of loops without keypress?) to either shutdown tablet or just continue with selection.

I know that this is an experimental code right now, but with this implementation it probably runs CPU at 100% (small loop checking for keypress that is) and without any timeout it will run battery flat when, for example, tablet for some reason restarts itself while user not using it.

I think that continuing should only work with default selection (like in lilo/grub). After pressing any key or if tablet can't boot properly (for example no proper AKB partition) bootloader should shutdown device after some time to prevent battery drain.
[Acer Iconia A500] Skrilax_CZ:
Ah, well currently the bootmenu isn't like grub, it shows only if you press VOLUME UP key (instead of directly jumping to fastboot), also I don't know how the CPU is clocked at bootloader time. I haven't pinpointed "delay" function in the Acer BL (branching on it halts).

Well, timer to power off the tablet on bad boot - that needs to be done in early code of linux kernel (setup some watchdog), which is disabled later. If the image format is OK, bootloader will give control to the kernel.
[Acer Iconia A500] yaworski:
Oh, I didn't catch that in your previous post. In that case user is somewhat protected from the situation I've described.
[Acer Iconia A500] civato:
Love the V6 but please give me some info on the following options (I'm a bootloader noob)

-Set debug Mode ON /OFF , what is the use of this ?

-Wipe cache , what is the use of this , when to use this ?

EDIT:

Here some beer to relax after this nice work:

Confirmation number: 4MA10703KL359433P.

---------- Post added at 10:37 PM ---------- Previous post was at 10:32 PM ----------

with nvflash (run the package) , even did it with cwm update , first the bootloader updated with cwm (only possible from V4 and up) and then flashed different recovery's , all of them work.
[Acer Iconia A500] Skrilax_CZ:
Set debug mode ON / OFF alters cmdline (serial console / no console). Wipe cache is when you flash bad bootloader.blob (invalid format), the bootloader will not do anything and try to boot normally, but it won't boot as it fails on mounting cache. While you can do this from recovery, I added it to the boot menu too, to make this more easy for people.
[Acer Iconia A500] civato:
Thanks all I needed to know ;)
[Acer Iconia A500] Skrilax_CZ:
Allright, I've added power key support to BL, so I released V6 with the bootmenu feature.
[Acer Iconia A500] ckarrow2:
A500 ICS V6 BL:

Zip: http://skrilax.droid-developers.org/...apx_ics_v6.zip

Above link is wrong (you need to add an "s" to bootloader in the filename :) )

Wonderful work on the bootloader!
[Acer Iconia A500] blackthund3r:
Thanks!! I'll take a look now. Here's the verbose output: http://pastebin.com/XhsnbjY0

The outputted files are attached.

Many thanks :)
[Acer Iconia A500] blackthund3r:
On a side note, the v6 bootmenu from your build is very very nice! Great work :)
[Acer Iconia A500] civato:
Is there a change to have a menu option to erase the second boot.img so fast boot is not needed?
[Acer Iconia A500] Moscow Desire:
Man, you wake up and yet another masterpeice :D:D:D
[Acer Iconia A500] Skrilax_CZ:
Hmm, bad linking. First use newer toolchain, for instance the 4.4.3 in android, although the newer the better (skip 4.5.x and in 4.6.x use at least 4.6.2), then I'm unsure if the reason is missing option in LDFLAGS for arm-elf (I used arm-linux-gnueabi). The "binding" functions with the BL are bad, don't know exactly why.

Thanks, OP fixed.

It is possible, but I don't see what this would be for (at the moment if the boot image format is bad the BL won't jump to the bootmenu).
[Acer Iconia A500] civato:
For easy cleaning that second partition if I have no pc around. But like I said I'm a big boot loader noob so always thinking to make it as easy as possible.

I fully understand if there is just no real reason to put your time into it then don't and enjoy the weekend.;)
[Acer Iconia A500] blackthund3r:
YouTube Video :D

Hope this helps somebody!

It shows my flash tool and using Skrilax's APX Bundle Repo. Should be n00b-proof. It's one hell of a Camtasia production :P

[YOUTUBE]IE48V5ZX1Ak[/YOUTUBE]

---------- Post added at 11:13 AM ---------- Previous post was at 11:09 AM ----------

Aha!! Just realised why. I was using GNUARM which I originally installed when playing with iPhone iBoot payloads. I found a proper compiler hiding in the android-ndk/toolchains directory - I knew that folder would be useful one day! I'll play with it later and later and let you know how it goes :)

---------- Post added at 11:17 AM ---------- Previous post was at 11:13 AM ----------

It could be done with an Android app. Or a basic script the does dd if=image.img of=/dev/block/mmcblk0p7. In fact it would probably be a useful addition to Acer Recovery Installer
[Acer Iconia A500] Skrilax_CZ:
Heh :)

Well, but I don't understand why you would want to clean it (this way). AKB partition on ICS BLs is unused. It should rather be added to recoveries nandroid.
[Acer Iconia A500] blackthund3r:
Mehhh clean it for fun just to say you formatted a secret partition on the tablet :P
[Acer Iconia A500] micky387:
hello.

i'm on V6 with Thor 1.7.2.

Can you explain to me how to flash the sec kernel and rom on secboot.

sorry,i don't undersand very well in the OP thread.

Big thanks for your hard work

Envoyé depuis mon A500 avec Tapatalk
[Acer Iconia A500] blackthund3r:
Hold volume up when booting

Use the volume buttons to select "fastboot"

Press power

Use fastboot flash secboot <kernelimage.img>

Reboot

Hold volume + when booting up agaim

Select the option to use the second kernel

Reboot

To use the main kernel again enter the boot menu with volume + and choose to set the boot to the primary kernel :)
[Acer Iconia A500] Skrilax_CZ:
:D

Right now either with dd:

dd if=secboot.img of=/dev/block/mmcblk0p7

or with fastboot

fastboot flash secboot secboot.img

But if you mean to have two ROMs (i.e not just two kernels) then the secondary ROM has to be fully made as secondary. And it requires repartitioning.
[Acer Iconia A500] Savok:
OK, so I have bootloader v6 up and running now and have no idea what to use the 2nd loader for. What is everyone else using it for?