Code Monkey home page Code Monkey logo

fuchsia-1's Introduction

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. (You can ignore the toolchain installation instructions unless you want to build your own; the Fuchsia manifest will automatically obtain a prebuilt toolchain.)

[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

fuchsia-1's People

Contributors

petrhosek avatar cyngus84 avatar joshtriplett avatar poitch avatar krisgiesing avatar mikejurka avatar gmesch avatar toshikik avatar

Watchers

wyx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.