mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 11:23:25 +00:00
Polish OSDK documentation
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
07caaa5b3f
commit
1391ff59f2
@ -1,7 +1,7 @@
|
||||
#![no_std]
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
#[macro_use]
|
||||
#[cfg_attr(ktest, macro_use)]
|
||||
extern crate ktest;
|
||||
extern crate aster_frame;
|
||||
|
||||
|
@ -18,7 +18,7 @@ pub struct BootScheme {
|
||||
pub method: Option<BootMethod>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
|
||||
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum BootMethod {
|
||||
/// Boot the kernel by making a rescue CD image.
|
||||
@ -27,26 +27,17 @@ pub enum BootMethod {
|
||||
GrubQcow2,
|
||||
/// Use the [QEMU direct boot](https://qemu-project.gitlab.io/qemu/system/linuxboot.html)
|
||||
/// to boot the kernel with QEMU's built-in Seabios and Coreboot utilites.
|
||||
#[default]
|
||||
QemuDirect,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct Boot {
|
||||
pub kcmdline: Vec<String>,
|
||||
pub initramfs: Option<PathBuf>,
|
||||
pub method: BootMethod,
|
||||
}
|
||||
|
||||
impl Default for Boot {
|
||||
fn default() -> Self {
|
||||
Boot {
|
||||
kcmdline: vec![],
|
||||
initramfs: None,
|
||||
method: BootMethod::QemuDirect,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl BootScheme {
|
||||
pub fn inherit(&mut self, from: &Self) {
|
||||
self.kcmd_args = {
|
||||
|
@ -15,11 +15,12 @@ pub struct GrubScheme {
|
||||
pub display_grub_menu: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
|
||||
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum BootProtocol {
|
||||
Linux,
|
||||
Multiboot,
|
||||
#[default]
|
||||
Multiboot2,
|
||||
}
|
||||
|
||||
@ -34,7 +35,7 @@ impl Default for Grub {
|
||||
fn default() -> Self {
|
||||
Grub {
|
||||
grub_mkrescue: PathBuf::from("grub-mkrescue"),
|
||||
boot_protocol: BootProtocol::Multiboot2,
|
||||
boot_protocol: BootProtocol::default(),
|
||||
display_grub_menu: false,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user