Recent

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

Seenkao

  • Sr. Member
  • ****
  • Posts: 251
Qemu - Arm.
« on: September 01, 2021, 07:59:00 pm »
Я собираюсь эмулировать какую-нибудь из ARM систем. Linux, Android, возможно и ту и другую. Так как занимаюсь в основном на паскале, то и мне надо будет отлаживать конечный код, но я не имею ни какой машины ARM. Понятно что на Android не очень удобно отлаживать код, потому что зачастую его не увидишь в действии, в данный момент времени.
Потому хотел узнать, какую машину настраивать для Linux-ARM/Linux-ARM64.

Подскажите пожалуйста! Не очень охота тратить ещё лишний день-два на поиски нужного, а потом ещё дополнительное время на установку.

Или есть ещё варианты, о которых я не знаю?

Google translate:
I'm going to emulate one of the ARM systems. Linux, Android, possibly both. Since I work mainly in Pascal, I will also need to debug the final code, but I do not have any ARM machine. It is clear that on Android it is not very convenient to debug the code, because often you will not see it in action at a given time.
So I wanted to know which machine to configure for Linux-ARM / Linux-ARM64.

Tell me please! Not really willing to spend an extra day or two looking for the right one, and then another extra time for installation.

Or are there other options that I don't know about?

Alextp

  • Hero Member
  • *****
  • Posts: 1417
    • UVviewsoft
Re: Qemu - Arm.
« Reply #1 on: September 01, 2021, 10:36:15 pm »
Можно купить Raspberry Pi 3 - она ARM64, но ОС 32 битная. Но можно наверно и не официальную ОС поставить - Manjaro for ARM64. Просто записываешь ОС на карту памяти, карту вставляешь в плату.

===
EN:
You can get the Raspberry Pi 3 (ARM64 with 32-bit OS). you can install 64-bit ARM OS on it. Manjaro ARM64.
« Last Edit: September 02, 2021, 09:50:55 am by Alextp »

ttomas

  • Full Member
  • ***
  • Posts: 231
Re: Qemu - Arm.
« Reply #2 on: September 02, 2021, 01:32:06 am »
You can try Oracle cloude VM, more details
https://synopse.info/forum/viewtopic.php?id=5945

avra

  • Hero Member
  • *****
  • Posts: 2251
    • Additional info
Re: Qemu - Arm.
« Reply #3 on: September 02, 2021, 08:45:09 am »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

PascalDragon

  • Hero Member
  • *****
  • Posts: 3421
  • Compiler Developer
Re: Qemu - Arm.
« Reply #4 on: September 02, 2021, 09:17:28 am »
Можно купить Raspberry Pi 3 - она ARM64, но ОС 32 битная. Но можно наверно и не официальную ОС поставить - Manjaro for ARM64. Просто записываешь ОС на карту памяти, карту вставляешь в плату.

In the international part of the forum, please don't reply solely in a non-English language. Thank you.

Seenkao

  • Sr. Member
  • ****
  • Posts: 251
Re: Qemu - Arm.
« Reply #5 on: September 27, 2021, 05:28:42 pm »
Благодарю всех за информацию! Это достаточно полезная информация!
Но я решил остановиться, как и хотел, на Qemu. В интернете достаточно немало информации по созданию полноценной ARM машины, за малым исключением, достаточно сложно эмулировать графическое окружение машины.
Я создал и 32-х и 64-х битные машины Debian для тестов, но без графики. Если будет полезно, то выкладываю сайт, где человек сделал эти машины. И две ссылки на видео (Rus) которые я сделал больше для себя, и изменял настройки эмулируемой машины, а так же показал как можно было вытащить ядро из созданной машины другим способом.

yandex translate:
Thank you all for the information! This is quite useful information!
But I decided to stop, as I wanted, on Qemu. There is quite a lot of information on the Internet on creating a full-fledged ARM machine, with a few exceptions, it is quite difficult to emulate the graphical environment of the machine.
I created both 32-bit and 64-bit Debian machines for tests, but without graphics. If it will be useful, then I post a site where a person made these machines. And two links to the video (Rus) that I made more for myself, and changed the settings of the emulated machine, and also showed how it was possible to pull the kernel from the created machine in another way.

Installing Debian on QEMU’s 32-bit ARM “virt” board
video_1_rus - installing Debian 32 ARM
video_2_rus - extract the kernel.

