Rename aster_main as ostd::main

This commit is contained in:
Jianfeng Jiang
2024-06-20 06:16:04 +00:00
committed by Tate, Hongliang Tian
parent 59350a8578
commit fe7251c413
20 changed files with 51 additions and 41 deletions

View File

@ -51,7 +51,7 @@ myos/
#### Kernel project
The `src/lib.rs` file contains the code for a simple kernel.
The function marked with the `#[aster_main]` macro
The function marked with the `#[ostd::main]` macro
is considered the kernel entry point by OSDK.
The kernel
will print `Hello world from the guest kernel!`to the console

View File

@ -40,7 +40,7 @@ and then hand over control to the kernel entry point
to execute the kernel code.
**Note**: Only kernel projects (the projects
that defines the function marked with `#[aster_main]`)
that defines the function marked with `#[ostd::main]`)
can be run;
library projects cannot.

View File

@ -76,7 +76,7 @@ Here are some additional notes for the fields:
1. The type of current crate.
Optional. If not specified,
the default value is inferred from the usage of the macro `#[aster_main]`.
the default value is inferred from the usage of the macro `#[ostd::main]`.
if the macro is used, the default value is `kernel`.
Otherwise, the default value is `library`.

View File

@ -61,8 +61,8 @@ use ostd::mm::{PageFlags, PAGE_SIZE, Vaddr, FrameAllocOptions, VmIo, VmMapOption
/// The kernel's boot and initialization process is managed by Asterinas OSTD.
/// After the process is done, the kernel's execution environment
/// (e.g., stack, heap, tasks) will be ready for use and the entry function
/// labeled as `#[aster_main]` will be called.
#[aster_main]
/// labeled as `#[ostd::main]` will be called.
#[ostd::main]
pub fn main() {
let program_binary = include_bytes!("../hello_world");
let user_space = create_user_space(program_binary);