'Hello world' in Micropython in a 64-bit RISC-V BusyBox Linux guest on the Diosix hypervisor
by diosix
This is a demonstration of printing ‘hello world!’ using Micropython in a 64-bit RISC-V Linux guest OS on the bare-metal Diosix hypervisor. The command just
seen in the term does the following:
- The hypervisor and its system services are built, a Linux guest binary is located, and all these components are packaged up in a simple file-system image ready to boot.
- The hypervisor is started inside Qemu, it initializes the emulated hardware – a quad-core 1GB system – and loads a system service that handles the console interface.
- The hypervisor then loads the Linux guest OS into its virtualized environment, called a capsule, and starts it.
- Linux boots as if it were on real hardware, and eventually gets to a login prompt.
-
Via the console system service, the user can log in and interact with a BusyBox-based environment. The
zsh
shell is provided. -
The guest kernel build and version info can be displayed using the
uname -a
command, and a list of the root directory usingls -l /
. -
The user can run
micropython
and print ‘hello world!’ from the interpreter. -
After exiting Micropython, the user can shutdown the guest using the command
poweroff
.
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v2 format, as a .cast file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 395307.cast
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/395307.cast',
document.getElementById('player'),
{ cols: 219, rows: 46 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/395307 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.