mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Refine osdk doc
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f7a9ed8739
commit
286a3514b3
@ -39,11 +39,11 @@ contains the following contents:
|
|||||||
|
|
||||||
```text
|
```text
|
||||||
myos/
|
myos/
|
||||||
src/
|
├── Cargo.toml
|
||||||
lib.rs
|
├── OSDK.toml
|
||||||
Cargo.toml
|
├── rust-toolchain.toml
|
||||||
OSDK.toml
|
└── src/
|
||||||
rust-toolchain.toml
|
└── lib.rs
|
||||||
```
|
```
|
||||||
|
|
||||||
### `src/lib.rs`
|
### `src/lib.rs`
|
||||||
|
@ -36,17 +36,17 @@ The generated directory structure will be as follows:
|
|||||||
|
|
||||||
```text
|
```text
|
||||||
myworkspace/
|
myworkspace/
|
||||||
Cargo.toml
|
├── Cargo.toml
|
||||||
OSDK.toml
|
├── OSDK.toml
|
||||||
rust-toolchain.toml
|
├── rust-toolchain.toml
|
||||||
myos/
|
├── myos/
|
||||||
src/
|
│ ├── Cargo.toml
|
||||||
lib.rs
|
│ └── src/
|
||||||
Cargo.toml
|
│ └── lib.rs
|
||||||
mymodule/
|
└── mymodule/
|
||||||
src/
|
├── Cargo.toml
|
||||||
lib.rs
|
└── src/
|
||||||
Cargo.toml
|
└── lib.rs
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the two projects,
|
In addition to the two projects,
|
||||||
|
@ -60,7 +60,7 @@ Arguments for running QEMU
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- Build a project with `./initramfs.cpio.gz`
|
- Build a project with `./initramfs.cpio.gz`
|
||||||
as the initramfs and `multiboot2` as the boot portocol:
|
as the initramfs and `multiboot2` as the boot protocol:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo osdk build --initramfs="./initramfs.cpio.gz" --boot.protocol="multiboot2"
|
cargo osdk build --initramfs="./initramfs.cpio.gz" --boot.protocol="multiboot2"
|
||||||
|
@ -17,7 +17,7 @@ and one of the crate
|
|||||||
(in the same directory as the crate's `Cargo.toml`).
|
(in the same directory as the crate's `Cargo.toml`).
|
||||||
So which manifest should be used?
|
So which manifest should be used?
|
||||||
|
|
||||||
The rules are
|
The rules are:
|
||||||
|
|
||||||
- If running commands in the workspace root directory,
|
- If running commands in the workspace root directory,
|
||||||
the `OSDK.toml` of the workspace will be used
|
the `OSDK.toml` of the workspace will be used
|
||||||
@ -54,72 +54,72 @@ args = [ # <10>
|
|||||||
|
|
||||||
1. The arguments provided will be passed to the guest kernel.
|
1. The arguments provided will be passed to the guest kernel.
|
||||||
|
|
||||||
Optional. The default value is empty.
|
Optional. The default value is empty.
|
||||||
|
|
||||||
Each argument should be in one of the following two forms:
|
Each argument should be in one of the following two forms:
|
||||||
`KEY=VALUE` or `KEY` if no value is required.
|
`KEY=VALUE` or `KEY` if no value is required.
|
||||||
Each `KEY` can appear at most once.
|
Each `KEY` can appear at most once.
|
||||||
|
|
||||||
2. The arguments provided will be passed to the init process,
|
2. The arguments provided will be passed to the init process,
|
||||||
usually, the init shell.
|
usually, the init shell.
|
||||||
|
|
||||||
Optional. The default value is empty.
|
Optional. The default value is empty.
|
||||||
|
|
||||||
3. The path to the built initramfs.
|
3. The path to the built initramfs.
|
||||||
|
|
||||||
Optional. The default value is empty.
|
Optional. The default value is empty.
|
||||||
|
|
||||||
4. The bootloader used to boot the kernel.
|
4. The bootloader used to boot the kernel.
|
||||||
|
|
||||||
Optional. The default value is `grub`.
|
Optional. The default value is `grub`.
|
||||||
|
|
||||||
The allowed values are `grub` and `qemu`
|
The allowed values are `grub` and `qemu`
|
||||||
(`qemu` indicates that QEMU directly boots the kernel).
|
(`qemu` indicates that QEMU directly boots the kernel).
|
||||||
|
|
||||||
5. The boot protocol used to boot the kernel.
|
5. The boot protocol used to boot the kernel.
|
||||||
|
|
||||||
Optional. The default value is `multiboot2`.
|
Optional. The default value is `multiboot2`.
|
||||||
|
|
||||||
The allowed values are `linux-efi-handover64`,
|
The allowed values are `linux-efi-handover64`,
|
||||||
`linux-legacy32`, `multiboot`, and `multiboot2`.
|
`linux-legacy32`, `multiboot`, and `multiboot2`.
|
||||||
|
|
||||||
6. The path of `grub-mkrescue`,
|
6. The path of `grub-mkrescue`,
|
||||||
which is used to create a GRUB CD_ROM.
|
which is used to create a GRUB CD_ROM.
|
||||||
|
|
||||||
Optional. The default value is system path,
|
Optional. The default value is system path,
|
||||||
determined using `which grub-mkrescue`.
|
determined using `which grub-mkrescue`.
|
||||||
|
|
||||||
This argument only takes effect
|
This argument only takes effect
|
||||||
when the bootloader is `grub`.
|
when the bootloader is `grub`.
|
||||||
|
|
||||||
7. The path of OVMF. OVMF enables UEFI support for QEMU.
|
7. The path of OVMF. OVMF enables UEFI support for QEMU.
|
||||||
|
|
||||||
Optional. The default value is empty.
|
Optional. The default value is empty.
|
||||||
|
|
||||||
This argument only takes effect
|
This argument only takes effect
|
||||||
when the boot protocol is `linux-efi-handover64`.
|
when the boot protocol is `linux-efi-handover64`.
|
||||||
|
|
||||||
8. The path of QEMU.
|
8. The path of QEMU.
|
||||||
|
|
||||||
Optional. The default value is system path,
|
Optional. The default value is system path,
|
||||||
determined using `which qemu-system-x86_64`.
|
determined using `which qemu-system-x86_64`.
|
||||||
|
|
||||||
9. The machine type of QEMU.
|
9. The machine type of QEMU.
|
||||||
|
|
||||||
Optional. Default is `q35`.
|
Optional. Default is `q35`.
|
||||||
|
|
||||||
The allowed values are `q35` and `microvm`.
|
The allowed values are `q35` and `microvm`.
|
||||||
|
|
||||||
10. Additional arguments passed to QEMU.
|
10. Additional arguments passed to QEMU.
|
||||||
|
|
||||||
Optional. The default value is empty.
|
Optional. The default value is empty.
|
||||||
|
|
||||||
Each argument should be in the form `KEY VALUE`
|
Each argument should be in the form `KEY VALUE`
|
||||||
(separated by space),
|
(separated by space),
|
||||||
or `KEY` if no value is required.
|
or `KEY` if no value is required.
|
||||||
Some keys can appear multiple times
|
Some keys can appear multiple times
|
||||||
(e.g., `-device`, `-netdev`),
|
(e.g., `-device`, `-netdev`),
|
||||||
while other keys can appear at most once.
|
while other keys can appear at most once.
|
||||||
Certain keys, such as `-cpu` and `-machine`,
|
Certain keys, such as `-cpu` and `-machine`,
|
||||||
are not allowed to be set here
|
are not allowed to be set here
|
||||||
as they may conflict with the internal settings of OSDK.
|
as they may conflict with the internal settings of OSDK.
|
||||||
|
Reference in New Issue
Block a user