examples/baremetal: make paddr == vaddr

Fix loading of the example baremetal kernel with the fixed ELF kernel
loader:
- Remove the "RAM" address space so virtual and physical address match.
- Remove the 0x200-byte padding now that entry point address is used.

BUG=b:234155022
TEST=Run baremetal as in tools/examples/baremetal/README.md

Change-Id: I61394cdf4bf71f91736da5a636b0088ecfe78c84
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691965
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Anton Romanov <romanton@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel Verkamp 2022-06-06 14:19:03 -07:00 committed by Chromeos LUCI
parent b4244d3952
commit bf7d3bd38f
2 changed files with 7 additions and 7 deletions

View file

@ -3,7 +3,6 @@ ENTRY(_start)
/* Crosvm will load our code into 0x200000 + paddr */
MEMORY {
VMA : ORIGIN = 0x00200000, LENGTH = 0x200000
RAM : ORIGIN = 0x00000000, LENGTH = 0x200000
}
SECTIONS {
@ -13,7 +12,7 @@ SECTIONS {
{
_stack_end = . ;
*(.boot)
}> VMA AT>RAM
}> VMA
.kernel :
{
@ -22,7 +21,7 @@ SECTIONS {
*(.rodata .rodata.*)
*(.data .data.*)
*(.bss .bss.*)
}> VMA AT>RAM
}> VMA
DISCARD/ :
{

View file

@ -1,12 +1,13 @@
/* Copyright 2022 The ChromiumOS Authors.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
.section .boot, "awx"
.global _start
.code64
# crosvm starts execution at 0x200 offset from the beginning
.fill 0x200
_start:
lea rsp, _stack_end
jmp main