summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
commit8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch)
treeefdc32587159d0050a69009bdf2330a531727d95 /meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
parentd412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff)
downloadpoky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz
The poky repository master branch is no longer being updated.
You can either: a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs b) use the new bitbake-setup You can find information about either approach in our documentation: https://docs.yoctoproject.org/ Note that "poky" the distro setting is still available in meta-yocto as before and we continue to use and maintain that. Long live Poky! Some further information on the background of this change can be found in: https://lists.openembedded.org/g/openembedded-architecture/message/2179 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb')
-rw-r--r--meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb69
1 files changed, 0 insertions, 69 deletions
diff --git a/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb b/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
deleted file mode 100644
index 4307716069..0000000000
--- a/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
+++ /dev/null
@@ -1,69 +0,0 @@
1SUMMARY = "Baremetal examples to work with the several QEMU architectures supported on OpenEmbedded"
2HOMEPAGE = "https://github.com/aehs29/baremetal-helloqemu"
3DESCRIPTION = "These are introductory examples to showcase the use of QEMU to run baremetal applications."
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
6
7SRCREV = "db2bf750eaef7fc0832e13ada8291343bbcc3afe"
8PV = "0.1+git"
9
10SRC_URI = "git://github.com/ahcbb6/baremetal-helloqemu.git;protocol=https;branch=master"
11UPSTREAM_CHECK_COMMITS = "1"
12
13# The following variables should be set to accomodate each application
14BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}"
15IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}"
16IMAGE_NAME_SUFFIX ?= ""
17
18# Baremetal-Image creates the proper wiring, assumes the output is provided in
19# binary and ELF format, installed on ${base_libdir}/firmware/ , we want a
20# package to be created since we might have some way of updating the baremetal
21# firmware from Linux
22inherit baremetal-image
23
24# startup code for x86 uses NASM syntax
25DEPENDS:qemux86:append = " nasm-native"
26
27# These parameters are app specific for this example
28# This will be translated automatically to the architecture and
29# machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
30# but the examples can also be run on other architectures/machines
31# such as vexpress-a15 by overriding the setting on the machine.conf
32COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32|qemux86|qemux86-64"
33
34BAREMETAL_QEMUARCH ?= ""
35BAREMETAL_QEMUARCH:qemuarmv5 = "versatile"
36BAREMETAL_QEMUARCH:qemuarm = "arm"
37BAREMETAL_QEMUARCH:qemuarm64 = "aarch64"
38BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64"
39BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32"
40BAREMETAL_QEMUARCH:qemux86 = "x86"
41BAREMETAL_QEMUARCH:qemux86-64 = "x86-64"
42
43EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
44
45# qemux86-64 uses a different Makefile
46do_compile:prepend:qemux86-64(){
47 cd x86-64
48}
49
50# Install binaries on the proper location for baremetal-image to fetch and deploy
51do_install(){
52 install -d ${D}/${base_libdir}/firmware
53 install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.bin ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin
54 install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.elf ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf
55}
56
57FILES:${PN} += " \
58 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \
59 ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \
60"
61
62# qemux86-64 boots from iso rather than -kernel, create image to boot from
63do_image:append:qemux86-64(){
64 dd if=/dev/zero of=${B}/build/img.iso bs=1M count=10 status=none
65 dd if=${B}/build/stage1.bin of=${B}/build/img.iso bs=512 count=1 conv=notrunc
66 dd if=${B}/build/stage2.bin of=${B}/build/img.iso bs=512 seek=1 count=64 conv=notrunc
67 dd if=${B}/build/hello_baremetal_x86-64.bin of=${B}/build/img.iso bs=512 seek=65 conv=notrunc
68 install ${B}/build/img.iso ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.iso
69}