File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ ram64_start:
11
11
# Setup the stack (at the end of our RAM region)
12
12
movq $ram_max, %rsp
13
13
14
+ # BootParams are in %rsi, the second paramter of the System V ABI.
14
15
jmp rust64_start
Original file line number Diff line number Diff line change @@ -153,9 +153,16 @@ fn boot_from_device(device: &mut block::VirtioBlockDevice) -> bool {
153
153
true
154
154
}
155
155
156
- #[ cfg_attr( not( test) , no_mangle) ]
157
- pub extern "C" fn rust64_start ( ) -> ! {
158
- log ! ( "\n Starting.." ) ;
156
+ #[ no_mangle]
157
+ pub extern "C" fn rust64_start ( _rdi : * const ( ) , rsi : Option < & boot:: Params > ) -> ! {
158
+ if let Some ( boot_params) = rsi {
159
+ log ! ( "\n Booting via Linux Boot Protocol" ) ;
160
+ run ( boot_params)
161
+ }
162
+ panic ! ( "Unable to determine boot protocol" )
163
+ }
164
+
165
+ fn run ( info : & dyn boot:: Info ) -> ! {
159
166
enable_sse ( ) ;
160
167
paging:: setup ( ) ;
161
168
You can’t perform that action at this time.
0 commit comments