diff --git a/getting_started.md b/getting_started.md index 55780d07f0bae941d4d76eadeccf6cf982a28e8e..839b6e1b54c5da13a2dc11358c6b231706713dc4 100644 --- a/getting_started.md +++ b/getting_started.md @@ -7,30 +7,28 @@ 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: - * [Install prerequisites](https://fuchsia.googlesource.com/docs/+/HEAD/getting_source.md#Prerequisites) for Jiri, a tool for multi-repo development. - * [Create a new checkout](https://fuchsia.googlesource.com/docs/+/HEAD/getting_source.md#Creating-a-new-checkout) of Fuchsia. - ## Prerequisites -### Magenta Prerequisites +### Prepare your build environment The Fuchsia source includes [Magenta](https://fuchsia.googlesource.com/magenta/+/HEAD/README.md), -the core platform which underpins Fuchsia. Follow this step to install the -Magenta build prerequisites and then return to this document. (You can ignore -the toolchain installation instructions unless you want to build your own; the -Fuchsia manifest will automatically obtain a prebuilt toolchain.) +the core platform that underpins Fuchsia. Click the link below, follow the +steps under *Preparing the build environment*, and then return to this document. +(Do not continue to the *Install Toolchains* section.) * [Preparing the Magenta build environment](https://fuchsia.googlesource.com/magenta/+/master/docs/getting_started.md#Preparing-the-build-environment). ### [Googlers only] Goma -Ensure `goma` is installed on your machine for faster builds. +* Ensure `goma` is installed on your machine for faster builds. ## Build Fuchsia +### Get the source +Follow all steps in this document and then return to this document: + * [Fuchsia Source](getting_source.md) + ### Setup Build Environment Source the @@ -59,9 +57,9 @@ function fuchsia() { } ``` -### [optional] Customize Build Environment +#### [optional] Customize Build Environment -By default you will get a x86-64 debug build, and you can skip this step unless +By default you will get a x86-64 debug build. You can skip this section unless you want something else. [Googlers only: If you have `goma` installed, it will also be used by default. @@ -77,7 +75,7 @@ fset x86-64 --release # x86-64 release build, no goma, no ccache fset x86-64 --ccache # x86-64 debug build, ccache enabled ``` -### Build Fuchsia +### Start the build Once you have setup your build environment, simply run: @@ -90,9 +88,24 @@ 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 +## Boot Fuchsia + +### Boot from hardware -You can run Fuchsia under emulation +If you have the appropriate hardware, you can run Fuchsia on any of these +devices. Follow the links for configuration information. + +* [Acer Switch Alpha 12](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/acer12.md) +* [Intel NUC](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/nuc.md) +* [Raspberry Pi 3](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/rpi3.md) + +Once you've configured the hardware, run `fboot` on your host system, then boot +the hardware from the USB thumb drive that can be built following the directions +at the end of the Acer Switch page. + +### Boot from QEMU + +If you don't have the supported hardware, you can run Fuchsia under emulation using [QEMU](https://fuchsia.googlesource.com/magenta/+/HEAD/docs/qemu.md). Fuchsia includes prebuilt binaries for QEMU under `buildtools/qemu`. @@ -110,81 +123,82 @@ There are various flags for `frun` to control QEMU's configuration: Use `frun -h` to see all available options. -When Fuchsia has booted and started an MXCONSOLE, you can run programs! +#### Enabling Graphics -For example, to receive deep wisdom, run: +To enable graphics under QEMU, add the `-g` flag to `frun`: ``` -fortune +frun -g ``` -#### Working with Fuchsia system components - -The `bootstrap` utility sets up the environment and system services required to -use and develop Fuchsia applications. You can run individual Fuchsia -applications invoking their url: - - @ bootstrap [args...] <app url> <app args...> +#### Enabling Network -Bootstrap can also be run without any initial apps for debugging purposes. +Note: Networking support within QEMU is only available under x86_64. - @ bootstrap - +First, [configure](https://fuchsia.googlesource.com/magenta/+/master/docs/qemu.md#Enabling-Networking-under-QEMU-x86_64-only) +a virtual interface for QEMU's use. -You can run additional Fuchsia applications within an existing bootstrap -environment by specifying the `boot` scope: +Once this is done you can add the -N and -u flags to `frun`: - @boot <app url> <app args...> +``` +frun -N -u $FUCHSIA_SCRIPTS_DIR/start-dhcp-server.sh +``` -More information on bootstrap and its uses can be -found [here](https://fuchsia.googlesource.com/modular/+/HEAD/src/bootstrap/). +The `-u` flag runs a script that sets up a local DHCP server and NAT to +configure the IPv4 interface and routing. -#### Enabling Graphics +## Explore Fuchsia -Note: Graphics mode can only be run in a GUI with a terminal. +When Fuchsia has booted and displays the "$" shell prompt, you can run programs! -To enable graphics, add the `-g` flag to `frun`: +For example, to receive deep wisdom, run: ``` -frun -g +fortune ``` -Run graphical applications -using [mozart](https://fuchsia.googlesource.com/mozart) in `/system/apps` like -this: +### Select a tab -``` -@ bootstrap launch spinning_square_view -``` +Fuchsia shows multiple tabs after booting. The currently selected tab is +highlighted in yellow at the top of the screen. You can switch to the next +tab using Alt-Tab on the keyboard. -Some more mozart example apps are [here](https://fuchsia.googlesource.com/mozart/+/HEAD/examples/). +- Tab zero is the console and displays the boot and application log. +- Tabs 1, 2 and 3 contain Fuchsia shells. +- Tab 4 contains a Magenta shell. +- Tabs 5 and higher contain applications you've launched. -#### Enabling Network +Fuchsia has two shells. The Magenta shell talks directly to Magenta and has the +prompt "magenta$". The Fuchsia shell supports additional features like the +Application Manager. The prompt for the Fuchsia shell is just "$". You should +use the Fuchsia shell for the examples below. -Note: Networking support within QEMU is only available under x86_64. +### Launch a graphical application -First, [configure](https://fuchsia.googlesource.com/magenta/+/master/docs/qemu.md#Enabling-Networking-under-QEMU-x86_64-only) -a virtual interface for QEMU's use. +(qemu users must enable graphics with -g.) -Once this is done you can add the -N and -u flags to `frun`: +Most graphical applications in Fuchsia use the +[mozart](https://fuchsia.googlesource.com/mozart) engine. You can launch +such applications, commonly found in `/system/apps`, like this: ``` -frun -N -u $FUCHSIA_SCRIPTS_DIR/start-dhcp-server.sh +launch spinning_square_view ``` -The `-u` flag runs a script that sets up a local DHCP server and NAT to -configure the IPv4 interface and routing. - -### Running Fuchsia on hardware +Note: Fuchsia is currently doing software-based rendering and not using the GPU. -* [Acer Switch Alpha 12](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/acer12.md) -* [Intel NUC](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/nuc.md) -* [Raspberry Pi 3](https://fuchsia.googlesource.com/magenta/+/master/docs/targets/rpi3.md) +Source code for mozart example apps is +[here](https://fuchsia.googlesource.com/mozart/+/HEAD/examples/). -## Contributing changes -* See [CONTRIBUTING.md](https://fuchsia.googlesource.com/docs/+/HEAD/CONTRIBUTING.md). +## Contribute changes +* See [CONTRIBUTING.md](CONTRIBUTING.md). ## Additional helpful documents -* [Fuchsia documentation](https://fuchsia.googlesource.com/docs) hub. -* Building [Fuchsia's toolchain](https://fuchsia.googlesource.com/docs/+/HEAD/building_toolchain.md) -* More about the [build commands](build_system.md) called under-the-hood by `fbuild`. +* Using Magenta - copying files, network booting, log viewing, and more are [here] +(https://fuchsia.googlesource.com/magenta/+/master/docs/getting_started.md#Copying-files-to-and-from-Magenta) +* [Fuchsia documentation](https://fuchsia.googlesource.com/docs) hub +* Build [Fuchsia's toolchain](building_toolchain.md) +* More about the [build commands](build_system.md) called under-the-hood by `fbuild` +* More information on the system bootstrap application is +[here](https://fuchsia.googlesource.com/modular/+/HEAD/src/bootstrap/).