Recent

Author Topic: Qemu - Arm.  (Read 7203 times)

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #15 on: September 28, 2021, 12:57:20 pm »
Oh, man. I was stupid. I just needed to wait longer!
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3217
Re: Qemu - Arm.
« Reply #16 on: September 28, 2021, 01:10:20 pm »
Oh, man. I was stupid. I just needed to wait longer!

(GUFFAW) Don't worry, we've all been caught by that sort of thing. Qemu's VNC is fairly foolproof since it's implemented as part of the host video card emulation, so everybody- irrespective of target being emulated- is using the same code and bugs will be spotted and (occasionally) fixed.

One thing I've found extremely useful is to always start the Qemu program from a command line (i.e. shell session), since if something isn't working properly there will be error messages that you definitely need to see. If you want to hide the session you can use the (Gnu) screen command, but you definitely don't want to run it from a desktop environment menu item- at least when you're getting it working- since all your startup messages will be lost.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #17 on: September 28, 2021, 01:18:51 pm »
(GUFFAW) Don't worry, we've all been caught by that sort of thing. Qemu's VNC is fairly foolproof since it's implemented as part of the host video card emulation, so everybody- irrespective of target being emulated- is using the same code and bugs will be spotted and (occasionally) fixed.

One thing I've found extremely useful is to always start the Qemu program from a command line (i.e. shell session), since if something isn't working properly there will be error messages that you definitely need to see. If you want to hide the session you can use the (Gnu) screen command, but you definitely don't want to run it from a desktop environment menu item- at least when you're getting it working- since all your startup messages will be lost.

MarkMLl
I guess, VNC wasn't working due to long period of "Guest disabled display". But at the end I don't need VNC - everything work directly.

It was long way to this solution. Here it is:
Code: [Select]
qemu-system-aarch64.exe -display sdl -M virt -m 8G -cpu cortex-a57 -smp 4 -device virtio-keyboard -device virtio-tablet <or virtio-mouse - it works too> -device virtio-gpu,xres=1920,yres=1080 <TAP network here - won't work without OpenVPN> -bios "edk2-aarch64-code.fd" -boot c -hda "path_to_linux.iso"

Things to note:
1) CPU is important - without it system would be 32bit
2) BIOS is important - u-boot should be used for rootfs images, BIOS is different for 32bit and 64bit
3) Keyboard doesn't work during boot screen - you need to wait till timeout
4) Loading is looooooooooooooooong - you need to be patient, long "Guest disabled display" doesn't mean that nothing works
« Last Edit: September 28, 2021, 01:30:13 pm by Mr.Madguy »
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3217
Re: Qemu - Arm.
« Reply #18 on: September 28, 2021, 01:55:13 pm »
But at the end I don't need VNC - everything work directly.

If you don't have VNC then as soon as you close the window displaying your emulated system it will terminate abruptly: no SSH etc.

Be warned that Qemu and Docker don't always play nicely together. Apart from that I think most of https://wiki.freepascal.org/Qemu_and_other_emulators is still applicable.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #19 on: September 28, 2021, 02:21:33 pm »
In order to make keyboard work during EFI shell - add following options:
Code: [Select]
-device xhci,id=xhci -device usb-kbd,bus=xhci.0You won't be able to install Debian without it.
« Last Edit: September 28, 2021, 02:24:46 pm by Mr.Madguy »
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

engkin

  • Hero Member
  • *****
  • Posts: 2954
Re: Qemu - Arm.
« Reply #20 on: September 28, 2021, 03:54:05 pm »
I would love to just put an FPC/Lazarus on some tablet. But I haven't seen a way to install FPC/Lazarus on a tablet..

Try Termux. I managed to use FPC on a phone with it.

Quote
By installing a virtual machine, I can both write code on this machine and run it. Conduct small tests, at least tens of thousands of times, verifying the work of the code and viewing the assembly code (я ещё тот "zadrot"). Therefore, a virtual machine is a fairly good solution to the problem and does not clutter up the space of the house.

SPEED

This is exactly what my previous post is about.. You compile on your computer and generated assembly files are on your computer, as usual. The application is a console type, does *not* need installation, just copying to the device and giving it executable permissions over ADB. All your work is on your computer.

