50
50
51
51
Next up are some ` use ` lines. Nothing too exciting here; the
52
52
` 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.
54
54
55
55
``` rust
56
56
{{#include .. / .. / .. / uefi - test - runner / examples / hello_world . rs: use }}
@@ -63,23 +63,18 @@ a little different from a standard Rust program.
63
63
{{#include .. / .. / .. / uefi - test - runner / examples / hello_world . rs: entry }}
64
64
```
65
65
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.
71
70
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:
73
73
74
74
``` rust
75
75
{{#include .. / .. / .. / uefi - test - runner / examples / hello_world . rs: services }}
76
76
```
77
77
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
-
83
78
Next we use the standard ` log ` crate to output "Hello world!". Then we
84
79
call ` stall ` to make the system pause for 10 seconds. This just ensures
85
80
you have enough time to see the output.
0 commit comments