File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,5 @@ do_e820:
5151 stc # "function unsupported" error exit
5252 ret
5353
54+ . global mmap_ent
5455mmap_ent: .word 0
Original file line number Diff line number Diff line change 11#![ feature( lang_items) ]
22#![ feature( global_asm) ]
3- #![ feature( llvm_asm ) ]
3+ #![ feature( asm ) ]
44#![ no_std]
55#![ no_main]
66
@@ -10,6 +10,7 @@ compile_error!("The bootloader crate must be compiled for the `x86_64-bootloader
1010extern crate rlibc;
1111
1212use bootloader:: bootinfo:: { BootInfo , FrameRange } ;
13+ use core:: arch:: asm;
1314use core:: { arch:: global_asm, convert:: TryInto , panic:: PanicInfo } ;
1415use core:: { mem, slice} ;
1516use fixedvec:: alloc_stack;
@@ -41,8 +42,8 @@ global_asm!(include_str!("video_mode/vga_320x200.s"));
4142global_asm ! ( include_str!( "video_mode/vga_text_80x25.s" ) ) ;
4243
4344unsafe fn context_switch ( boot_info : VirtAddr , entry_point : VirtAddr , stack_pointer : VirtAddr ) -> ! {
44- llvm_asm ! ( "call $1; ${:private}.spin.${:uid}: jmp ${:private}.spin.${:uid}" ::
45- "{rsp}" ( stack_pointer ) , "r" ( entry_point) , "{rdi}" ( boot_info ) :: "intel" ) ;
45+ asm ! ( "mov rsp, {1}; call {0}; 2: jmp 2b" ,
46+ in ( reg ) entry_point. as_u64 ( ) , in ( reg ) stack_pointer . as_u64 ( ) , in ( "rdi" ) boot_info . as_u64 ( ) ) ;
4647 :: core:: hint:: unreachable_unchecked ( )
4748}
4849
@@ -87,8 +88,12 @@ extern "C" {
8788#[ no_mangle]
8889pub unsafe extern "C" fn stage_4 ( ) -> ! {
8990 // Set stack segment
90- llvm_asm ! ( "mov bx, 0x0
91- mov ss, bx" :: : "bx" : "intel" ) ;
91+ asm ! (
92+ "push rbx
93+ mov bx, 0x0
94+ mov ss, bx
95+ pop rbx"
96+ ) ;
9297
9398 let kernel_start = 0x400000 ;
9499 let kernel_size = & _kernel_size as * const _ as u64 ;
You can’t perform that action at this time.
0 commit comments