Installation is needed for apk files, and it does take a few seconds. Copying is fast, less than a second, usually.

This was my biased opinion.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3217
Re: Qemu - Arm.
« Reply #21 on: September 28, 2021, 04:02:03 pm »
Try Termux. I managed to use FPC on a phone with it.

That's what I used to get FPC to work on an x86_64 tablet. I remember there was something slightly odd about the internal paths that I had to fudge... if anybody goes this way I might have notes somewhere.

FDroid might have entered into the equation somewhere as well.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

engkin

  • Hero Member
  • *****
  • Posts: 2954
Re: Qemu - Arm.
« Reply #22 on: September 28, 2021, 04:13:59 pm »
For x86, I used android-x86 was fast enough on my older computer. Couldn't get all its versions to work, but the ones that did were good enough.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #23 on: September 28, 2021, 05:02:26 pm »
Tried to do the same with Debian today. It was a little bit harder, because Debian doesn't have live Arm64 images, i.e. it needs installation. Then I had some problems with install media. And when I solved them, I realized, that my work day ended. So, I'll continue this experiment tomorrow. While I've got used to x86, Arm is also very interesting for me.
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

Seenkao

  • Full Member
  • ***
  • Posts: 249
Re: Qemu - Arm.
« Reply #24 on: September 28, 2021, 06:04:30 pm »
Have you asked?
Тут вы правы, я не спрашивал, но так же и не видел. На Raspberry видел.
Eng:
You're right there, I didn't ask, but I also didn't see it. I saw it on Raspberry.
Quote from: MarkMLl
About four years ago I installed FPC onto an Android-based x86_64 tablet... although admittedly I had to jump through a few hoops to do so. I'd be very surprised indeed if there isn't a "right way" to do this by now.
Давайте всё же будем объективны. Меня интересует возможность проверки/отладки работы на ARM машинах, а не на машинах x86.  :)
Eng:
Let's still be objective. I am interested in the possibility of checking/debugging work on ARM machines, and not on x86 machines. :)

Try Termux. I managed to use FPC on a phone with it.
Qemu предоставляет полную возможность работы с ARM машиной. При этом не отвлекаясь на телефон или подключенное устройство.
Eng:
Qemu provides a full opportunity to work with an ARM machine. At the same time, without being distracted by the phone or the connected device. :)

Quote from: engkin
SPEED

This is exactly what my previous post is about.. You compile on your computer and generated assembly files are on your computer, as usual. The application is a console type, does *not* need installation, just copying to the device and giving it executable permissions over ADB. All your work is on your computer.

Installation is needed for apk files, and it does take a few seconds. Copying is fast, less than a second, usually.

This was my biased opinion.
Всё то же самое и с Qemu. Только в данном случае мы просто компилируем код и запускаем его на ARM-VM (уроков как это использовать достаточно много в интернете).
А так же VM основанная на Qemu позволила мне установить полноценный FPC и использовать его на виртуальной машине (вероятнее всего, постаравшись, FPC можно и на Android).
Eng:
Everything is the same with Qemu. Only in this case, we simply compile the code and run it on an ARM-VM (there are quite a lot of lessons on how to use it on the Internet). :)
And also VM based on Qemu allowed me to install a full-fledged gas station and use it on a virtual machine (most likely, after trying, the gas station can also be on Android).

Mr.Madguy,
я и стараюсь как раз установить изначально виртуальную машину, а не скачать готовый рабочий диск. Хотя наверно и надо было просто взять готовую рабочую машину... что было бы проще.
Eng:
I'm trying to install a virtual machine initially, and not download a ready-made working disk. Although I probably should have just taken a ready-made working machine... which would be easier.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3217
Re: Qemu - Arm.
« Reply #25 on: September 28, 2021, 06:47:04 pm »
Let's still be objective. I am interested in the possibility of checking/debugging work on ARM machines, and not on x86 machines. :)

I suspect that the best translation would be "let's stay on topic" :-)

You are of course right, but the point I'm trying to make is that if I was able to get FPC onto a tablet four years ago- and not even a tablet running the dominant variant of Android- then I'd expect that there would be a "right and proper way" by now... which doesn't rely on fossicking around using an emulator.

