Patching to QEMU-SYSTEM-ARM

31 views
Skip to first unread message

Krishna Pavan

unread,
Mar 29, 2012, 7:29:49 AM3/29/12
to xvisor...@googlegroups.com
Hi xVisor,

When these arguments are used >>>>  qemu-system-arm -kernel arm_test.bin.patched -M realview-pb-a8 -m 128.

I get all the text, hi, hello test code and lot, I mean, It's a kind of a boot loader program for realview-pb-a8.
It's been patched to QEMU.

Now, I want to use a kernel uImage/zImage with qemu and it does not work.

I guess that particular patching is responsible for all this!

wrt, PATCHING QEMU

1. Are there any specific instructions to be followed, when PATCHING is done? If So, please inform, where I can get them?

Because, Not all the images can be worked with on qemu, many fail with FATAL errors.

I guess, that some changes at the code level, before a bootloader/kernel image is built, we have to do some tweaks, so that they get  going is QEMU?
2. Is the above statement [ my guess] Correct?

Please Inform.

--
Regards :: Krishna Pavan

Anup Patel

unread,
Mar 29, 2012, 12:35:43 PM3/29/12
to xvisor...@googlegroups.com
Hi Krishna,

The ARM architecture is not virtualizable due to many problematic instruction. To solve the issue Xvisor hacks Linux & Bootloader binaries to replace the problematic instructions with special hypercall instructions which are guaranteed to fault.

The Xvisor ARM basic bootloader is arm_test.bin you can boot this without Xvisor on QEMU using:
qemu-system-arm -kernel arm_test.bin -M realview-pb-a8 -display none -serial stdio

The arm_test.bin.patched is hacked version of arm_test.bin so that we can boot arm_test.bin.patched on Xvisor as guest bootloader. This binary cannot be booted directly on QEMU.

Similar concept applies to Linux zImage. Once we patch or hack Linux zImage we can only boot it on Xvisor as guest.

Regards,
--Anup

Krishna Pavan

unread,
Mar 30, 2012, 8:26:53 AM3/30/12
to xvisor...@googlegroups.com
Hi Anup, xVisor,

Thanks for your reply.

Yeah, I remember you have told me earlier, that some "Sensitive Hypercall" Stuff has been included.


Xvisor hacks Linux & Bootloader binaries

Suppose, I wanted to use any other zImage/uImage, then what should I do.

I followed, these steps, to get an image to be loaded @70010000, because, info roms in qemu, gives me an information that boot loader is @70000000 and Kernel image @70010000, pre-defined.

/home/post4pavan/Downloads/ARM-ToolChains/arm-2011.09/bin/arm-none-linux-gnueabi-objcopy -O binary -R .note -R .comment -S vmlinux linux.bin

gzip -9 linux.bin

mkimage -A arm -O linux -T kernel -C none -a 0x70010000 -e 0x70010000 -n "Pavan_vmlinuz" -d linux.bin.gz zImage_Pavan


I run this
qemu-system-arm -kernel arm_test.bin -M realview-pb-a8 -display none -serial stdio


 but no result, with the image I have made.
 
Similar concept applies to Linux zImage. Once we patch or hack Linux zImage we can only boot it on Xvisor as guest.


I want to learn by doing, so, I am following these procedures.

Please Kindly Inform.



--
Regards :: Krishna Pavan

Anup Patel

unread,
Mar 30, 2012, 8:28:54 AM3/30/12
to xvisor...@googlegroups.com
Hi Krishna,

The scripts in Xvisor can only hack the ELF files. We cannot hack the BIN files.

You must have the vmlinux ELF file of the zImage that you want to hack.

--Anup
Reply all
Reply to author
Forward
0 new messages