📜 ⬆️ ⬇️

We start and we emulate Windows on Raspberry Pi by means of QEMU

Most likely this is the first Russian-language manual about setting up QEMU on Raspberry.

Some time ago, I set about trying to launch some kind of Windows system on my Raspberry Pi 2. At first, I wanted to know if it was possible to install it, simply by writing to the SDCARD and inserting it into a “raspberry”, but this was not realized ...

After I began to look for an opportunity to run through some emulators. Stumbled upon QEMU and began to dig with it. I tried to run the emulator for a very long time, almost everything I found on the forums was written in English, and there was “at a minimum” information, and there were very few people who started it. After several unsuccessful attempts to launch QEMU, I decided to write on w3bsit3-dns.com in the topic on Raspberry. They helped me there, and I successfully started Windows 98 (almost perfect ...). I ran it on Raspibiane (Debian).

Let's start, open the terminal and register it:
')
sudo apt-get install sudo apt-get uprage sudo apt-get install git zlib1g-dev libsdl1.2-dev libpixman-1-0 libpixman-1-dev 

It is advisable to do all this through putty , so that all the characters exactly match what is written.

Go ahead:

 git clone git://git.qemu-project.org/qemu.git 

The team begins to download the "insides" of the emulator, this process does not take much time.

image

After the file is downloaded and unpacked, a folder (location / home /% username% / qemu) will appear, in which all the files that are necessary for the emulator to work will be located. After everything has been downloaded and unpacked, we prescribe this:

 cd qemu ./configure --target-list="i386-softmmu" --enable-sdl --prefix=/usr 

The configuration process begins, it does not take much time (~ 30-60 seconds). Now we need to start the debugging process:

 sudo make 

Screenshot
After entering the command, debugging will begin, it looks like this:

image

Debugging can continue indefinitely, (~ 15-20 minutes). The last thing we have to do is tweak the configs and debug it.

 sudo nano /home/pi/qemu/tcg/arm/tcg-target.c sudo nano /home/pi/qemu/tcg/i386/tcg-target.c 

Screenshot
Sometimes when executing the above commands, the system creates a new file, then we exit the editor and open the necessary configs with our hands.

image

Hold Ctrl + W, the search string opens, enter: static void tcg_out_addi. We change on static inline void tcg_out_addi. Go to the second configuration, just call the search string and enter this text: static void tcg_out_opc and change to static inline void tcg_out_opc. If you have not found any of the lines, then we do nothing, but simply close the config and perform the next step (I did not find the required line in the first config, but the emulator works fine for me).

If you are done with replacing strings, continue to torment our “raspberry”:

 sudo make sudo make install 

Screenshot
image

The emulator setup is complete. We now turn to the launch of the system. As far as I know, the emulator supports these image formats:

.img - System image.
.vhd - Virtual "hard"
.iso - Disk Image.

You can download images of the systems you are interested in here , there is also an instruction for creating your own system image.

I collected on Yandex.Disk all the images that run on QEMU and are taken from the topic, the link to which is given above. It is worth noting that the name of the Linux KDE image contains the password from the user.

We proceed to launch the system. We write to the console:

 qemu-system-i386    (-hda, -fda, -cdrom) .img -m _-___(  ). 

If all settings are correct, the system image should start loading.

This photo, how to screen in Linux, I have not mastered.

Result
image

image

QEMU can emulate not only i386 processors, but also other "platforms", more:

 ls /usr/bin/qemu* 

This query brings up a list of QEMU commands:

 qemu-system-i386 --help 

Play around with the settings of QEMU, he himself has not fully figured out with him. It is worth considering that I started the system using the resources of only one “raspberry” core, while the computer was loaded by 25-26% (running Win98). I read on the forums about multi-threading QEMU with the image of the system, but did not understand how to force the emulator to use resources of more than one core. Again, play around with the settings and maybe you will understand how to configure multithreading (do not forget to write in the comments how you did it).

Source: https://habr.com/ru/post/276637/


All Articles