@@ -7,7 +7,7 @@ use crate::{
7
7
copy_to_protected_mode, enter_protected_mode_and_jump_to_stage_3, enter_unreal_mode,
8
8
} ,
9
9
} ;
10
- use bootloader_x86_64_bios_common:: { BiosFramebufferInfo , BiosInfo , Region } ;
10
+ use bootloader_x86_64_bios_common:: { hlt , BiosFramebufferInfo , BiosInfo , Region } ;
11
11
use byteorder:: { ByteOrder , LittleEndian } ;
12
12
use core:: { fmt:: Write as _, slice} ;
13
13
use disk:: AlignedArrayBuffer ;
@@ -50,12 +50,12 @@ fn start(disk_number: u16, partition_table_start: *const u8) -> ! {
50
50
51
51
let mut entries = [ PartitionTableEntry :: empty ( ) ; MAX_ENTRIES ] ;
52
52
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 ( ) {
54
54
let offset = idx * ENTRY_SIZE ;
55
55
let partition_type = PartitionType :: from_mbr_tag_byte ( raw[ offset + 4 ] ) ;
56
56
let lba = LittleEndian :: read_u32 ( & raw [ offset + 8 ..] ) ;
57
57
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) ;
59
59
}
60
60
entries
61
61
} ;
@@ -146,7 +146,9 @@ fn start(disk_number: u16, partition_table_start: *const u8) -> ! {
146
146
147
147
enter_protected_mode_and_jump_to_stage_3 ( STAGE_3_DST , & mut info) ;
148
148
149
- loop { }
149
+ loop {
150
+ hlt ( ) ;
151
+ }
150
152
}
151
153
152
154
fn load_file (
0 commit comments