summaryrefslogtreecommitdiffstats
path: root/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb')
-rw-r--r--meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb22
1 files changed, 20 insertions, 2 deletions
diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
index d11e2e530e..fede17b0f0 100644
--- a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
+++ b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
@@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to showcase the use of QEMU to ru
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" 5LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
6 6
7SRCREV = "31b4e5a337018b4a00a7426b0e5ed83b81df30c7" 7SRCREV = "22016ecbb9fb6c5f3a7a06698aea7ff8a701c166"
8PV = "0.1+git${SRCPV}" 8PV = "0.1+git${SRCPV}"
9 9
10SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" 10SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
@@ -23,12 +23,15 @@ IMAGE_NAME_SUFFIX ?= ""
23inherit baremetal-image 23inherit baremetal-image
24 24
25 25
26# startup code for x86 uses NASM syntax
27DEPENDS:qemux86:append = " nasm-native"
28
26# These parameters are app specific for this example 29# These parameters are app specific for this example
27# This will be translated automatically to the architecture and 30# This will be translated automatically to the architecture and
28# machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57 31# machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
29# but the examples can also be run on other architectures/machines 32# but the examples can also be run on other architectures/machines
30# such as vexpress-a15 by overriding the setting on the machine.conf 33# such as vexpress-a15 by overriding the setting on the machine.conf
31COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32" 34COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32|qemux86|qemux86-64"
32 35
33BAREMETAL_QEMUARCH ?= "" 36BAREMETAL_QEMUARCH ?= ""
34BAREMETAL_QEMUARCH:qemuarmv5 = "versatile" 37BAREMETAL_QEMUARCH:qemuarmv5 = "versatile"
@@ -36,9 +39,15 @@ BAREMETAL_QEMUARCH:qemuarm = "arm"
36BAREMETAL_QEMUARCH:qemuarm64 = "aarch64" 39BAREMETAL_QEMUARCH:qemuarm64 = "aarch64"
37BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64" 40BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64"
38BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32" 41BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32"
42BAREMETAL_QEMUARCH:qemux86 = "x86"
43BAREMETAL_QEMUARCH:qemux86-64 = "x86-64"
39 44
40EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" 45EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
41 46
47# qemux86-64 uses a different Makefile
48do_compile:prepend:qemux86-64(){
49 cd x86-64
50}
42 51
43# Install binaries on the proper location for baremetal-image to fetch and deploy 52# Install binaries on the proper location for baremetal-image to fetch and deploy
44do_install(){ 53do_install(){
@@ -51,3 +60,12 @@ FILES:${PN} += " \
51 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \ 60 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \
52 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \ 61 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \
53" 62"
63
64# qemux86-64 boots from iso rather than -kernel, create image to boot from
65do_image:append:qemux86-64(){
66 dd if=/dev/zero of=${B}/build/img.iso bs=1M count=10 status=none
67 dd if=${B}/build/stage1.bin of=${B}/build/img.iso bs=512 count=1 conv=notrunc
68 dd if=${B}/build/stage2.bin of=${B}/build/img.iso bs=512 seek=1 count=64 conv=notrunc
69 dd if=${B}/build/hello_baremetal_x86-64.bin of=${B}/build/img.iso bs=512 seek=65 conv=notrunc
70 install ${B}/build/img.iso ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.iso
71}