Skip to content

Commit e2389fd

Browse files
authored
Merge pull request #1397 from nicholasbishop/bishop-fix-tutorial
Update the hello-world tutorial
2 parents 81ac944 + b7130a3 commit e2389fd

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

book/src/tutorial/app.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ used.
5050

5151
Next up are some `use` lines. Nothing too exciting here; the
5252
`uefi::prelude` module is intended to be glob-imported, and exports a
53-
number of commonly-used types.
53+
number of commonly-used macros, modules, and types.
5454

5555
```rust
5656
{{#include ../../../uefi-test-runner/examples/hello_world.rs:use}}
@@ -63,23 +63,18 @@ a little different from a standard Rust program.
6363
{{#include ../../../uefi-test-runner/examples/hello_world.rs:entry}}
6464
```
6565

66-
The `main` function in a Uefi application always takes two arguments,
67-
the image handle and the system table. The image [handle] represents the
68-
currently-running executable, and the system [table] provides access to
69-
many different UEFI services. The `main` function returns a [`Status`],
70-
which is essentially a numeric error (or success) code defined by UEFI.
66+
The `main` function in a UEFI application takes no arguments and returns
67+
a [`Status`], which is essentially a numeric error (or success) code
68+
defined by UEFI. The `main` function must be marked with the `#[entry]`
69+
macro.
7170

72-
The first thing we do inside of `main` is initialize `uefi_services`:
71+
The first thing we do inside of `main` is initialize the `helpers`
72+
module, which initializes logging:
7373

7474
```rust
7575
{{#include ../../../uefi-test-runner/examples/hello_world.rs:services}}
7676
```
7777

78-
The `uefi_services` crate is not strictly required to make a UEFI
79-
application with the `uefi` crate, but it makes things much simpler by
80-
setting a simple memory allocator, initializing the logger, and
81-
providing a panic handler.
82-
8378
Next we use the standard `log` crate to output "Hello world!". Then we
8479
call `stall` to make the system pause for 10 seconds. This just ensures
8580
you have enough time to see the output.

uefi-test-runner/examples/hello_world.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
// ANCHOR: use
88
use log::info;
9-
use uefi::boot;
109
use uefi::prelude::*;
1110
// ANCHOR_END: use
1211

0 commit comments

Comments
 (0)