they are quite well suited for testing programs. :-[

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 724
Re: Qemu - Arm.
« Reply #6 on: September 27, 2021, 08:26:51 pm »
This isn't right place to ask such questions. Read QEMU docs first. https://wiki.qemu.org/Documentation/Platforms/ARM Have you tried "-device virtio-gpu-pci"?
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

  • Sr. Member
  • ****
  • Posts: 251
Re: Qemu - Arm.
« Reply #7 on: September 27, 2021, 09:22:47 pm »
This isn't right place to ask such questions. Read QEMU docs first. https://wiki.qemu.org/Documentation/Platforms/ARM
FPC позволяет разрабатывать под разные платформы, в том числе и под платформы ARM. Я не вижу ни чего плохого в том, что человек сможет использовать стороннюю платформу, не имея при этом машину на данной платформе. Если человек сможет протестировать свой код на платформе отличной, от той, которая у него есть, то зачастую отпадают лишние потребности в тестировании кода на оборудовании, которое не предназначено для тестирования. Или человек просто боится за это оборудование. Я говорю про телефоны и планшеты.
Потому, я думаю, я правильно сделал, что задал именно здесь свой вопрос!

Да, мы должны знать, что конечный код должен быть проверен на конечном оборудовании, на котором он будет работать. От этого ни куда не уйти.

Yandex translate:
FPC allows you to develop for different platforms, including ARM platforms. I don't see anything wrong with a person being able to use a third-party platform without having a machine on this platform. If a person can test his code on a platform different from the one he has, then often there are no unnecessary needs for testing code on equipment that is not intended for testing. Or a person is simply afraid for this equipment. I'm talking about phones and tablets.
Therefore, I think I did the right thing by asking my question here! :)

Yes, we should know that the final code must be tested on the final hardware on which it will run. There is no getting away from this.

Quote from: Mr.Madguy
Have you tried "-device virtio-gpu-pci"?
Благодарю, я проверял. Но как описано в документации, мы должны прописать в ядре Linux (гостевой машины):
CONFIG_DRM=y
CONFIG_DRM_VIRTIO_GPU=y
но у меня и опыта мало и я не достаточно хорошо разбираюсь в Linux, потому на данный момент, я не знаю, как поменять ядро уже созданной машины на ядро скомпилированное снаружи. Либо как создать машину с заданными параметрами ядра (как я понял, ядро идёт по умолчанию). И потому я отказался от дальнейших "боданий" с эмулятором (хотя, я наверняка знаю, что это можно сделать). Я потратил на это достаточно немало времени.
Единственное что я не проверил, это Debian 11. Возможно там это уже прописано в ядре.

Yandex translate:
Thank you, I checked. But as described in the documentation, we must register in the Linux kernel (guest machine):
CONFIG_DRM=y
CONFIG_DRM_VIRTIO_GPU=y
but I have little experience and I don't understand Linux well enough, because at the moment, I don't know how to change the kernel of an already created machine to a kernel compiled from the outside. Or how to create a machine with the specified kernel parameters (as I understood, the kernel goes by default). And so I refused to continue "butting" with the emulator (although I certainly know that this can be done). I spent quite a lot of time on this.
The only thing I haven't checked is Debian 11. Perhaps it is already written in the kernel there.

engkin

  • Hero Member
  • *****
  • Posts: 2962
Re: Qemu - Arm.
« Reply #8 on: September 28, 2021, 03:31:53 am »
It is clear that on Android it is not very convenient to debug the code, because often you will not see it in action at a given time.

What about Android and gdbserver?

If I were you I would give gdbserver a chance If you have an Android phone with an ARM CPU. You should be able to tell if it works for you or not in a short time.

Usually, gdbserver comes with Android NDK:
$NDK/prebuilt/android-*/gdbserver/gdbserver

Assuming you know enough Linux, you should have the power to run teminal apps on your phone in the temp folder:
/data/local/tmp/

LAMW can produce Android terminal apps for you.

Lazarus *might* work with gdbserver in this configuration.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 724
Re: Qemu - Arm.
« Reply #9 on: September 28, 2021, 06:03:11 am »
I just don't think, that things are so hard with ARM. Have you looked into list of predefined hardware? There should be video-capable hardware there and there should be pre-built versions of Linux distributives for it. Even if it doesn't have video, it should have some way to get to remote desktop, such as VNC or SSH. For example it looks like Pi 2 has video. At least it has HDMI and therefore should have video. And then you just need to search for Linux distributives for it. For example Debian. So, this problem boils down to search skill.

I also think, that almost all distributives should support virtio by default. At least I've never met distributive, that would refuse to work with "-vga virtio".

And it's better to ask such questions on QEMU/Linux forums, because there is better chance to get answers there. I know, that sometimes one may know only one forum and doesn't want to register on some other. Sometimes it's also easier for me to ask my question on "wrong" forum. But at the end it's not good practice to do it.

