Skip to content

Commit 732a667

Browse files
openkal 0.21.0; openkal-linux 0.22.0, openkal-macos 0.19.0, openkal-windows 0.17.0 (#662)
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 3a6e15d commit 732a667

7 files changed

Lines changed: 116 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
### Added
1717

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

‎pkgs/o/openkal-linux.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.22.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
26+
},
27+
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
28+
},
2229
["0.21.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",
@@ -203,6 +210,13 @@ package = {
203210
},
204211
},
205212
macosx = {
213+
["0.22.0"] = {
214+
url = {
215+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
216+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
217+
},
218+
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
219+
},
206220
["0.21.0"] = {
207221
url = {
208222
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",
@@ -387,6 +401,13 @@ package = {
387401
},
388402
},
389403
windows = {
404+
["0.22.0"] = {
405+
url = {
406+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.22.0.tar.gz",
407+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.22.0/openkal-linux-0.22.0.tar.gz",
408+
},
409+
sha256 = "f1b21de93a77a16ab5077a45d5d3c315b8e423529ee16e7117dbf578a23c4f31",
410+
},
390411
["0.21.0"] = {
391412
url = {
392413
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.21.0.tar.gz",

‎pkgs/o/openkal-macos.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.19.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
26+
},
27+
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
28+
},
2229
["0.18.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",
@@ -203,6 +210,13 @@ package = {
203210
},
204211
},
205212
macosx = {
213+
["0.19.0"] = {
214+
url = {
215+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
216+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
217+
},
218+
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
219+
},
206220
["0.18.0"] = {
207221
url = {
208222
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",
@@ -387,6 +401,13 @@ package = {
387401
},
388402
},
389403
windows = {
404+
["0.19.0"] = {
405+
url = {
406+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.19.0.tar.gz",
407+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.19.0/openkal-macos-0.19.0.tar.gz",
408+
},
409+
sha256 = "1cec7ae1ea5a8181c1b5fe9ed400a79fe096d503caff11290cb21b1673a5fe2a",
410+
},
390411
["0.18.0"] = {
391412
url = {
392413
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.18.0.tar.gz",

‎pkgs/o/openkal-windows.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.17.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
28+
},
29+
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
30+
},
2431
["0.16.0"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",
@@ -226,6 +233,13 @@ package = {
226233
},
227234
},
228235
macosx = {
236+
["0.17.0"] = {
237+
url = {
238+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
239+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
240+
},
241+
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
242+
},
229243
["0.16.0"] = {
230244
url = {
231245
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",
@@ -431,6 +445,13 @@ package = {
431445
},
432446
},
433447
windows = {
448+
["0.17.0"] = {
449+
url = {
450+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.17.0.tar.gz",
451+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.17.0/openkal-windows-0.17.0.tar.gz",
452+
},
453+
sha256 = "422c79cc05094ec095af76622d603cc97e024261592c8d07aac616e2adc8e8d7",
454+
},
434455
["0.16.0"] = {
435456
url = {
436457
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.16.0.tar.gz",

‎pkgs/o/openkal.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ package = {
2222

2323
xpm = {
2424
linux = {
25+
["0.21.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
29+
},
30+
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
31+
},
2532
["0.20.0"] = {
2633
url = {
2734
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",
@@ -164,6 +171,13 @@ package = {
164171
},
165172
},
166173
macosx = {
174+
["0.21.0"] = {
175+
url = {
176+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
177+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
178+
},
179+
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
180+
},
167181
["0.20.0"] = {
168182
url = {
169183
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",
@@ -306,6 +320,13 @@ package = {
306320
},
307321
},
308322
windows = {
323+
["0.21.0"] = {
324+
url = {
325+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.21.0.tar.gz",
326+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.21.0/openkal-0.21.0.tar.gz",
327+
},
328+
sha256 = "e0b2d3cc12a44983f0b77801531f1d80222e537a581eb4e5249a35774151d765",
329+
},
309330
["0.20.0"] = {
310331
url = {
311332
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.20.0.tar.gz",

‎tests/examples/openkal/mcpp.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ name = "openkal-tests"
1818
version = "0.1.0"
1919

2020
[dependencies.mcpplibs]
21-
openkal = "0.20.0"
21+
openkal = "0.21.0"
2222

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

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

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

3232
[target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs]
3333
openkal-llvm-runtime = "0.16.15"

‎tests/examples/openkal/tests/kal.cpp‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
// (0.20) a transfer at an offset neither uses nor moves the file's position,
1313
// this program is told the memory it occupies and its peak, and a region is
1414
// reserved, backed, written, its backing returned and backed again reading
15-
// zero, and released.
15+
// zero, and released; (0.21) where the implementation states it, part of an
16+
// executable region is a file's bytes, read from where the file holds them.
1617
// The terminal is not observed here,
1718
// because a test run has none; the implementations observe it on a terminal
1819
// they make.
1920
#include <openkal/env.h>
21+
#include <openkal/exec.h>
2022
#include <openkal/fs.h>
2123
#include <openkal/map.h>
2224
#include <openkal/memory.h>
@@ -187,6 +189,27 @@ int main() {
187189
}
188190
}
189191

192+
if ((kal_interfaces() & KAL_IFACE_EXEC) && (kal_exec_props() & KAL_EXEC_PROP_FILE)
193+
&& kal_fs_preopen_count() > 0 && kal_fs_preopen(0, &root, nullptr, 0, nullptr) == kal_ok) {
194+
const kal_uintptr a = 65536;
195+
kal_file f{};
196+
if (kal_fs_open(root, "okt.x", 5, KAL_OPEN_READ | KAL_OPEN_WRITE | KAL_OPEN_CREATE | KAL_OPEN_TRUNCATE, &f) == kal_ok) {
197+
static unsigned char block[65536];
198+
for (kal_uintptr i = 0; i < a; ++i) block[i] = static_cast<unsigned char>(i * 7 + 1);
199+
kal_stream_write(kal_fs_stream(f), block, a);
200+
auto* r = static_cast<unsigned char*>(kal_exec_alloc(a));
201+
check(r != nullptr && kal_exec_map_part(r, 0, a, f, 0, 0) == kal_ok,
202+
"part of an executable region is made a file's bytes");
203+
kal_fs_close_file(f);
204+
if (r) {
205+
check(r[0] == 1 && r[a - 1] == static_cast<unsigned char>((a - 1) * 7 + 1),
206+
"and holds them after the file's handle is closed");
207+
kal_exec_free(r, a);
208+
}
209+
}
210+
kal_fs_remove(root, "okt.x", 5);
211+
}
212+
190213
if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14);
191214
return failures == 0 ? 0 : 1;
192215
}

0 commit comments

Comments
 (0)