diff options
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.bb | 22 |
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 | |||
4 | LICENSE = "MIT" | 4 | LICENSE = "MIT" |
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" |
6 | 6 | ||
7 | SRCREV = "31b4e5a337018b4a00a7426b0e5ed83b81df30c7" | 7 | SRCREV = "22016ecbb9fb6c5f3a7a06698aea7ff8a701c166" |
8 | PV = "0.1+git${SRCPV}" | 8 | PV = "0.1+git${SRCPV}" |
9 | 9 | ||
10 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" | 10 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" |
@@ -23,12 +23,15 @@ IMAGE_NAME_SUFFIX ?= "" | |||
23 | inherit baremetal-image | 23 | inherit baremetal-image |
24 | 24 | ||
25 | 25 | ||
26 | # startup code for x86 uses NASM syntax | ||
27 | DEPENDS: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 |
31 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32" | 34 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32|qemux86|qemux86-64" |
32 | 35 | ||
33 | BAREMETAL_QEMUARCH ?= "" | 36 | BAREMETAL_QEMUARCH ?= "" |
34 | BAREMETAL_QEMUARCH:qemuarmv5 = "versatile" | 37 | BAREMETAL_QEMUARCH:qemuarmv5 = "versatile" |
@@ -36,9 +39,15 @@ BAREMETAL_QEMUARCH:qemuarm = "arm" | |||
36 | BAREMETAL_QEMUARCH:qemuarm64 = "aarch64" | 39 | BAREMETAL_QEMUARCH:qemuarm64 = "aarch64" |
37 | BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64" | 40 | BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64" |
38 | BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32" | 41 | BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32" |
42 | BAREMETAL_QEMUARCH:qemux86 = "x86" | ||
43 | BAREMETAL_QEMUARCH:qemux86-64 = "x86-64" | ||
39 | 44 | ||
40 | EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" | 45 | EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" |
41 | 46 | ||
47 | # qemux86-64 uses a different Makefile | ||
48 | do_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 |
44 | do_install(){ | 53 | do_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 | ||
65 | do_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 | } | ||