I am a newbie student.
I am trying to run a Raspberry Pi Emulator on QEMU.
PC specs are Intel q8200, quad-core 2,4 GHz, Nvidia GeForce 1 GB. 4GB RAM
https://prnt.sc/uvpi0h
The above image is where you can see the commands and the state of the running QEMU. And other things.
https://prnt.sc/uvplco
This is in my download folder for this project.
I've tried to run different kernels (stretch and booster), even different Pi Emulator images, but the same mistake.
I've seen that in some solutions, a guy said that he hadn't included his BIOS in commands and that helped him, but I dunno how to include or specify BIOS in CMP.
All files inside the Qemu folder (images and kernel) are matching the start.bat commands folder, so that is all ok.
I've tried to do all of that through this channel instructions, but since it is outdated, I've just downloaded the latest software.
https://www.youtube.com/watch?v=xiQX0YXYuqU&t=138s&ab_channel=TechWizTime
What could be the solution and what is the problem?
Thanks in advance!
EDIT: Windows10 pro is the OS
UPDATE 1: Added this command: -boot no -display gtk,gl=of
still the same.
UPDATE 2:
qemu-system-arm -kernel kernel-qemu-4.4.12-jessie -cpu arm1176 -m 256 -M versatilepb \
-no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \
-redir tcp:5022::22 \
-hda 2016-05-27-raspbian-jessie-lite.img
I've used this to solve the problem. Although it is another version of the Raspberry Pi, for my needs it is not relevant now.
The important error message in the output is the one from the guest kernel which reads:
Error: unrecognized/unsupported machine ID (r1 = 0x00000183)
and then lists the machine types it is capable of booting on. (As a side note, providing error messages as screenshot images is rather awkward -- copying the text itself into the question makes it searchable and copyable.)
It looks like you're trying to boot a guest kernel which requires a device tree, but you haven't passed it a device tree. You need to give QEMU also a -dtb option whose argument is the correct dtb for this kernel and for the machine type ('versatilepb') that you are running it on.
Related
We have been facing issues with booting android 5.0 to GUI in our simulation environment.
We have been able to successfully boot it on QEMU with our kernel image and rootfs.
In our sw only environment there is an issue of rootfs not able to go higher than 400 MB so by removing some of the unneeded stuff we have brought it down to 400mb
In our environment we pack system.img , userdata.img and cache.img into one package and provide it as rootfs. kernel and ramdisk are provided as is.
We were able to boot kitkat on the above simulation environment.
I am going to attach log below. What we see is lot of binder transation failures after surface flinger is loaded. We can see android logo but no gui after that.
What we are suspecting is the following either issue with selinux(we have set se linux to permissive in kernel command line.) or issue with recognising userdata.img and cache.img by init.
Any pointers to the potential issue here would be really helpful. I am new to android booting mechanisms although i have surpassable knowledge of driver development.
Attaching a link to the logs: https://www.dropbox.com/scl/fi/im33ikwo6zvjobw70zl46/fsim_swonly.log?dl=0&oref=e&r=AAUTkq0XmQwwdsnOGAUqodCFdVHzt-2ejEstlhF40PWkNA4tjglBxO-WCtWxdRJK4GjXXemYenvq9_m9BtkEPLsDDvtw1r7qjRGDTlor5NU0EvLorixw6NgytVfYJa7FfBBpXU574_QnbbNRdjhFcM9NZRcYO0fCYmbuPllHKBbrzS8yFJWoKk3A_2D27BSXpco&sm=1
I want to test TrustZone feature in mainline QEMU and let QEMU run android image. The TrustZone feature is not in qemu-ranchu which is emulator of android built on top of old version qemu. Qemu-ranchu does not include TrustZone feature. So I have to use plain qemu to run trustzone feature on android.
I already compiled the AOSP with arm64 option and I have following image file: ramdisk.img, system.img, cache.img, userdata.img. I want to use qemu-system-aarch64 run these AOSP images.
Could anyone provide some guide line what command should I use to let qemu run these android images? Thanks in advance.
Although I don't know what "TrustZone" is, I think you are confused - "ranchu" is a hardware definition that the new Emulator can use, and it, in turn is based on a much newer Qemu code base.
In any case, you can see exactly what options are being used to run qemu by the Android Emulator (which "wraps" qemu) by starting it from the command line with the -verbose flag, for example:
~/.android-sdk/tools/emulator -avd Nexus_10_API_19 -verbose
I've had some luck running qemu directly by copying those options, and by experimenting with the values that are printed out by the Emulator "wrapper" code.
BTW, you will first need to use Studio's "AVD Manager" to make an avd to use in that command. More information about the command line use of the Emulator can be found here:
Android Emulator Command Line
Good luck!
I downloaded a third-party ROM, and I want to run it on the emulator first before flash it into the phone. Here is the contents of cm-11-20140911-NIGHTLY-p3110.zip:
1. boot.img
2. file_contexts
3. META-INF/
4. recovery/
5. system/
I unpacked boot.img using the script unpack-bootimg.pl and get boot.img-kernel, and boot.img-ramdisk.cpio.gz. Then I repacked the system using the make_ext4fs and got system.img.
I created an AVD and execute:
emulator -system ~/cm11/system_new.img -ramdisk ~/cm11/boot.img-ramdisk.cpio.gz -kernel ~/cm11/boot.img-kernel -avd and442
but all I got is nothing, the emulator screen is just black. There is no log message from adb -s emulator-5554.
Now I am confused:
can the third-party ROM be tested by the emulator?
Am I doing the right way?
Yeah, why not.
We can flash a third-party ROM on Android AVD. But first you must know the following things:
1. The Android Emulator is itself a device, like your Moto G or Xperia
2. Every ROM is device-specific (supports a device-specific Kernel)
(on many sites/blogs you got information like you have to replace system.img file from .android\avd\avdname.avd, but it is technically incorrect, because you also require ramdisk.img.)
To do this, you need to create your own AOSP repository by downloading the particular repository and have to build your own .img files)
You can do it in two ways:
replace files system.img and ramdisk.img from location .android\avd\avdname.avd
Build your own AOSP. Before... make in "lunch" select target as: Emulator (like: genericX86), i.e., generate all emulator specific .img files
I have tried many things. It's a bit critical, but interesting. The following links may help you:
To run your cooked ROM on Emulator (link down. Try this, from archive.org).
To Create AOSP Project
I'm using Fedora 19 64 bit (GNOME 3) for Android development.
locate libGL gives me:
/home/ericnguyen/adt/sdk/tools/lib/libGLES_CM_translator.so
/home/ericnguyen/adt/sdk/tools/lib/libGLES_V2_translator.so
/usr/lib/libGL.so.1
/usr/lib/libGL.so.1.2.0
/usr/lib64/libGL.so.1
/usr/lib64/libGL.so.1.2.0
/usr/lib64/libGLU.so.1
/usr/lib64/libGLU.so.1.3.1
/usr/share/doc/mesa-libGL-9.2
/usr/share/doc/mesa-libGL-9.2/COPYING
Right now I'm not able to start the emulator using my computer's GPU
Failed to load libGL.so
error libGL.so: cannot open shared object file: No such file or directory
So, I'm trying to find the appropriate libGL.so file to do as this.
Also, when I:
yum install mesa-libGL.x86_64
I got:
Package mesa-libGL-9.2-0.14.20130723.fc19.x86_64 already installed and latest version
Nothing to do
Notes:
I'm able to run the emulator without the GPU just fine.
My graphics card is AMD ATI Radeon HD 5000 series. I don't think I have installed any driver for it yet. I did yum search radeon and found xorg-x11-drv-ati.x86_64 but I'm not sure whether that's the correct driver - I have found people running into startup problem trying to install graphic card drivers (my own experience with Windows) so I'm a little uncertain right now.
I am also aware that one will need to install proprietary software from AMD/ ATI to to be able to use the graphics card.
The emulator is a 32-bit app. You need to install the equivalent 32-bit libraries. From the Fedora wiki HOWTO Setup Android Development the recommended libraries are:
glibc.i686 glibc-devel.i686
libstdc++.i686 zlib-devel.i686
ncurses-devel.i686 libX11-devel.i686
libXrender.i686 libXrandr.i686
If you can run the emulator without GPU support I will assume you have all of those.
For mesa-libGL your yum command is attempting to install the 64-bit version of the library, so try this instead:
yum install mesa-libGL.i686
EDIT (after Question update):
Yes install the The xorg-x11-drv-ati driver if it isn't already. This is the opensource driver and if it doesn't work you should just drop back to whatever you are running now.
I have an Nvidia card, but have had this running with my previous ATI card. I assume something has changed with the emulator since I set mine up a while ago as it seems to be running with the 64bit libraries:
$ pldd 9989
...
...
./lib/lib64OpenglRender.so
/opt/android-sdk-linux/tools/./lib/../lib/lib64EGL_translator.so
/usr/lib64/nvidia-304xx/libGL.so.1
/usr/lib64/nvidia-304xx/tls/libnvidia-tls.so.304.88
/usr/lib64/nvidia-304xx/libnvidia-glcore.so.304.88
/opt/android-sdk-linux/tools/./lib/../lib/lib64GLES_CM_translator.so
/opt/android-sdk-linux/tools/./lib/../lib/lib64GLES_V2_translator.so
/lib64/libGL.so
/lib64/libglapi.so.0
/lib64/libXdamage.so.1
/lib64/libX11-xcb.so.1
/lib64/libxcb-glx.so.0
/lib64/libxcb-dri2.so.0
...
...
..
....
(9989 being the process id of the running emulator.)
So installing the drivers you have already mentioned should be enough.
You can test if the emulator is using them with just the emulator and the JellyBean Easter Egg.
emulator -avd <your_avd_name> -gpu on
should give you noticeably better performance than
emulator -avd <your_avd_name> -gpu off
A little extra info:
You can install the proprietary driver xorg-x11-drv-catalyst, if you want to try it, from RPM Fussion and will find it in the non-free repo there.
If you don't have them already have RPM Fussion repos on your system (detailed instructions on there site.) I strongly recommend them. They are well supported and will give you less headaches than using some of Fedora equivalents (they return mp3 support to packages, for example.)
You say you are new to Linux (or maybe you mean playing with drivers on Linux) either way an FYI: You don't need to include the target platform when install packages (i.e. the .x86_64 .i686) Yum will sort that out for you unless you need libraries for an architecture other than the one you are running.
I am not familiar with a Android kernel compile process.
But I encountered a problem recently, and it troubled me so much.
Here is the problem descrition:
Based on Android, I build customed images including boot.img, system.img and so on.
Then I need to flash those images to physical device in order to boot to Android Home Screen.
Before compiling those images files, I have set a new kernel command line:
CONFIG_CMDLINE="root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"
After compiling those images, I opened boot.img in vim and saw the following string in it:
"root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"
But when I flashed the boot.img into device, I got the different output like this:
**Kernel command line: console=ttyO2,115200n8 earlyprintk**
In other word, I set the kernel command line value, and it was wrote into boot.img, but when
flash boot.img into device, I got a different kernel command line value.
Has anybody ever encountered this problem and got it fixed?
Really appreciating your help.
Thanks advanced!
The bootloader will be passing a command line to the kernel.
For example if u-boot bootloader is used,
it will be contained in the u-boot variable bootargs
This can be verified at the bootloader prompt.
For example if the device is using u-boot bootloader.
Connect the device to your PC over a serial prompt.
Launch a serial emulator on your PC (minicom, teraterm, hyper-terminal).
Power-on the device.
Press any key to halt the device boot at the bootloader stage itself.
Now on the u-boot prompt enter the following command:
u-boot# printenv
This will list all the uboot-variables. Note the value of variable bootargs.
This can be modified by using the following command:
u-boot# setenv bootargs ''
To save this value across reboots use the following commmand:
u-boot# saveenv
Similar functionality is available in other bootloaders as well.