File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,5 @@ do_e820:
51
51
stc # "function unsupported" error exit
52
52
ret
53
53
54
+ . global mmap_ent
54
55
mmap_ent: .word 0
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
@@ -10,6 +10,7 @@ compile_error!("The bootloader crate must be compiled for the `x86_64-bootloader
10
10
extern crate rlibc;
11
11
12
12
use bootloader:: bootinfo:: { BootInfo , FrameRange } ;
13
+ use core:: arch:: asm;
13
14
use core:: { arch:: global_asm, convert:: TryInto , panic:: PanicInfo } ;
14
15
use core:: { mem, slice} ;
15
16
use fixedvec:: alloc_stack;
@@ -41,8 +42,8 @@ global_asm!(include_str!("video_mode/vga_320x200.s"));
41
42
global_asm ! ( include_str!( "video_mode/vga_text_80x25.s" ) ) ;
42
43
43
44
unsafe 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 ( ) ) ;
46
47
:: core:: hint:: unreachable_unchecked ( )
47
48
}
48
49
@@ -87,8 +88,12 @@ extern "C" {
87
88
#[ no_mangle]
88
89
pub unsafe extern "C" fn stage_4 ( ) -> ! {
89
90
// 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
+ ) ;
92
97
93
98
let kernel_start = 0x400000 ;
94
99
let kernel_size = & _kernel_size as * const _ as u64 ;
You can’t perform that action at this time.
0 commit comments