Squash commits for public release
This commit is contained in:
63
build/boot/arm64/prekernel/BUILD.gn
Normal file
63
build/boot/arm64/prekernel/BUILD.gn
Normal file
@@ -0,0 +1,63 @@
|
||||
prekernel_c_flags = [
|
||||
"-ffreestanding",
|
||||
"-Werror",
|
||||
"-Wno-address-of-packed-member",
|
||||
"-fno-builtin",
|
||||
"-mcpu=cortex-a53+nofp+nosimd+nocrypto+nocrc",
|
||||
"-fpie",
|
||||
]
|
||||
prekernel_asm_flags = [ "-mcpu=cortex-a53+nofp+nosimd+nocrypto+nocrc" ]
|
||||
prekernel_ld_flags = [ "-nostdlib" ]
|
||||
|
||||
if (kernel_symbols) {
|
||||
prekernel_c_flags += [ "-ggdb" ]
|
||||
}
|
||||
|
||||
if (host == "gnu") {
|
||||
prekernel_ld_flags += [
|
||||
"-nostdinc",
|
||||
"-nodefaultlibs",
|
||||
"-nostartfiles",
|
||||
"-lgcc",
|
||||
]
|
||||
}
|
||||
|
||||
if (host == "llvm") {
|
||||
prekernel_ld_flags += [
|
||||
"--oformat",
|
||||
"binary",
|
||||
]
|
||||
}
|
||||
|
||||
config("prekernel_flags") {
|
||||
cflags = prekernel_c_flags
|
||||
asmflags = prekernel_asm_flags
|
||||
ldflags = prekernel_ld_flags
|
||||
defines = [ "xOS_prekernel" ]
|
||||
}
|
||||
|
||||
linker_script =
|
||||
rebase_path("//build/boot/$target_arch/prekernel/prekernel_link.ld",
|
||||
root_build_dir)
|
||||
|
||||
executable("prekernelarm64") {
|
||||
output_name = "prekernelarm64.bin"
|
||||
sources = [
|
||||
"//boot/arm64/prekernel/drivers/fb.c",
|
||||
"//boot/arm64/prekernel/drivers/uart.c",
|
||||
"//boot/arm64/prekernel/entry.S",
|
||||
"//boot/arm64/prekernel/main.c",
|
||||
"//boot/arm64/prekernel/vm.c",
|
||||
"//boot/libboot/devtree/devtree.c",
|
||||
"//boot/libboot/elf/elf_lite.c",
|
||||
"//boot/libboot/log/log.c",
|
||||
"//boot/libboot/mem/alloc.c",
|
||||
"//boot/libboot/mem/mem.c",
|
||||
]
|
||||
|
||||
include_dirs = [ "//boot" ]
|
||||
|
||||
configs = [ ":prekernel_flags" ]
|
||||
|
||||
ldflags = [ "-T$linker_script" ]
|
||||
}
|
||||
45
build/boot/arm64/prekernel/prekernel_link.ld
Normal file
45
build/boot/arm64/prekernel/prekernel_link.ld
Normal file
@@ -0,0 +1,45 @@
|
||||
/* PIC */
|
||||
_pa_base = 0x0;
|
||||
|
||||
ENTRY(_pa_base)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = _pa_base;
|
||||
PREKERNEL_START_OFFSET = .;
|
||||
|
||||
.text :
|
||||
{
|
||||
*(.xos_boot_text)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
}
|
||||
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
}
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
.stack ALIGN(4K) :
|
||||
{
|
||||
PREKERNEL_STACK_BASE_OFFSET = .;
|
||||
. += 0x1000;
|
||||
PREKERNEL_STACK_TOP_OFFSET = .;
|
||||
}
|
||||
|
||||
PREKERNEL_END_OFFSET = .;
|
||||
}
|
||||
Reference in New Issue
Block a user