Fuchsia OS入门官方文档
Fuchsia
Pink + Purple == Fuchsia (a new Operating System)
Welcome to Fuchsia! This document has everything you need to get started with Fuchsia.
NOTE: The Fuchsia source includes Zircon, the core platform that underpins Fuchsia. The Fuchsia build process will build Zircon as a side-effect; to work on Zircon only, read and follow Zircon's Getting Started doc.
Contents
Prerequisites
Prepare your build environment (once per build environment)
Debian
sudo apt-get install build-essential curl git python unzip
macOS
Install Command Line Tools:
xcode-select --install
In addition to Command Line Tools, you also need to install a recent version of Xcode.
Get the Source
Follow the instructions to get the Fuchsia source and then return to this document.
Build Fuchsia
Note: A quick overview of the basic build-and-pave workflow can be found here.
Build
If you added .jiri_root/bin
to your path as part of getting the source code, the fx
command should already be in your path. If not, the command is also available as scripts/fx
.
fx set x64
fx full-build
The first command selects the build configuration you wish to build and generates the build system itself in an output directory (e.g., out/debug-x64
).
The second command actually executes the build, transforming the source code in build products. If you modify the source tree, you can do an incremental build by re-running the fx full-build
command alone.
Alternatively, you can use the underlying build system directly.
[optional] Customize Build Environment
By default you will get a x64 debug build. You can skip this section unless you want something else.
Run fset-usage
to see a list of build options. Some examples:
fx set x64 # x64 debug build
fx set arm64 # arm64 debug build
fx set x64 --release # x64 release build
[optional] Accelerate builds with ccache
and goma
ccache
accelerates builds by caching artifacts from previous builds. ccache
is enabled automatically if the CCACHE_DIR
environment variable is set and refers to a directory that exists.
[Googlers only: goma
accelerates builds by distributing compilation across many machines. If you have goma
installed in ~/goma
, it is used by default. It is also used by default in preference to ccache
.]
To override the default behaviors, pass flags to fx set
:
--ccache # force use of ccache even if goma is available
--no-ccache # disable use of ccache
--no-goma # disable use of goma
Boot Fuchsia
Installing and booting from hardware
To get Fuchsia running on hardware requires using the paver, which these instructions will help you get up and running with.
Note: A quick overview of the basic build-and-pave workflow can be found here.
Boot from QEMU
If you don't have the supported hardware, you can run Fuchsia under emulation using QEMU. Fuchsia includes prebuilt binaries for QEMU under buildtools/qemu
.
The fx run
command will launch Zircon within QEMU, using the locally built disk image:
fx run
There are various flags for fx run
to control QEMU's configuration:
-m
sets QEMU's memory size in MB.-g
enables graphics (see below).-N
enables networking (see below).
Use fx run -h
to see all available options.
QEMU tips
ctrl+a x
will exit QEMU in text mode.ctrl+a ?
orctrl+a h
prints all supported commands.
Enabling Graphics
Note: Graphics under QEMU are extremely limited due to a lack of Vulkan support. Only the Zircon UI renders.
To enable graphics under QEMU, add the -g
flag to fx run
:
fx run -g
Enabling Network
First, configure a virtual interface for QEMU's use.
Once this is done you can add the -N
and -u
flags to fx run
:
fx run -N -u $FUCHSIA_SCRIPTS_DIR/start-dhcp-server.sh
The -u
flag runs a script that sets up a local DHCP server and NAT to configure the IPv4 interface and routing.
Explore Fuchsia
When Fuchsia has booted and displays the “$” shell prompt, you can run programs!
For example, to receive deep wisdom, run:
fortune
To shutdown or reboot Fuchsia, use the dm
command:
dm help
dm shutdown
Change some source
Almost everything that exists on a Fuchsia system is stored in a Fuchsia package. A typical development workflow involves re-building and pushing Fuchsia packages to a development device or QEMU virtual device.
Make a change to the rolldice binary in garnet/bin/rolldice/src/main.rs
.
In a separate shell, start the development update server, if it isn't already running:
fx serve -v
Re-build and push the rolldice package to a running Fuchsia device with:
fx build-push rolldice
From a shell prompt on the Fuchsia device, run the updated package with:
run rolldice
Select a tab
Fuchsia shows multiple tabs after booting with graphics enabled. 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.
- Tab zero is the console and displays the boot and component log.
- Tabs 1, 2 and 3 contain shells.
- Tabs 4 and higher contain components you've launched.
Note: to select tabs, you may need to enter “console mode”. See the next section for details.
Launch a graphical component
QEMU does not support Vulkan and therefore cannot run our graphics stack.
Most graphical components in Fuchsia use the Mozart system compositor. You can launch such components, commonly found in /system/apps
, like this:
launch spinning_square_view
Source code for Mozart example apps is here.
When you launch something that uses Mozart, uses hardware-accelerated graphics, or if you build the default package (which will boot into the Fuchsia System UI), Fuchsia will enter “graphics mode”, which will not display any of the text shells. In order to use the text shell, you will need to enter “console mode” by pressing Alt-Escape. In console mode, Alt-Tab will have the behavior described in the previous section, and pressing Alt-Escape again will take you back to the graphical shell.
If you would like to use a text shell inside a terminal emulator from within the graphical shell you can launch the term by selecting the “Ask Anything” box and typing moterm
.
Running tests
Compiled test binaries are installed in /pkgfs/packages/
. You can run a test by invoking it in the terminal. E.g.
/pkgfs/packages/ledger_tests/0/test/ledger_unittests
If you want to leave Fuchsia running and recompile and re-run a test, run Fuchsia with networking enabled in one terminal, then in another terminal, run:
fx run-test <test name> [<test args>]
You may wish to peruse the testing FAQ.
Contribute changes
- See CONTRIBUTING.md.
Additional helpful documents
- Fuchsia documentation hub
- Working with Zircon - copying files, network booting, log viewing, and more
- Information on the system bootstrap component.
Fuchsia OS入门官方文档的更多相关文章
- [零]java8 函数式编程入门官方文档中文版 java.util.stream 中文版 流处理的相关概念
前言 本文为java.util.stream 包文档的译文 极其个别部分可能为了更好理解,陈述略有改动,与原文几乎一致 原文可参考在线API文档 https://docs.oracle.com/jav ...
- os.path官方文档(附翻译)
This module implements some useful functions on pathnames. To read or write files see open(), and fo ...
- 《SpringCloudDubbo开发日记》(一)Nacos连官方文档都没写好
背景 现在的微服务框架一般分dubbo和springcloud两套服务治理体系,dubbo是基于zookeeper为注册中心,springcloud是基于eureka作为注册中心. 但是现在eurek ...
- 【翻译】Django Channels 官方文档 -- Tutorial
Django Channels 官方文档 https://channels.readthedocs.io/en/latest/index.html 前言: 最近课程设计需要用到 WebSocket,而 ...
- hbase官方文档(转)
FROM:http://www.just4e.com/hbase.html Apache HBase™ 参考指南 HBase 官方文档中文版 Copyright © 2012 Apache Soft ...
- HBase 官方文档
HBase 官方文档 Copyright © 2010 Apache Software Foundation, 盛大游戏-数据仓库团队-颜开(译) Revision History Revision ...
- HBase官方文档
HBase官方文档 目录 序 1. 入门 1.1. 介绍 1.2. 快速开始 2. Apache HBase (TM)配置 2.1. 基础条件 2.2. HBase 运行模式: 独立和分布式 2.3. ...
- HBase 官方文档0.90.4
HBase 官方文档0.90.4 Copyright © 2010 Apache Software Foundation, 盛大游戏-数据仓库团队-颜开(译) Revision History Rev ...
- python中文官方文档记录
随笔记录 python3.10中文官方文档百度网盘链接:https://pan.baidu.com/s/18XBjPzQTrZa5MLeFkT2whw?pwd=1013 提取码:1013 1.pyth ...
随机推荐
- When do we use Initializer List in C++?
Initializer List is used to initialize data members of a class. The list of members to be initialize ...
- WPF 引用第三方库的控件在设计器加上设计时数据和属性
本文告诉大家如何在 VisualStudio 2022 的 XAML 设计器中,在设计时给第三方控件加上设计用的属性和数据的方法 此功能要求使用不低于 VisualStudio 2019 的 16.8 ...
- 『学了就忘』Linux启动引导与修复 — 71、grub启动引导程序的加密
目录 1.什么是grub加密 2.grub加密步骤 3.grub加密的lock属性 1.什么是grub加密 上篇文章说了,系统在开机的时候,有一个5秒的读秒时间,方便你进入到grub界面中. 如下图所 ...
- 联盛德 HLK-W806 (八): 4线SPI驱动SSD1306/SSD1315 128x64 OLED液晶屏
目录 联盛德 HLK-W806 (一): Ubuntu20.04下的开发环境配置, 编译和烧录说明 联盛德 HLK-W806 (二): Win10下的开发环境配置, 编译和烧录说明 联盛德 HLK-W ...
- Flutter 中如何优雅的实现多渠道打包(埋点统计系列)
我是 Zero,脑图先奉上 先赞后看,更新永不断 只要你关注 Flutter,这篇文章你绝对用得着,==> 强烈建议收藏 多渠道打包介绍 多渠道打包的主要作用是满足产品的运营需求,统计渠道和活动 ...
- mysql表死锁查询
1.查询是否锁表show open tables where in_use>0; 2.查询进程show processlist查询到相对应的进程,然后 kill id 3.查看正在锁的事务sel ...
- 如何在Uni-app中通过腾讯IM SDK实现社交应用和直播互动等功能
Uni-app想开发社交应用.IM.店铺客服.嵌入式社交模块.在线直播互动,这些功能Uni-app官方也没提供SDK,怎么办呢?找IM老大腾讯云啊,今天我们就在Uni-app中把腾讯云即时通讯TXIM ...
- Postman环境变量的使用
前言 请注意,Postman新版有ui上的改动,本文使用的Postman 版本8.4.0 for Mac, ui有调整,但是功能无改变. Postman是一款接口调测的软件,服务端开发的同学肯定会对自 ...
- 基于DNN的残余回声抑制
摘要 由于功率放大器或扬声器的限制,即使在回声路径完全线性的情况下,麦克风捕获的回声信号与远端信号也不是线性关系.线性回声消除器无法成功地消除回声的非线性分量.RES是在AES后对剩余回声进行抑制的一 ...
- nim_duilib(8)之combo
introduction 更多控件用法,请参考 here 和 源码. 本文的代码基于这里 combo的更多用法,请参考源码中combo.h提供的函数,文末添加其提供的公有函数 xml文件添加代码 基于 ...