Update instructions for running under QEMU

Removed build instructions since the scripts automatically use prebuilts.
Also edited the section for clarity.

Change-Id: I1d548c9fe225b9b2da85cc187952ca96da17ee1a
1 file changed
tree: bdccf5038845817db144315e151a8d204412f6e4
  1. .gitignore
  2. AUTHORS
  3. BUILD_NOTES.md
  4. LICENSE
  5. README.md
README.md

Fuchsia

Pink + Purple == Fuchsia (a new Operating System)

Welcome to Fuchsia! This is a top-level entry point for the project. From here we try to link to everything you need to get started, use, and develop for Fuchsia.

Getting the source

Get the Fuchsia source by following these two steps and then return to this document:

Prerequisites

Magenta Prerequisites

The Fuchsia source includes Magenta, the core platform which underpins Fuchsia. Follow this step to install the Magenta build prerequisites and then return to this document:

[Googlers only] Goma

Ensure goma is installed on your machine for faster builds.

Build Fuchsia

Setup Build Environment

Source the env.sh script, which provides helpful shell functions for Fuchsia development. The following command also changes the command prompt and sets up for a x86-64 build.

source scripts/env.sh && envprompt && fset x86-64

Run envhelp to see other useful shell functions, and envhelp <function> for specific usage information.

[optional] You might find it useful to add a shell function fuchsia as a shortcut to setup the build environment. For that, add this your shell startup script (e.g. ~/.bashrc):

export FUCHSIA_ROOT=/path/to/my/fuchsia/source
function fuchsia() {
  source $FUCHSIA_ROOT/scripts/env.sh && envprompt && fgo && fset x86-64 "$@"
}

[optional] Customize Build Environment

By default you will get a x86-64 debug build, and you can skip this step unless you want something else.

[Googlers only: If you have goma installed, it will also be used by default. Prefer goma over ccache]

Run fset-usage to see a list of build options. Some examples:

fset x86-64           # x86-64 debug build, no goma, no ccache
fset arm64            # arm64 debug build, no goma, no ccache
fset x86-64 --release # x86-64 release build, no goma, no ccache
fset x86-64 --ccache  # x86-64 debug build, ccache enabled

Note: to use ccache or goma you must install them first.

Build Fuchsia

Once you have setup your build environment, simply run:

fbuild

This builds Magenta, the sysroot, and the default Fuchsia build.

After Fuchsia is built, you will have a Magenta (magenta.bin) image and a user.bootfs file in out/debug-{arch}/.

Run Fuchsia in QEMU

You can run Fuchsia under emulation using QEMU. Fuchsia includes prebuilt binaries for QEMU under buildtools/qemu.

The frun command will launch Magenta within QEMU, using the locally built user.bootfs:

frun

There are various flags for frun to control QEMU‘s configuration. The -m flag sets QEMU’s memory size in MB, while -g and -N enable graphics and networking, respectively (see below). Use frun -h to see all available options.

When Fuchsia has booted and started an MXCONSOLE, you can run programs!

For example, to receive deep wisdom, run:

fortune

Enabling Graphics

To enable graphics, add the -g flag to frun:

frun -g

Run graphical applications (using mozart) in /system/apps like this:

@ bootstrap launch spinning_square_view

Some more mozart example apps are here.

Enabling Network

Note: Networking support within QEMU is only available under x86_64.

First, configure a virtual interface for QEMU's use.

Once this is done you can add the -N flag to frun:

frun -N

Run Fuchsia on hardware

Additional helpful documents