Skip to content

Commit 2550267

Browse files
committed
Let the compiler select the register for reloading ds etc
1 parent 48ced39 commit 2550267

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bios/stage-3/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ pub fn enter_long_mode_and_jump_to_stage_4(info: &mut BiosInfo) {
4444
".code64",
4545

4646
// reload segment registers
47-
"mov bx, 0x10",
48-
"mov ds, bx",
49-
"mov es, bx",
50-
"mov ss, bx",
47+
"mov {0}, 0x10",
48+
"mov ds, {0}",
49+
"mov es, {0}",
50+
"mov ss, {0}",
5151

5252
// jump to 4th stage
5353
"pop rdi",
@@ -56,6 +56,7 @@ pub fn enter_long_mode_and_jump_to_stage_4(info: &mut BiosInfo) {
5656
// enter endless loop in case 4th stage returns
5757
"2:",
5858
"jmp 2b",
59+
out(reg) _,
5960
out("rdi") _,
6061
);
6162
}

0 commit comments

Comments
 (0)