Skip to content

Commit b0e805e

Browse files
committed
Revert "The second stage-4 argument is no longer needed"
It is of course needed for the call instruction. This reverts commit 48ced39.
1 parent e62a933 commit b0e805e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bios/stage-3/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ pub fn enter_long_mode_and_jump_to_stage_4(info: &mut BiosInfo) {
3737
// push arguments (extended to 64 bit)
3838
"push 0",
3939
"push {info:e}",
40+
// push entry point address (extended to 64 bit)
41+
"push 0",
42+
"push {entry_point:e}",
4043
info = in(reg) info as *const _ as u32,
44+
entry_point = in(reg) info.stage_4.start as u32,
4145
);
4246
asm!("ljmp $0x8, $2f", "2:", options(att_syntax));
4347
asm!(
@@ -50,13 +54,15 @@ pub fn enter_long_mode_and_jump_to_stage_4(info: &mut BiosInfo) {
5054
"mov ss, {0}",
5155

5256
// jump to 4th stage
57+
"pop rax",
5358
"pop rdi",
5459
"call rax",
5560

5661
// enter endless loop in case 4th stage returns
5762
"2:",
5863
"jmp 2b",
5964
out(reg) _,
65+
out("rax") _,
6066
out("rdi") _,
6167
);
6268
}

0 commit comments

Comments
 (0)