[Question]Convert/Link binary to vmlinux/bZimage image
Posted: Fri Nov 23, 2018 2:36 pm
I’m trying to write a chain-loader for clover2 that will start it on an x86 device that only has an android boot-loader available.
The boot image contains an file called zImage, and also an second.bin file that seems to extract the zImage.Passing it through the file command its revealed that its an generic pc(bios) x86 kernel in bzImage format.
As i understand the boot process it s something like this.
1.IPL initializes hw and loads SPL.
2.SPL loads aboot.
3.aboot loads boot.img into ram.
4.aboot sets sp to second.bin
5.second.bin extracts bzImage of kernel
6.second.bin jumps to kernel entry point.
7.Android starts.
Ive already replaced the second.bin file with my own binary written in asm to try to write to the screen at address 0:0xb8000.
The device just does nothing for 10 seconds and then loads the recovery menu.
Does someone know how to link a generic c programm into an vmlinux/bzImage file so i could try to get more information from this state?
Thanks a lot in advance.
The boot image contains an file called zImage, and also an second.bin file that seems to extract the zImage.Passing it through the file command its revealed that its an generic pc(bios) x86 kernel in bzImage format.
Code: Select all
zImage: Linux kernel x86 boot executable bzImage, version 3.10.72BORETS-x86_64_moor (borets@borets) #8 SMP PREEMPT Thu Ja, RO-rootFS, swap_dev 0x8, Normal VGA
1.IPL initializes hw and loads SPL.
2.SPL loads aboot.
3.aboot loads boot.img into ram.
4.aboot sets sp to second.bin
5.second.bin extracts bzImage of kernel
6.second.bin jumps to kernel entry point.
7.Android starts.
Ive already replaced the second.bin file with my own binary written in asm to try to write to the screen at address 0:0xb8000.
The device just does nothing for 10 seconds and then loads the recovery menu.
Does someone know how to link a generic c programm into an vmlinux/bzImage file so i could try to get more information from this state?
Thanks a lot in advance.