P.S. I have to agree, that things are little bit overcomplicated there. Lack of standard video support, like VGA, causes too many problems and solutions are too complicated.
« Last Edit: September 28, 2021, 09:04:11 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.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3289
Re: Qemu - Arm.
« Reply #10 on: September 28, 2021, 08:50:19 am »
I'm going to emulate one of the ARM systems. Linux, Android, possibly both. Since I work mainly in Pascal, I will also need to debug the final code, but I do not have any ARM machine. It is clear that on Android it is not very convenient to debug the code, because often you will not see it in action at a given time.
So I wanted to know which machine to configure for Linux-ARM / Linux-ARM64.

Well buy one for $deity's sake! Raspberry Pis and their equivalent aren't expensive, and it's been possible to run FPC/Lazarus on them and do your debugging natively for the last ten years or so.

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: 724
Re: Qemu - Arm.
« Reply #11 on: September 28, 2021, 12:04:50 pm »
Unfortunately currently it's the best result, I've achieved. No picture then. Manuals say, that I should connect via VNC. I try to do it, but nothing happens. I.e. QEMU runs, port is open, if I don't specify password - it asks to enter password. But once I enter password - nothing happens.
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

  • Sr. Member
  • ****
  • Posts: 251
Re: Qemu - Arm.
« Reply #12 on: September 28, 2021, 12:22:44 pm »
Повторюсь.  :)
Я не говорил, что эти способы плохи! Но на данный момент, у меня дома лежит тонна телефонов, планшетов и прочей "ереси". Я бы с удовольствием просто поставил на какой-нибудь планшет FPC/Lazarus. Но я не видел способа установки FPC/Lazarus на планшет.
Покупать ещё одну "игрушку" в виде Raspberry Pi это означает, что у меня дома прибавится хлама (хотя компьютер/ноутбук на основе ARM было бы интересно взять, там намного больше возможностей).
Установив виртуальную машину, я могу как писать код на этой машине, так и запускать его. Проводить мелкие тесты, хоть десятки тысяч раз, выверяя работу кода и просматривать ассемблерный код (да, я тот ещё задрот). Потому, виртуальная машина, является достаточно неплохим решением проблемы и не захламляет пространство дома.
Я думаю вы понимаете, что в жизни, в данное время, мне не пригодится Raspberri. А купив его я так же закину его к туче телефонов и он будет большую часть времени просто пылится. :) В течении длительного времени я не покупал себе смартфон,  купив его, побаловался и "забросил в угол", поняв, что не так уж и сильно он мне нужен.
engkin, я попробую ваше предложение, но я не уверен в том, что я буду часто его использовать. Зачастую проще быстро перекомпилировать код и тут же его проверить. Понятно дело, если я буду работать с графикой, то в этом случае, ваше предложение будет очень полезным! :)

yandex translate:
I will repeat myself.  :)
I didn't say that these methods are bad! But at the moment, I have a ton of phones, tablets and other "heresy"at home. 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.
Buying another "toy" in the form of a Raspberry Pi means that I will have more junk at home (although it would be interesting to take an ARM-based computer/laptop, there are much more possibilities there).
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.
I think you understand that in life, at this time, Raspberri will not be useful to me. And after buying it, I will also throw it to the phones and it will just gather dust most of the time. :) For a long time, I did not buy a smartphone for myself, after buying it, I pampered myself and "threw it into a corner", realizing that I did not need it so much.
engkin, I will try your suggestion, but I am not sure that I will use it often. It is often easier to quickly recompile the code and immediately check it. It is clear that if I work with graphics, then in this case, your suggestion will be very useful!:)

Задрот - a person who has been looking for a better way/result for a long time and persistently.

Seenkao

  • Sr. Member
  • ****
  • Posts: 251
Re: Qemu - Arm.
« Reply #13 on: September 28, 2021, 12:27:40 pm »
Unfortunately currently it's the best result, I've achieved. No picture then. Manuals say, that I should connect via VNC. I try to do it, but nothing happens. I.e. QEMU runs, port is open, if I don't specify password - it asks to enter password. But once I enter password - nothing happens.
Network installation?

Как вам удалось запустить графический интерфейс? Если не секрет.

yandex translation:
How did you manage to launch the GUI? If it's not a secret.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3289
Re: Qemu - Arm.
« Reply #14 on: September 28, 2021, 12:54:49 pm »
But I haven't seen a way to install FPC/Lazarus on a tablet.

Have you asked?

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.

A tablet is just a computer: you can attach an HDMI monitor to it and a keyboard and it runs very much like any other system. Or- if I recall correctly- you can VNC into it or tunnel X11 over SSH just like you can with any other Linux system. Or you can, in many cases, go the whole hog and reflash it with Debian.

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

 

TinyPortal © 2005-2018