freebsd-dev/sys/conf
Alex Richardson febe2bd226 Set the LMA of the riscv kernel to the OpenSBI jump target by default
This allows us to boot FreeBSD RISCV on QEMU using the -kernel command line
options. When using that option, QEMU maps the kernel ELF file to the
addresses specified in the LMAs in the program headers.

Since version 4.2 QEMU ships with OpenSBI fw_jump by default so this allows
booting FreeBSD using the following command line:
qemu-system-riscv64 -bios default -kernel /.../boot/kernel/kernel -nographic -M virt

Without this change the -kernel option cannot be used since the LMAs start
at address zero and QEMU already maps a ROM to these low physical addresses.

For targets that require a different kernel LMA the make variable
KERNEL_LMA can be overwritten in the config file. For example, adding
`makeoptions	KERNEL_LMA=0xc0200000` will create an ELF file that will be
loaded at 0xc0200000.

Before:
There are 4 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x001000 0xffffffc000000000 0x0000000000000000 0x75e598 0x8be318 RWE 0x1000
  DYNAMIC        0x71fb20 0xffffffc00071eb20 0x000000000071eb20 0x000100 0x000100 RW  0x8
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x0
  NOTE           0x693400 0xffffffc000692400 0x0000000000692400 0x000024 0x000024 R   0x4

After:

There are 4 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x001000 0xffffffc000000000 0x0000000080200000 0x734198 0x893e18 RWE 0x1000
  DYNAMIC        0x6f7810 0xffffffc0006f6810 0x00000000808f6810 0x000100 0x000100 RW  0x8
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x0
  NOTE           0x66ca70 0xffffffc00066ba70 0x000000008086ba70 0x000024 0x000024 R   0x4

Reviewed By:	br, mhorne (earlier version)
Differential Revision: https://reviews.freebsd.org/D23436
2020-02-04 00:06:16 +00:00
..
config.mk config.mk: #define MAC as well 2020-01-29 22:40:13 +00:00
dtb.build.mk Introduce bsd.sysdir.mk to consolidate looking for the kernel. 2019-11-21 15:59:33 +00:00
dtb.mk Allow kernel config to specify DTS/DTSO to build, and out-of-tree support 2019-03-26 02:45:23 +00:00
files Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00
files.amd64 Move font.h generation to conf/files from conf/files.* 2020-02-02 08:27:26 +00:00
files.arm Move font.h generation to conf/files from conf/files.* 2020-02-02 08:27:26 +00:00
files.arm64 arm64: rockchip: Add RK3399 PWM driver 2020-01-16 21:25:13 +00:00
files.i386 Move font.h generation to conf/files from conf/files.* 2020-02-02 08:27:26 +00:00
files.mips [PowerPC] [MIPS] Implement 32-bit kernel emulation of atomic64 operations 2020-01-02 23:20:37 +00:00
files.powerpc Move font.h generation to conf/files from conf/files.* 2020-02-02 08:27:26 +00:00
files.riscv Add driver for Xilinx XDMA PCIe Bridge found in the U.S. Government 2020-01-29 16:52:12 +00:00
files.x86 Fix old-style build 2020-02-02 08:27:20 +00:00
kern.mk Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00
kern.opts.mk Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00
kern.post.mk make all is needed to generate .depend.* 2020-01-31 21:08:33 +00:00
kern.pre.mk Fix old-style build 2020-02-02 08:27:20 +00:00
kmod_syms_prefix.awk Add the infrastructure to support loading multiple versions of TCP 2017-06-08 20:41:28 +00:00
kmod_syms.awk
kmod.mk kmod build: start generating opt_global.h, include it 2020-01-29 18:50:55 +00:00
kmod.opts.mk Add a kmod.opts.mk. 2019-11-21 18:14:26 +00:00
ldscript.amd64 Tighten mapping protections on preloaded files on amd64. 2019-10-18 14:05:13 +00:00
ldscript.arm Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker 2019-12-29 18:17:12 +00:00
ldscript.arm64 Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker 2019-12-29 18:17:12 +00:00
ldscript.i386 Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.kmod.amd64 Add an ldscript for amd64 kernel modules. 2019-10-17 21:39:23 +00:00
ldscript.kmod.i386 Formalize the use of linker scripts for kernel modules. 2019-10-16 22:19:56 +00:00
ldscript.mips Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.mips.cfe Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.mips.mips64 Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.mips.octeon1 Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.powerpc powerpc: Kernel fixes for ppc32 and powerpcspe w/ lld 2019-11-14 04:34:17 +00:00
ldscript.powerpc64 Expose the kernel's build-ID through sysctl 2019-06-04 13:07:10 +00:00
ldscript.powerpcspe powerpc: Kernel fixes for ppc32 and powerpcspe w/ lld 2019-11-14 04:34:17 +00:00
ldscript.riscv Set the LMA of the riscv kernel to the OpenSBI jump target by default 2020-02-04 00:06:16 +00:00
Makefile.amd64 Retire CLANG_NO_IAS34 2018-11-01 23:11:47 +00:00
Makefile.arm Set a "kernbase" symbol in 32-bit arm locore.S and use it with ldscript.arm. 2019-12-30 23:20:46 +00:00
Makefile.arm64 Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker 2019-12-29 18:17:12 +00:00
Makefile.i386 Retire CLANG_NO_IAS34 2018-11-01 23:11:47 +00:00
Makefile.mips Compile hack.c with normal CFLAGS + -shared -nostdlib. 2020-01-26 14:19:08 +00:00
Makefile.powerpc Compile hack.c with normal CFLAGS + -shared -nostdlib. 2020-01-26 14:19:08 +00:00
Makefile.riscv Set the LMA of the riscv kernel to the OpenSBI jump target by default 2020-02-04 00:06:16 +00:00
makeLINT.mk Move arm back to having one LINT 2020-02-02 08:27:08 +00:00
makeLINT.sed
newvers.sh newvers: append commit count to uname version string 2019-08-01 14:13:04 +00:00
NOTES Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00
options Remove vpo.4 2020-02-02 04:53:27 +00:00
options.amd64 Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00
options.arm Kill old armv4 busdma 2020-02-02 08:27:14 +00:00
options.arm64 Dynamically select LSE-based atomic(9)s on arm64. 2020-02-03 18:23:50 +00:00
options.i386 i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
options.mips Add SMP support for BERI CPU. 2018-04-12 17:43:19 +00:00
options.powerpc powerpc: Add AmigaOne platform, a subclass of MPC85xx 2019-10-16 00:38:50 +00:00
options.riscv o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
sysent.mk sysent.mk: split interpreter out of target command 2020-01-21 05:01:11 +00:00
systags.sh Fix kernel-tags target. 2020-01-23 13:56:12 +00:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE Remove adv(4) and adw(4) 2018-10-22 02:34:47 +00:00