@@ -5,7 +5,9 @@ use core::{cmp, fmt::Write, mem, slice};
5
5
use hermit_entry:: elf:: KernelObject ;
6
6
use log:: info;
7
7
use uefi:: {
8
+ Identify ,
8
9
prelude:: * ,
10
+ proto:: console:: gop:: GraphicsOutput ,
9
11
table:: { boot:: * , cfg} ,
10
12
} ;
11
13
@@ -21,6 +23,25 @@ unsafe fn loader_main(_handle: Handle, mut system_table: SystemTable<Boot>) -> S
21
23
crate :: log:: init ( ) ;
22
24
23
25
info ! ( "Hello World from UEFI boot!" ) ;
26
+ let stdout = system_table. stdout ( ) ;
27
+ stdout. clear ( ) . unwrap ( ) ;
28
+ writeln ! ( stdout, "Hello World! This is the bootloader" ) . unwrap ( ) ;
29
+
30
+
31
+ let bs = system_table. boot_services ( ) ;
32
+ let gop_handle = bs. get_handle_for_protocol :: < GraphicsOutput > ( ) . unwrap ( ) ;
33
+ let mut gop = bs. open_protocol_exclusive :: < GraphicsOutput > ( gop_handle) . unwrap ( ) ;
34
+ // for g in gop.modes(){
35
+ // info!("gop_handle modes: {:#?}", g.info());
36
+ // }
37
+ let gop_mode = gop. query_mode ( 0 ) . unwrap ( ) ;
38
+ gop. set_mode ( & gop_mode) . unwrap ( ) ;
39
+ let mut framebuffer = gop. frame_buffer ( ) ;
40
+ for i in 0 ..1000 {
41
+ unsafe { framebuffer. write_byte ( i, 69 ) } ;
42
+
43
+ }
44
+ drop ( gop) ;
24
45
// look for the rsdp in the EFI system table before calling exit boot services (see UEFI specification for more)
25
46
let rsdp_addr = {
26
47
// returns an iterator to the config table entries which in turn point to other system-specific tables
@@ -56,6 +77,7 @@ unsafe fn loader_main(_handle: Handle, mut system_table: SystemTable<Boot>) -> S
56
77
57
78
// exit boot services for getting a runtime view of the system table and an iterator to the UEFI memory map
58
79
let ( runtime_system_table, mut memory_map) = system_table. exit_boot_services ( ) ;
80
+ //writeln!(stdout, "Hello World! This is the bootloader").unwrap();
59
81
60
82
memory_map. sort ( ) ;
61
83
let mut entries = memory_map. entries ( ) ;
@@ -88,6 +110,7 @@ unsafe fn loader_main(_handle: Handle, mut system_table: SystemTable<Boot>) -> S
88
110
runtime_system_table,
89
111
start_address,
90
112
end_address,
113
+
91
114
)
92
115
}
93
116
0 commit comments