mirror of https://github.com/wolfSSL/wolfBoot.git
x86_fsp: add QEMU test app (ELF 64bit)
parent
ddd7fb1c4b
commit
84350a9e96
|
@ -0,0 +1,48 @@
|
||||||
|
ARCH=x86_64
|
||||||
|
TARGET=x86_fsp_qemu
|
||||||
|
WOLFBOOT_SMALL_STACK=0
|
||||||
|
SIGN=ECC384
|
||||||
|
HASH=SHA256
|
||||||
|
DEBUG=1
|
||||||
|
SPMATH=1
|
||||||
|
FORCE_32BIT=1
|
||||||
|
ENCRYPTION=0
|
||||||
|
WOLFBOOT_NO_PARTITIONS=1
|
||||||
|
|
||||||
|
|
||||||
|
# TPM Keystore options
|
||||||
|
#WOLFBOOT_TPM_KEYSTORE?=1
|
||||||
|
#WOLFBOOT_TPM_KEYSTORE_NV_BASE?=0x01800200
|
||||||
|
#WOLFBOOT_TPM_POLICY_NV_INDEX?=0x01800201
|
||||||
|
|
||||||
|
# 4gb - 8mb
|
||||||
|
WOLFBOOT_LOAD_BASE=0x2000000
|
||||||
|
WOLFBOOT_LOAD_ADDRESS=0x1000000
|
||||||
|
|
||||||
|
# required for keytools
|
||||||
|
WOLFBOOT_SECTOR_SIZE?=0x1000
|
||||||
|
WOLFBOOT_DATA_ADDRESS=0x1000000
|
||||||
|
|
||||||
|
FSP_M_BASE=0xffe30000
|
||||||
|
FSP_S_BASE=0xffed6000
|
||||||
|
FSP_T_BASE=0xfffe0000
|
||||||
|
FSP_S_LOAD_BASE=0x0FED5F00
|
||||||
|
WOLFBOOT_ORIGIN=0xfff80000
|
||||||
|
|
||||||
|
BOOTLOADER_PARTITION_SIZE=0xe0000
|
||||||
|
BIOS_REGION_SIZE=0x800000
|
||||||
|
MACHINE_OBJ=src/x86/qemu_fsp.o
|
||||||
|
FSP_T_BIN=./src/x86/fsp_t.bin
|
||||||
|
FSP_M_BIN=./src/x86/fsp_m.bin
|
||||||
|
FSP_S_BIN=./src/x86/fsp_s.bin
|
||||||
|
|
||||||
|
STAGE1_AUTH=1
|
||||||
|
64BIT=1
|
||||||
|
ELF=1
|
||||||
|
MULTIBOOT2=1
|
||||||
|
MEASURED_BOOT=1
|
||||||
|
MEASURED_PCR_A=0
|
||||||
|
WOLFBOOT_TPM_SEAL=1
|
||||||
|
WOLFBOOT_TPM_SEAL_KEY_ID=1
|
||||||
|
DISK_LOCK=1
|
||||||
|
WOLFBOOT_UNIVERSAL_KEYSTORE=1
|
|
@ -343,6 +343,12 @@ ifeq ($(TARGET),psoc6)
|
||||||
CFLAGS+=-DCY8C624ABZI_D44
|
CFLAGS+=-DCY8C624ABZI_D44
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGET),x86_fsp_qemu)
|
||||||
|
APP_OBJS:=app_$(TARGET).o ../hal/x86_uart.o ../src/x86/common.o ../src/string.o
|
||||||
|
LSCRIPT_TEMPLATE:=x86_fsp.ld
|
||||||
|
LDFLAGS=
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS+=-I../lib/wolfssl
|
CFLAGS+=-I../lib/wolfssl
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
/* app_x86_fsp_qemu.c
|
||||||
|
*
|
||||||
|
* Test bare-metal boot application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfBoot.
|
||||||
|
*
|
||||||
|
* wolfBoot is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfBoot is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef PLATFORM_x86_fsp_qemu
|
||||||
|
|
||||||
|
#include<printf.h>
|
||||||
|
#include<stdint.h>
|
||||||
|
|
||||||
|
struct mb2_header {
|
||||||
|
uint32_t magic;
|
||||||
|
uint32_t architecture;
|
||||||
|
uint32_t header_length;
|
||||||
|
uint32_t checksum;
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
|
struct mb2_tag_info_req {
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t flags;
|
||||||
|
uint32_t size;
|
||||||
|
uint32_t mbi_tag_types[2];
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
|
struct multiboot_header {
|
||||||
|
struct mb2_header hdr;
|
||||||
|
struct mb2_tag_info_req req;
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
|
__attribute__((aligned(8))) struct multiboot_header mbh = {
|
||||||
|
.hdr.magic = 0xe85250d6,
|
||||||
|
.hdr.architecture = 0,
|
||||||
|
.hdr.checksum = 0,
|
||||||
|
.hdr.header_length = sizeof(struct mb2_header),
|
||||||
|
.req.type = 1,
|
||||||
|
.req.flags = 0,
|
||||||
|
.req.size = sizeof(struct mb2_tag_info_req),
|
||||||
|
/* basic mem info */
|
||||||
|
.req.mbi_tag_types[0] = 4,
|
||||||
|
/* mem map */
|
||||||
|
.req.mbi_tag_types[1] = 6,
|
||||||
|
};
|
||||||
|
|
||||||
|
void start()
|
||||||
|
{
|
||||||
|
wolfBoot_printf("wolfBoot QEMU x86 FSP test app\r\n");
|
||||||
|
__asm__ ("hlt\r\n");
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,26 @@
|
||||||
|
OUTPUT_FORMAT(elf64-x86-64)
|
||||||
|
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
_start_text = .;
|
||||||
|
*(.text*)
|
||||||
|
_end_text = .;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
_start_data = .;
|
||||||
|
*(.data*)
|
||||||
|
_end_data = .;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
_start_bss = .;
|
||||||
|
*(.bss*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_end_bss = .;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue