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:
1111 # Setup the stack (at the end of our RAM region)
1212 movq $ram_max, %rsp
1313
14+ # BootParams are in %rsi, the second paramter of the System V ABI.
1415 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 {
153153 true
154154}
155155
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 ) -> ! {
159166 enable_sse ( ) ;
160167 paging:: setup ( ) ;
161168
You can’t perform that action at this time.
0 commit comments