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

Pi Emulation #435

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .vscode/extensions.json

This file was deleted.

83 changes: 83 additions & 0 deletions docs/Splashkit/DevEnviroment/PiEmulation/QEMU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Guide to Raspberry Pi Emulation on QEMU

This guide will walk you through the process of emulating a Raspberry Pi 3B+ using QEMU, an
open-source emulator capable of running virtual machines on various architectures, including ARM,
the architecture used by Raspberry Pi.

## Install QEMU

Start by installing QEMU on your computer. You can download the latest version of QEMU from the
official website [here](https://www.qemu.org/download/).

![](/images/installqemu.png) _You may need to confugure environment variables for the qemu to
aactually work in any sub directory_ Windows:

![](/images/environment.png)

## Download the Raspberry Pi Image

Obtain a Raspberry Pi image file that you want to emulate. You can find official Raspberry Pi images
on the Raspberry Pi website or from other reliable sources. Visit the official Raspberry Pi website
[here](https://www.raspberrypi.com/software/operating-systems/) for available images.

## Set Up the Image

Extract the necessary files from the Raspberry Pi image, including the kernel and device tree. These
files are essential for the emulation process.

Extract the image, to view two image files. _Here 0.fat has kernels, and hardware configs_ while
1.mg is bootable image.

![](/images/filestructure1.png) Extract the highlighted files from the image. (_You may choose the
raspberry you want to target._)

![](/images/filestructure1.png)

Following should be the final file structure. ![](/images/filestructure1.png)

## Configure QEMU

Use the QEMU command-line interface to configure the emulation settings. Specify the Raspberry Pi
model you want to emulate, allocate the amount of RAM, and set other relevant parameters. Below is
an example command for emulating a Raspberry Pi 3B+:

**Copy code** (_Change the configuration if you wish for other devices than 3B+, otherwise ignore_)

```shell
qemu-system-aarch64 -machine raspi3b -cpu cortex-a72 -dtb bcm2710-rpi-3-b-plus.dtb -m 1G -smp 4 -serial stdio -kernel kernel8.img -sd ./2023-05-03-raspios-bullseye-arm64.img -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -device usb-mouse -device usb-kbd -device usb-net,netdev=net0 -netdev user,id=net0,hostfwd=tcp::2222-:22
```

## Start the Emulation

Launch the QEMU emulator with the configured settings and the Raspberry Pi image. You should observe
the output as the kernel boots up. After a couple of seconds, you should see the output from the
kernel bootup. Eventually, you will see the login prompt:

```shell
Starting Light Display Manager...
[ OK ] Started OpenBSD Secure Shell server.
[ OK ] Finished Turn on SSH if /boot/ssh is present.
[ OK ] Finished Rotate log files.
Debian GNU/Linux 11 raspberrypi ttyAMA0

raspberrypi login:
```

## Access the Emulated Raspberry Pi

Once the emulation is up and running, you can interact with the emulated Raspberry Pi. You have the
option to connect to it using SSH or access it through the QEMU console.

Install the splashkit SDK under linux installation.

![](/images/skm.png)

_Please bear in mind that emulating a Raspberry Pi with QEMU has its limitations, and not all
hardware interactions may function as expected. Nevertheless, it serves as a valuable tool for
testing and debugging software across various Raspberry Pi models without the need for physical
hardware._

## Detailed guides

https://interrupt.memfault.com/blog/emulating-raspberry-pi-in-qemu#Dockerfile
https://raduzaharia.medium.com/system-emulation-using-qemu-raspberry-pi-3-4973260ffb3e
27 changes: 27 additions & 0 deletions docs/Splashkit/DevEnviroment/PiEmulation/RPi-emulator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# RPi-Emulator

RPi-Emulator is a newly launched computer program, which is designed to facilitate the emulation of
Raspbian environment on Windows computer. This program is like a simplified model of QEMU with
similar setup but different user interface.

Raspberry Pi Emulator serves as a form of wrapper for QEMU, with the primary aim of simplifying
Raspberry Pi emulation, while also improving the overall operational efficiency of the simulated
hardware on your computer.

Typically, this Raspberry Pi emulator provides an intuitive graphical user interface (GUI) and also
expands system storage, to accomodate the Raspbian data.

Essentially, RPi-Emulator is a new program that allows you to easily run a Raspbian system on your
Windows computer, to emulate the Raspberry Pi 3 hardware and enjoy unrestrained coding experience on
your Windows PC.
![](https://a.fsdn.com/con/app/proj/rpiqemuwindows/screenshots/raspbian%201.png/max/max/1)
![](https://a.fsdn.com/con/app/proj/rpiqemuwindows/screenshots/raspbian%202.png/max/max/1)

## Steps to run

1. Download the .zip from [here](https://sourceforge.net/projects/rpiqemuwindows/)

1. Extract "RPi Emulation.zip"

1. Fo in to the folder and run the run.bat file, follow instructions in the README.txt file and
within a few minutes you should have a Raspberry Pi emulation on your desktop.
86 changes: 86 additions & 0 deletions docs/Splashkit/DevEnviroment/PiEmulation/VirtualBox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# PI Emulation (Raspbian OS virtually)

To test your games for the arcade machine when you don't have access to a Raspberry Pi or the arcade
machine, you can set up a virtual environment using VirtualBox and emulate the Raspberry Pi 3 B+.
Here's a short guide on how to do it:

1. Install VirtualBox (or virtual machines).
1. Install Raspbian OS on the virtual machine.
1. Install Splashkit sdk on the Raspbian machine.

Steps:

## Install VirtualBox:

1. Download the VirtualBox installer from their official wiki page
[here](https://www.virtualbox.org/wiki/Downloads).
1. Choose the installer for your operating system (Windows, Linux, or Mac).
1. Run the installer and follow the on-screen instructions to install VirtualBox on your computer.
![](/images/oracle.png)

## Download Raspberry Pi OS Desktop ISO:

1. Go to the Raspberry Pi download page
[here](https://www.raspberrypi.com/software/raspberry-pi-desktop/) and navigate to the Raspberry
Pi Desktop section.
1. Click on the "Download" button to directly download the Raspberry Pi OS Desktop ISO file. (Note:
ISO size may exceed over 3 GB.)
1. Alternatively, you can choose to download the ISO file using a Torrent client if you have one
installed.

## Create a new virtual machine for Raspberry Pi OS Desktop:

1. Launch VirtualBox and click on the "New" button to create a new virtual machine.
1. Give your virtual machine a name, such as "Raspberry Pi OS Desktop." Choose the directory, wher
you want the virtual machine to be installed on. (Note: Disk sould have enough space)
1. Choose the operating system as Linux and select Debian (64-bit) as the version
![](/images/virtualconfig.png)

1. Allocate an appropriate amount of RAM for your virtual machine. _The least recommended size is
1GB, but you can allocate more if your computer has enough resources._
1. Configure the number of CPUs allocated to your virtual machine. _Using 2 to 4 cores is
recommended if your machine has 4 or 8 cores._ ![](/images/virtualhardware.png)

1. Create a virtual hard disk for your virtual machine. _Choose the default options unless you have
specific requirements._
1. Allocate enough disk space for your virtual machine. _It is recommended to allocate at least 15
to 25GB depending on your usage._ ![](/images/virtualdisk.png)

1. Click Next, recheck everything as similar to the steps above in the configuration summary. Click
on `Finish`. ![](/images/virtuallists.png)

1. Click on settings. Choose Display. Tick Enable 3D acceleration. Allocate 128 MB video memory.
![](/images/virtualgpu.png) _Now you have a virtual box configured. Lets Move to installation of
Raspbian OS._
1. Associate the Raspberry Pi OS Desktop ISO file you downloaded with your virtual machine.

1. Click on Storage.
1. Choose Empty under “Controller:IDE”.
1. Click on disk icon.

![](/images/virtualoptical.png)

1. Browse the Raspbian OS ISO, we just downloaded.
1. Click `“OK”`.

## Install Raspberry Pi OS Desktop on your virtual machine:

1. Start your Raspberry Pi OS Desktop virtual machine by clicking on the "Start" button in
VirtualBox.
1. Select “Graphical install”. Follow the on-screen instructions. Choose Guided - use entire disk.

![](/images/virtualdebian.png)

1. Select “All files in one partition”.

![](/images/virtualdebian2.png)

1. Choose the language, partition disks, and configure other settings as per your preferences.
1. Once the installation is complete, your Raspberry Pi OS Desktop virtual machine is ready to use.
![](/images/virtualrsp.png)

## Install SplashKit SDK:

1. Follow the instructions provided by SplashKit to install the SDK. You can refer to the official
SplashKit documentation [here](https://splashkit.io/articles/installation/ubuntu/) for detailed
installation steps .
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions docs/Splashkit/DevEnviroment/PiEmulation/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Emulating Raspberry Pi on Windows with QEMU

In this guide, we will walk you through the process of emulating a Raspberry Pi r.

## Methods

### [Method 1: Using QEMU](/QEMU.md)

QEMU (Quick Emulator) is a powerful and versatile emulator that allows you to run various operating
systems, including Raspberry Pi OS, on your Windows machine.

- **_Most recommended method, as it emulates hardware specification for Raspberry Pi 3B+_**
- _Might feel laggy on some devices_
- _Supports Windows and MacOS_

## [Method 2: Using rpi-emulator](/RPi-emulator.md)

rpi-emulator is a specialized tool for emulating Raspberry Pi on Windows.

- **_Emulates RPi3B specs_**
- _Outdated_
- _Supports Windows_

## [Method 3: Using VirtualBox](/VirtualBox.md)

VirtualBox is a popular virtualization software that can be used to emulate Raspberry Pi.

- **Best performance**
- _Supports Windows and MacOS_
1 change: 0 additions & 1 deletion documentation
Submodule documentation deleted from 27db4b
Loading