Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run on emulator #1

Closed
onatm opened this issue Mar 26, 2019 · 4 comments

Comments

@onatm
Copy link

commented Mar 26, 2019

I found this repo after long research to find a baremetal example for smartphones having armv7. I want to thank you for your effort on this.

I've been trying to run goldfish example on an emulator but I couldn't manage to boot kernel.img.

I've changed the compiler in the MakeFile from arm-linux-androideabi to arm-none-eabi and I am trying to run it on macOS.

You can see the AVD that I use below:

    Name: Nexus7
  Device: Nexus 7 (Google)
    Path: /Users/<user>/.android/avd/Nexus7.avd
  Target:
          Based on: Android 4.0.3 (IceCreamSandwich) Tag/ABI: default/armeabi-v7a

And this is the command I use to start the emulator with kernel.img:

/usr/local/share/android-sdk/emulator/emulator -verbose -avd Nexus7 -shell -show-kernel -qemu -kernel kernel.img

I'd be appreciated if you can help me run this on emulator 😃

@zhuowei

This comment has been minimized.

Copy link
Owner

commented Mar 26, 2019

@onatm what happens when you run the command?

@onatm

This comment has been minimized.

Copy link
Author

commented Mar 26, 2019

I am adding the output after the start of QEMU main loop

emulator: Android qemu version 28.0.23.0 (build_id 5264690) (CL:be2be19ca0131957449e8c0ded5e55070f9537b0)

emulator: Starting QEMU main loop
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'ro.opengles.version' = '131072'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '85m'
emulator: Adding boot property: 'ro.config.low_ram' = 'true'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '213'
emulator: goldfish_events.have-dpad: false
emulator: goldfish_events.have-trackball: false
emulator: goldfish_events.have-camera: true
emulator: goldfish_events.have-keyboard: false
emulator: goldfish_events.have-lidswitch: false
emulator: goldfish_events.have-tabletmode: false
emulator: goldfish_events.have-touch: false
emulator: goldfish_events.have-multitouch: true
emulator: control console listening on port 5554, ADB on port 5555
Not using any http proxy
emulator: Adding boot property: 'qemu.timezone' = 'Europe/London'
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized

emulator: Warning: config.ini contains invalid skin.path entry: (null)
emulator: Adding boot property: 'ro.opengles.version' = '131072'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '85m'
emulator: Adding boot property: 'ro.config.low_ram' = 'true'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '213'
emulator: Adding boot property: 'qemu.timezone' = 'Europe/London'
qemu-system-armel: error while loading state for instance 0x0 of device 'goldfish_pipe'
deleteSnapshot: for default_boot
@zhuowei

This comment has been minimized.

Copy link
Owner

commented Mar 26, 2019

@onatm I'm guessing the error is in the "error while loading state" bit? I haven't touched this code for years, so maybe Android Emulator's recent save state/fast boot support broke things.

I don't have access to my Mac right now, and Android Studio on my Windows machine is really old (probably predates the snapshots changes?), so it might take me a while to test this.

In the meantime, there are many baremetal Raspberry Pi tutorials available, and the Raspberry Pi 2 and 3 can be emulated by QEMU, so if you need to test baremetal code, that's an alternative option. There's also tutorials for the ARM Vexpress/RealView board, which can also be emulated by QEMU. So you don't have to test with Android Emulator.

Edit: on my copy of Android Studio/Android SDK (26.1.4.0), running emulator -help gives me this option:

-no-snapstorage                do not mount a snapshot storage file (this disables all snapshot functionality)

Try adding that option? If that option doesn't help, try some of the other snapshot-disabling options.

@onatm

This comment has been minimized.

Copy link
Author

commented Mar 26, 2019

@zhuowei disabling snapshot resolved the issue! thank you for taking the time to help me!

@onatm onatm closed this Mar 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.