pub(crate) enum Commands {
Show 18 variants GitProxy(ProxyPort), Dump, ZirconInit, UpdateAll, CheckStyle, Asm(OutArgs), Bin(OutArgs), Qemu(QemuArgs), Gdb(GdbArgs), Rootfs(ArchArg), MuslLibs(ArchArg), Ffmpeg(ArchArg), Opencv(ArchArg), LibcTest(ArchArg), OtherTest(ArchArg), Image(ArchArg), LibosLibcTest, LinuxLibos(LinuxLibosArg),
}

Variants

GitProxy(ProxyPort)

设置 git 代理。Sets git proxy.

通过 --port 传入代理端口,或者不传入端口以清除代理设置。

Input your proxy port through --port, or leave blank to unset it.

设置 --global 修改全局设置。

Set --global for global configuration.

Example
cargo git-proxy --global --port 12345
cargo git-proxy --global

Dump

打印构建信息。Dumps build config.

Example
cargo dump

ZirconInit

下载 zircon 模式需要的二进制文件。Download zircon binaries.

Example
cargo zircon-init

UpdateAll

更新工具链、依赖和子项目。Updates toolchain, dependencies and submodules.

Example

cargo update-all

CheckStyle

静态检查。Checks code without running.

设置多种编译选项,检查代码能否编译。

Try to compile the project with various different features.

Example

cargo check-style

Asm(OutArgs)

生成内核反汇编文件。Dumps the asm of kernel.

默认保存到 target/zcore.asm

The default output is target/zcore.asm.

Example

cargo asm --arch riscv64 --output riscv64.asm

Bin(OutArgs)

生成内核 raw 镜像到指定位置。Strips kernel binary for specific architecture.

默认输出到 target/{arch}/release/zcore.bin

The default output is target/{arch}/release/zcore.bin.

Example

cargo bin --arch riscv64 --output zcore.bin

Qemu(QemuArgs)

在 qemu 中启动 zCore。Runs zCore in qemu.

Example

cargo qemu --arch riscv64 --smp 4

Gdb(GdbArgs)

启动 gdb 并连接到指定端口。Launches gdb and connects to a port.

Example

cargo gdb --arch riscv64 --port 1234

Rootfs(ArchArg)

重建 Linux rootfs。Rebuilds the linux rootfs.

这个命令会清除已有的为此架构构造的 rootfs 目录,重建最小的 rootfs。

This command will remove the existing rootfs directory for this architecture, and rebuild the minimum rootfs.

Example

cargo rootfs --arch riscv64

MuslLibs(ArchArg)

将 musl 动态库拷贝到 rootfs 目录对应位置。Copies musl so files to rootfs directory.

Example

cargo musl-libs --arch riscv64

Ffmpeg(ArchArg)

将 ffmpeg 动态库拷贝到 rootfs 目录对应位置。Copies ffmpeg so files to rootfs directory.

Example

cargo ffmpeg --arch riscv64

Opencv(ArchArg)

将 opencv 动态库拷贝到 rootfs 目录对应位置。Copies opencv so files to rootfs directory.

如果 ffmpeg 已经放好了,opencv 将会编译出包含 ffmepg 支持的版本。

If ffmpeg is already there, this opencv will build with ffmpeg support.

Example

cargo opencv --arch riscv64

LibcTest(ArchArg)

将 libc 测试集拷贝到 rootfs 目录对应位置。Copies libc test files to rootfs directory.

Example

cargo libc-test --arch riscv64

OtherTest(ArchArg)

将其他测试集拷贝到 rootfs 目录对应位置。Copies other test files to rootfs directory.

Example

cargo other-test --arch riscv64

Image(ArchArg)

构造 Linux rootfs 镜像文件。Builds the linux rootfs image file.

Example

cargo image --arch riscv64

LibosLibcTest

构造 libos 需要的 rootfs 并放入 libc test。Builds the libos rootfs and puts it into libc test.

注意 这可能不是这个命令的最终形态,因此这个命令没有别名。

NOTICE This may not be the final form of this command, so this command has no alias.

Example

cargo xtask libos-libc-test

LinuxLibos(LinuxLibosArg)

在 linux libos 模式下启动 zCore 并执行位于指定路径的应用程序。Runs zCore in linux libos mode and runs the executable at the specified path.

注意 libos 模式只能执行单个应用程序,完成就会退出。

NOTICE zCore can only run a single executable in libos mode, and it will exit after finishing.

Example

cargo linux-libos --args /bin/busybox

Trait Implementations

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more

Assign values from ArgMatches to self.

Assign values from ArgMatches to self.

Append to [Command] so it can instantiate Self. Read more

Append to [Command] so it can update self. Read more

Test whether Self can parse a specific subcommand

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.