@@ -76,7 +76,6 @@ struct UefiOSImpl {
7676 tasks : Vec < Arc < Task > > ,
7777 input : ScopedProtocol < Input > ,
7878 vga : ScopedProtocol < Output > ,
79- serial : ScopedProtocol < Serial > ,
8079 net : Option < NetworkInterface > ,
8180 messages : VecDeque < ( f64 , log:: Level , String , String ) > ,
8281 ui_buf : Vec < ( String , Color , Color ) > ,
@@ -183,9 +182,6 @@ impl UefiOS {
183182 let input_handles = uefi:: boot:: find_handles :: < Input > ( ) . unwrap ( ) ;
184183 let input = uefi:: boot:: open_protocol_exclusive :: < Input > ( input_handles[ 0 ] ) . unwrap ( ) ;
185184
186- let serial_handles = uefi:: boot:: find_handles :: < Serial > ( ) . unwrap ( ) ;
187- let serial = uefi:: boot:: open_protocol_exclusive :: < Serial > ( serial_handles[ 0 ] ) . unwrap ( ) ;
188-
189185 let vga_handles = uefi:: boot:: find_handles :: < Output > ( ) . unwrap ( ) ;
190186 let mut vga = uefi:: boot:: open_protocol_exclusive :: < Output > ( vga_handles[ 0 ] ) . unwrap ( ) ;
191187
@@ -197,7 +193,6 @@ impl UefiOS {
197193 tasks : Vec :: new ( ) ,
198194 input,
199195 vga,
200- serial,
201196 net : None ,
202197 messages : VecDeque :: new ( ) ,
203198 ui_buf : vec ! [ ] ,
@@ -394,31 +389,6 @@ impl UefiOS {
394389 . to_string ( )
395390 }
396391
397- /// Find the topmost device that implements this protocol.
398- fn handle_on_device < P : Protocol > ( & self , device : & DevicePath ) -> Handle {
399- for i in 0 ..device. node_iter ( ) . count ( ) {
400- let mut buf = vec ! [ ] ;
401- let mut dev = DevicePathBuilder :: with_vec ( & mut buf) ;
402- for node in device. node_iter ( ) . take ( i + 1 ) {
403- dev = dev. push ( & node) . unwrap ( ) ;
404- }
405- let mut dev = dev. finalize ( ) . unwrap ( ) ;
406- if let Ok ( h) = uefi:: boot:: locate_device_path :: < P > ( & mut dev) {
407- return h;
408- }
409- }
410- // TODO(veluca): bubble up errors.
411- panic ! ( "handle not found" ) ;
412- }
413-
414- fn open_protocol_on_device < P : Protocol > (
415- & self ,
416- device : & DevicePath ,
417- ) -> Result < ScopedProtocol < P > > {
418- let handle = self . handle_on_device :: < P > ( device) ;
419- Ok ( uefi:: boot:: open_protocol_exclusive :: < P > ( handle) ?)
420- }
421-
422392 pub fn open_first_disk ( & self ) -> Disk {
423393 Disk :: new ( * self )
424394 }
@@ -542,19 +512,6 @@ impl UefiOS {
542512 {
543513 let mut os = self . borrow_mut ( ) ;
544514
545- let style = match level {
546- log:: Level :: Trace => anstyle:: AnsiColor :: Cyan . on_default ( ) ,
547- log:: Level :: Debug => anstyle:: AnsiColor :: Blue . on_default ( ) ,
548- log:: Level :: Info => anstyle:: AnsiColor :: Green . on_default ( ) ,
549- log:: Level :: Warn => anstyle:: AnsiColor :: Yellow . on_default ( ) ,
550- log:: Level :: Error => anstyle:: AnsiColor :: Red . on_default ( ) . bold ( ) ,
551- } ;
552- write ! (
553- os. serial,
554- "[{time:.1}s {style}{level:5}{style:#} {target}] {msg}\r \n "
555- )
556- . unwrap ( ) ;
557-
558515 os. messages . push_back ( ( time, level, target. into ( ) , msg) ) ;
559516 const MAX_MESSAGES : usize = 5 ;
560517 if os. messages . len ( ) > MAX_MESSAGES {
0 commit comments