File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments