Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

### Added

- **openkal 0.21.0;openkal-linux 0.22.0、openkal-macos 0.19.0、openkal-windows 0.17.0。** `openkal.exec` 的
`kal_exec_map_part`:可执行区域的一部分由文件的字节构成(只读,或只读且可执行,属性 `KAL_EXEC_PROP_FILE`),加载器据此映射映像的
指令与只读数据;结束的程序的处理器时间在句柄释放前可读。openkal-linux 以 `CLONE_VM | CLONE_VFORK` 启动程序、`kal_alloc` 按需
切分;openkal-windows 不提供文件部分。测试成员 `openkal` 随之移动,并观察可执行区域的文件部分。
- **openkal-ld/run/tools/bind 0.2.0。** openkal 0.20 的一轮:运行器提供加载器接口 `openkal.prof` 与 `openkal.debug`,
`okrun --prof=`(`OKRUN_PROF`)度量一个映像的调用、计数器与阶段,`okprof`(openkal-tools)记录、汇总与比较报告;
`kal_debug_symbolize` 由映像文件的符号表给出地址的名字;okb 的准入按用户记住,同一文件的后续启动不再重读整个 okb。测试成员
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-linux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ package = {

xpm = {
linux = {
["0.22.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
},
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
},
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",
Expand Down Expand Up @@ -203,6 +210,13 @@ package = {
},
},
macosx = {
["0.22.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
},
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
},
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",
Expand Down Expand Up @@ -387,6 +401,13 @@ package = {
},
},
windows = {
["0.22.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
},
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
},
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-macos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ package = {

xpm = {
linux = {
["0.19.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
},
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
},
["0.18.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",
Expand Down Expand Up @@ -203,6 +210,13 @@ package = {
},
},
macosx = {
["0.19.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
},
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
},
["0.18.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",
Expand Down Expand Up @@ -387,6 +401,13 @@ package = {
},
},
windows = {
["0.19.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
},
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
},
["0.18.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal-windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ package = {

xpm = {
linux = {
["0.17.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
},
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
},
["0.16.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",
Expand Down Expand Up @@ -226,6 +233,13 @@ package = {
},
},
macosx = {
["0.17.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
},
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
},
["0.16.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",
Expand Down Expand Up @@ -431,6 +445,13 @@ package = {
},
},
windows = {
["0.17.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
},
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
},
["0.16.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",
Expand Down
21 changes: 21 additions & 0 deletions pkgs/o/openkal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ package = {

xpm = {
linux = {
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
},
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
},
["0.20.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",
Expand Down Expand Up @@ -164,6 +171,13 @@ package = {
},
},
macosx = {
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
},
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
},
["0.20.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",
Expand Down Expand Up @@ -306,6 +320,13 @@ package = {
},
},
windows = {
["0.21.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
},
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
},
["0.20.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",
Expand Down
8 changes: 4 additions & 4 deletions tests/examples/openkal/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ name = "openkal-tests"
version = "0.1.0"

[dependencies.mcpplibs]
openkal = "0.20.0"
openkal = "0.21.0"

[target.'cfg(os = "linux")'.dependencies.mcpplibs]
openkal-linux = "0.21.0"
openkal-linux = "0.22.0"

[target.'cfg(os = "macos")'.dependencies.mcpplibs]
openkal-macos = "0.18.0"
openkal-macos = "0.19.0"

[target.'cfg(windows)'.dependencies.mcpplibs]
openkal-windows = "0.16.0"
openkal-windows = "0.17.0"

[target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs]
openkal-llvm-runtime = "0.16.15"
Expand Down
25 changes: 24 additions & 1 deletion tests/examples/openkal/tests/kal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
// (0.20) a transfer at an offset neither uses nor moves the file's position,
// this program is told the memory it occupies and its peak, and a region is
// reserved, backed, written, its backing returned and backed again reading
// zero, and released.
// zero, and released; (0.21) where the implementation states it, part of an
// executable region is a file's bytes, read from where the file holds them.
// The terminal is not observed here,
// because a test run has none; the implementations observe it on a terminal
// they make.
#include <openkal/env.h>
#include <openkal/exec.h>
#include <openkal/fs.h>
#include <openkal/map.h>
#include <openkal/memory.h>
Expand Down Expand Up @@ -187,6 +189,27 @@ int main() {
}
}

if ((kal_interfaces() & KAL_IFACE_EXEC) && (kal_exec_props() & KAL_EXEC_PROP_FILE)
&& kal_fs_preopen_count() > 0 && kal_fs_preopen(0, &root, nullptr, 0, nullptr) == kal_ok) {
const kal_uintptr a = 65536;
kal_file f{};
if (kal_fs_open(root, "okt.x", 5, KAL_OPEN_READ | KAL_OPEN_WRITE | KAL_OPEN_CREATE | KAL_OPEN_TRUNCATE, &f) == kal_ok) {
static unsigned char block[65536];
for (kal_uintptr i = 0; i < a; ++i) block[i] = static_cast<unsigned char>(i * 7 + 1);
kal_stream_write(kal_fs_stream(f), block, a);
auto* r = static_cast<unsigned char*>(kal_exec_alloc(a));
check(r != nullptr && kal_exec_map_part(r, 0, a, f, 0, 0) == kal_ok,
"part of an executable region is made a file's bytes");
kal_fs_close_file(f);
if (r) {
check(r[0] == 1 && r[a - 1] == static_cast<unsigned char>((a - 1) * 7 + 1),
"and holds them after the file's handle is closed");
kal_exec_free(r, a);
}
}
kal_fs_remove(root, "okt.x", 5);
}

if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14);
return failures == 0 ? 0 : 1;
}
Loading