Skip to content

Commit

Permalink
quickstart: add sparcv8leon3-generic-qemu target
Browse files Browse the repository at this point in the history
JIRA: RTOS-887
  • Loading branch information
lukileczo committed Aug 29, 2024
1 parent 8c548c2 commit 01789ee
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 1 deletion.
1 change: 1 addition & 0 deletions building/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The Phoenix-RTOS reference project supports the following target platforms:
- riscv64-generic-spike
- sparcv8leon3-gr716-mini
- sparcv8leon3-gr712rc-board
- sparcv8leon3-generic-qemu

To get the list of valid targets the `build.sh` script should be launched with an empty `TARGET` variable, eg:

Expand Down
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The ARINC653 execution environment (APEX) is under development.
11. [Running system on `sparcv8leon3-gr716-mini`](quickstart/sparcv8leon3-gr716-mini.md)
12. [Running system on `sparcv8leon3-gr712rc-board`](quickstart/sparcv8leon3-gr712rc-board)
13. [Running system on `sparcv8leon3-gr712rc-board`](quickstart/sparcv8leon3-gr716-mimas)
14. [Running system on `sparcv8leon3-generic-qemu`](quickstart/sparcv8leon3-generic-qemu)
5. [Loader](loader/index.md)
1. [Architecture](loader/architecture.md)
2. [Command-line interface](loader/cli.md)
Expand Down
Binary file added quickstart/_images/sparcv8leon3-qemu-help.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/sparcv8leon3-qemu-ps.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added quickstart/_images/sparcv8leon3-qemu-psh.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion quickstart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ and building artifacts are available in the `_boot` directory. The building proc
11. [Running system on sparcv8leon3-gr716-mini](sparcv8leon3-gr716-mini.md)
12. [Running system on sparcv8leon3-gr712rc-board](sparcv8leon3-gr712rc-board.md)
13. [Running system on sparcv8leon3-gr716-mimas](sparcv8leon3-gr716-mimas.md)
14. [Table of Contents](../index.md)
14. [Running system on sparcv8leon3-generic-qemu](sparcv8leon3-generic-qemu.md)
15. [Table of Contents](../index.md)

```{toctree}
:maxdepth: 1
Expand All @@ -41,4 +42,5 @@ riscv64-generic-spike.md
sparcv8leon3-gr716-mini.md
sparcv8leon3-gr712rc-board.md
sparcv8leon3-gr716-mimas.md
sparcv8leon3-generic-qemu.md
```
78 changes: 78 additions & 0 deletions quickstart/sparcv8leon3-generic-qemu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Running system on <nobr>sparcv8leon3-generic-qemu</nobr>

These instructions describe how to run a Phoenix-RTOS system image for the `sparcv8leon3-generic-qemu` target
architecture.

Note that the build artifacts, including the system image, should be first provided in the `_boot` directory.

If you haven't run the `build.sh` script yet, run it for `sparcv8leon3-generic-qemu` target.

See [how to build the Phoenix-RTOS system image](../building/index.md).

## Running the system image

Support for the `leon3_generic` machine in QEMU has been greatly improved in QEMU 9.0.0. It is recommended to use QEMU
version 9.0.0 or later to run the Phoenix-RTOS system image for the `sparcv8leon3-generic-qemu` target architecture.
To obtain QEMU in this version on Ubuntu 22.04, you must build it from source.

<details>
<summary>How to build QEMU (Ubuntu 22.04)</summary>

- Download QEMU 9.0.2 (or later) source code from the official repository and build for the `sparc-softmmu` target:

```console
git clone https://gitlab.com/qemu-project/qemu.git -b v9.0.2 && \
cd qemu && \
git submodule update --init --recursive && \
./configure --target-list=sparc-softmmu && \
make && \
sudo make install
```

- Check if QEMU is properly installed:

```console
qemu-system-sparc --version
```

```console
~$ qemu-system-arm --version
QEMU emulator version 9.0.2 (v9.0.2)
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
~$
```

</details>

To run the image under QEMU, use the following script provided in the `phoenix-rtos-project` repository:

```console
./scripts/sparcv8leon3-generic-qemu.sh
```

## Using Phoenix-RTOS

Phoenix-RTOS will be launched and the `psh` shell command prompt will appear in the terminal.

![Image](_images/sparcv8leon3-qemu-psh.jpg)

To get the available command list use command:

```console
help
```

![Image](_images/sparcv8leon3-qemu-help.jpg)

To get the list of working processes use command:

```console
ps
```

![Image](_images/sparcv8leon3-qemu-ps.jpg)

## See also

1. [Running system on targets](index.md)
2. [Table of Contents](../index.md)

0 comments on commit 01789ee

Please sign in to comment.