File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( lang_items) ]
2
2
#![ feature( global_asm) ]
3
- #![ feature( llvm_asm ) ]
3
+ #![ feature( asm ) ]
4
4
#![ no_std]
5
5
#![ no_main]
6
6
@@ -42,8 +42,9 @@ global_asm!(include_str!("video_mode/vga_320x200.s"));
42
42
global_asm ! ( include_str!( "video_mode/vga_text_80x25.s" ) ) ;
43
43
44
44
unsafe fn context_switch ( boot_info : VirtAddr , entry_point : VirtAddr , stack_pointer : VirtAddr ) -> ! {
45
- llvm_asm ! ( "call $1; ${:private}.spin.${:uid}: jmp ${:private}.spin.${:uid}" ::
46
- "{rsp}" ( stack_pointer) , "r" ( entry_point) , "{rdi}" ( boot_info) :: "intel" ) ;
45
+ asm ! ( "movq {1}, %rsp; callq *{0}; 0: jmp 0b" ,
46
+ in( reg) entry_point. as_u64( ) , in( reg) stack_pointer. as_u64( ) , in( "rdi" ) boot_info. as_u64( ) ,
47
+ options( att_syntax) ) ;
47
48
:: core:: hint:: unreachable_unchecked ( )
48
49
}
49
50
@@ -88,8 +89,12 @@ extern "C" {
88
89
#[ no_mangle]
89
90
pub unsafe extern "C" fn stage_4 ( ) -> ! {
90
91
// Set stack segment
91
- llvm_asm ! ( "mov bx, 0x0
92
- mov ss, bx" :: : "bx" : "intel" ) ;
92
+ asm ! (
93
+ "push rbx
94
+ mov bx, 0x0
95
+ mov ss, bx
96
+ pop rbx"
97
+ ) ;
93
98
94
99
let kernel_start = 0x400000 ;
95
100
let kernel_size = & _kernel_size as * const _ as u64 ;
You can’t perform that action at this time.
0 commit comments