Skip to content

Commit 7fcfe92

Browse files
committed
feat: openkal 的两个新后端 —— OpenSBI 与 UEFI
## openkal-opensbi 0.1.0 ⭐ **可移植的那个 RISC-V 后端。** 板级后端往设备地址写,而那个地址是板级事实; SBI 的控制台是对已经知道机器是什么的固件的一次调用,因此同一个镜像在 QEMU virt 的 OpenSBI 下与真实板子上都能跑。 实测:QEMU -bios default(真实 OpenSBI)下打印并经 SRST 关机。 ## openkal-uefi 0.1.0 ⚠️ **推翻了「受阻」的判断。** 先前的分析认为 UEFI 需要一个新的 PE 形态裸机目标。 实测不需要:`x86_64-windows-gnu` + 三个链接 flag 产出的正是 IMAGE_SUBSYSTEM_EFI_APPLICATION 且不依赖任何 DLL,而该目标默认就是 MS x64 调用约定。 实测:OVMF 下作为 EFI/BOOT/BOOTX64.EFI 启动,打印后 kal_exit 交还固件。 两者都只实现 core 三件(abort/stream/memory);缺席的 interface 是缺席而非部分实现。 五个 tarball 的 GitHub 与 GitCode 镜像逐字节一致。
1 parent cee6dd4 commit 7fcfe92

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

pkgs/o/openkal-opensbi.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- openkal-opensbi — openkal on the RISC-V Supervisor Binary Interface.
2+
--
3+
-- ⭐ The PORTABLE RISC-V backend, as distinct from a board's own. A board
4+
-- backend writes to a device address, and that address is a board fact: the
5+
-- same binary on a second RISC-V machine writes to something that is not a
6+
-- UART and prints nothing. SBI's console is a call into firmware that already
7+
-- knows the machine, so one image runs under OpenSBI on QEMU's `virt` and on a
8+
-- real board without being rebuilt.
9+
--
10+
-- ⚠️ NO `deps`. The only mcpp dependency is the specification package, declared
11+
-- in this package's own manifest; nothing needs installing.
12+
package = {
13+
spec = "1",
14+
namespace = "mcpplibs",
15+
name = "openkal-opensbi",
16+
description = "An implementation of openkal on the RISC-V Supervisor Binary Interface, portable across every machine whose firmware provides one",
17+
licenses = {"Apache-2.0"},
18+
repo = "https://github.com/mcpplibs/openkal-opensbi",
19+
type = "package",
20+
21+
xpm = {
22+
linux = {
23+
["0.1.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.1.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.1.0/openkal-opensbi-0.1.0.tar.gz",
27+
},
28+
sha256 = "6b5b81be59171f6f0d8e5d2e586a7f502479a2f309efb7fb1ab17c77a7579884",
29+
},
30+
},
31+
macosx = {
32+
["0.1.0"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.1.0.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.1.0/openkal-opensbi-0.1.0.tar.gz",
36+
},
37+
sha256 = "6b5b81be59171f6f0d8e5d2e586a7f502479a2f309efb7fb1ab17c77a7579884",
38+
},
39+
},
40+
windows = {
41+
["0.1.0"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/openkal-opensbi/archive/refs/tags/0.1.0.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/openkal-opensbi/releases/download/0.1.0/openkal-opensbi-0.1.0.tar.gz",
45+
},
46+
sha256 = "6b5b81be59171f6f0d8e5d2e586a7f502479a2f309efb7fb1ab17c77a7579884",
47+
},
48+
},
49+
},
50+
51+
-- The package's own manifest, inside the tarball's wrap directory.
52+
mcpp = "*/mcpp.toml",
53+
}

pkgs/o/openkal-uefi.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- openkal-uefi — openkal on UEFI Boot Services.
2+
--
3+
-- ⚠️ The consuming project targets `x86_64-windows-gnu` with three link flags
4+
-- (`-nostdlib`, `--subsystem,10`, `-e,efi_main`), which is not a workaround: a
5+
-- UEFI application IS PE/COFF with subsystem 10, entered through the Microsoft
6+
-- x64 calling convention, and that target already has both properties.
7+
--
8+
-- An earlier analysis held that a new "PE freestanding" target would be needed
9+
-- first. Measured otherwise — the flags above produce
10+
-- IMAGE_SUBSYSTEM_EFI_APPLICATION with no DLL imports, verified booting under
11+
-- OVMF.
12+
package = {
13+
spec = "1",
14+
namespace = "mcpplibs",
15+
name = "openkal-uefi",
16+
description = "An implementation of openkal on UEFI Boot Services, for applications the firmware loads before an operating system exists",
17+
licenses = {"Apache-2.0"},
18+
repo = "https://github.com/mcpplibs/openkal-uefi",
19+
type = "package",
20+
21+
xpm = {
22+
linux = {
23+
["0.1.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/openkal-uefi/archive/refs/tags/0.1.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/openkal-uefi/releases/download/0.1.0/openkal-uefi-0.1.0.tar.gz",
27+
},
28+
sha256 = "2b8a5035cd738e8b23d4ece7ea70cf6d2aba8c8b1150c613c8f1deb94092035a",
29+
},
30+
},
31+
macosx = {
32+
["0.1.0"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/openkal-uefi/archive/refs/tags/0.1.0.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/openkal-uefi/releases/download/0.1.0/openkal-uefi-0.1.0.tar.gz",
36+
},
37+
sha256 = "2b8a5035cd738e8b23d4ece7ea70cf6d2aba8c8b1150c613c8f1deb94092035a",
38+
},
39+
},
40+
windows = {
41+
["0.1.0"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/openkal-uefi/archive/refs/tags/0.1.0.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/openkal-uefi/releases/download/0.1.0/openkal-uefi-0.1.0.tar.gz",
45+
},
46+
sha256 = "2b8a5035cd738e8b23d4ece7ea70cf6d2aba8c8b1150c613c8f1deb94092035a",
47+
},
48+
},
49+
},
50+
51+
-- The package's own manifest, inside the tarball's wrap directory.
52+
mcpp = "*/mcpp.toml",
53+
}

0 commit comments

Comments
 (0)