@@ -7,7 +7,7 @@ use crate::{
77 copy_to_protected_mode, enter_protected_mode_and_jump_to_stage_3, enter_unreal_mode,
88 } ,
99} ;
10- use bootloader_x86_64_bios_common:: { BiosFramebufferInfo , BiosInfo , Region } ;
10+ use bootloader_x86_64_bios_common:: { hlt , BiosFramebufferInfo , BiosInfo , Region } ;
1111use byteorder:: { ByteOrder , LittleEndian } ;
1212use core:: { fmt:: Write as _, slice} ;
1313use disk:: AlignedArrayBuffer ;
@@ -50,12 +50,12 @@ fn start(disk_number: u16, partition_table_start: *const u8) -> ! {
5050
5151 let mut entries = [ PartitionTableEntry :: empty ( ) ; MAX_ENTRIES ] ;
5252 let raw = unsafe { slice:: from_raw_parts ( partition_table_start, ENTRY_SIZE * MAX_ENTRIES ) } ;
53- for idx in 0 .. MAX_ENTRIES {
53+ for ( idx, entry ) in entries . iter_mut ( ) . enumerate ( ) {
5454 let offset = idx * ENTRY_SIZE ;
5555 let partition_type = PartitionType :: from_mbr_tag_byte ( raw[ offset + 4 ] ) ;
5656 let lba = LittleEndian :: read_u32 ( & raw [ offset + 8 ..] ) ;
5757 let len = LittleEndian :: read_u32 ( & raw [ offset + 12 ..] ) ;
58- entries [ idx ] = PartitionTableEntry :: new ( partition_type, lba, len) ;
58+ * entry = PartitionTableEntry :: new ( partition_type, lba, len) ;
5959 }
6060 entries
6161 } ;
@@ -146,7 +146,9 @@ fn start(disk_number: u16, partition_table_start: *const u8) -> ! {
146146
147147 enter_protected_mode_and_jump_to_stage_3 ( STAGE_3_DST , & mut info) ;
148148
149- loop { }
149+ loop {
150+ hlt ( ) ;
151+ }
150152}
151153
152154fn load_file (
0 commit comments