Later: this is directly relevant

https://hackaday.com/2020/10/07/linux-fu-the-linux-android-convergence/#more-429444

MarkMLl
« Last Edit: September 28, 2021, 08:27:02 pm by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Seenkao

  • Full Member
  • ***
  • Posts: 249
Re: Qemu - Arm.
« Reply #26 on: September 29, 2021, 08:01:21 am »
MarkMLl :)

------------------------------------------------------------
Если использовать Debian 11, то все проблемы эмуляции автоматически решаются. Debian 11 использует обновлённое ядро, которое поддерживает виртуальную составляющую Qemu и они взаимонастраиваемы. Потому с помощью данной ссылки вы можете установить ARM-машину с графической оболочкой. Позже выложу весь процесс создания рабочей VM.
yandex translate:
If you use Debian 11, then all emulation problems are automatically solved. Debian 11 uses an updated kernel that supports the virtual component of Qemu and they are mutually configurable. Therefore, using this link, you can install an ARM machine with a graphical shell. Later I will lay out the whole process of creating a working VM.

Download the kernel for Debian 11 (on the original Debian 9 website):
Quote
wget -O installer-linux http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/debian-installer/arm64/linux
wget -O installer-initrd.gz http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/debian-installer/arm64/initrd.gz
changed "stretch" to "bullseye" from:
Installing Debian on QEMU’s 32-bit ARM “virt” board

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #27 on: September 29, 2021, 09:16:16 am »
MarkMLl :)

------------------------------------------------------------
Если использовать Debian 11, то все проблемы эмуляции автоматически решаются. Debian 11 использует обновлённое ядро, которое поддерживает виртуальную составляющую Qemu и они взаимонастраиваемы. Потому с помощью данной ссылки вы можете установить ARM-машину с графической оболочкой. Позже выложу весь процесс создания рабочей VM.
yandex translate:
If you use Debian 11, then all emulation problems are automatically solved. Debian 11 uses an updated kernel that supports the virtual component of Qemu and they are mutually configurable. Therefore, using this link, you can install an ARM machine with a graphical shell. Later I will lay out the whole process of creating a working VM.

Download the kernel for Debian 11 (on the original Debian 9 website):
Quote
wget -O installer-linux http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/debian-installer/arm64/linux
wget -O installer-initrd.gz http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/debian-installer/arm64/initrd.gz
changed "stretch" to "bullseye" from:
Installing Debian on QEMU’s 32-bit ARM “virt” board
Too hard. I'm currently installing Debian 11 from official DVD, as if I would install it on x86 machine. There was only one problem. I found solution here.

P.S. Debian has terrible site. It's common practice to have "download" link somewhere on main page and avoid maze of pages, referencing to each other.
« Last Edit: September 29, 2021, 09:21:15 am by Mr.Madguy »
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

Seenkao

  • Full Member
  • ***
  • Posts: 249
Re: Qemu - Arm.
« Reply #28 on: September 29, 2021, 11:05:27 am »
Mr.Madguy,
на самом деле это выглядит довольно сложно, позже распишу и покажу все действия, думаю даже обычному пользователю будет не сложно.
Гораздо сложнее было изначально разобраться как это работает.
Eng:
in fact, it looks quite complicated, later I will write down and show all the actions, I think even an ordinary user will not be difficult.
It was much more difficult initially to figure out how it works. :)

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 713
Re: Qemu - Arm.
« Reply #29 on: September 29, 2021, 12:25:09 pm »
Ok. I've finally installed Debian. Had another problem - EFI doesn't auto-detect installed Debian, so I have to select it manually. But the biggest question is - how to install FPC/Lazarus, if Synaptic doesn't show their packages?

P.S. Installed FPC from archive, but I can't install Lazarus from sources, because I can't even install make.

P.P.S There were problems with repositories - Debian guys have done everything in order to prevent me from updating from their Internet repositories
« Last Edit: September 29, 2021, 01:28:52 pm by Mr.Madguy »
07.10.2021 - Major bug is fixed in main project, that was causing random crashes in 64bit version.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 12 years old.

 

TinyPortal © 2005-2018