Skip to content

Commit 8a5b0da

Browse files
josephlrrbradford
authored andcommitted
ram64: Remove linux64_start
We now only support entrering the firmware though the PVH entry point Signed-off-by: Joe Richey <joerichey@google.com>
1 parent e586857 commit 8a5b0da

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

layout.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ENTRY(linux64_start)
1+
ENTRY(rust64_start) /* This firmware doesn't use the ELF entrypoint */
22

33
PHDRS
44
{

src/asm/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
global_asm!(include_str!("ram32.s"));
2-
global_asm!(include_str!("ram64.s"));

src/asm/ram32.s

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
ram32_start:
55
# Stash the PVH start_info struct in %rdi.
66
movl %ebx, %edi
7-
# Zero out %rsi, its value is unspecificed in the PVH Boot Protocol.
8-
xorl %esi, %esi
97

108
setup_page_tables:
119
# First L2 entry identity maps [0, 2 MiB)
@@ -42,5 +40,8 @@ jump_to_64bit:
4240
# We are now in 32-bit compatibility mode. To enter 64-bit mode, we need to
4341
# load a 64-bit code segment into our GDT.
4442
lgdtl GDT64_PTR
45-
# Set CS to a 64-bit segment and jump to 64-bit code.
46-
ljmpl $0x08, $ram64_start
43+
# Initialize the stack pointer (Rust code always uses the stack)
44+
movl $stack_start, %esp
45+
# Set CS to a 64-bit segment and jump to 64-bit Rust code.
46+
# PVH start_info is in %rdi, the first paramter of the System V ABI.
47+
ljmpl $0x08, $rust64_start

src/asm/ram64.s

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,13 @@ fn boot_from_device(device: &mut block::VirtioBlockDevice, info: &dyn boot::Info
139139
}
140140

141141
#[no_mangle]
142-
pub extern "C" fn rust64_start(rdi: Option<&pvh::StartInfo>, rsi: Option<&boot::Params>) -> ! {
142+
pub extern "C" fn rust64_start(rdi: Option<&pvh::StartInfo>) -> ! {
143143
serial::PORT.borrow_mut().init();
144144

145145
if let Some(start_info) = rdi {
146146
log!("\nBooting via PVH Boot Protocol");
147147
run(start_info)
148148
}
149-
if let Some(boot_params) = rsi {
150-
log!("\nBooting via Linux Boot Protocol");
151-
run(boot_params)
152-
}
153149
panic!("Unable to determine boot protocol")
154150
}
155151

0 commit comments

Comments
 (0)