Skip to content

Commit 27654ed

Browse files
openkal 0.23.0; openkal-linux 0.24.0, openkal-macos 0.21.0, openkal-windows 0.19.0, openkal-emscripten 0.12.0
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent a3105cd commit 27654ed

8 files changed

Lines changed: 159 additions & 6 deletions

File tree

‎CHANGELOG.md‎

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

1616
### Added
1717

18+
- **openkal 0.23.0;openkal-linux 0.24.0、openkal-macos 0.21.0、openkal-windows 0.19.0、openkal-emscripten 0.12.0。**
19+
映像在其基址上放置(`kal_exec_alloc_at`、placement note);exec 区域返回时为零,可封存(`kal_exec_seal_part`)、预取、私有映射
20+
文件的部分(`KAL_EXEC_MAP_WRITE`);按名字解析全部链接(`kal_fs_resolved_name`)与带属性的列举;目录授予的衰减(只读、不变、
21+
记录)与系统隔离(`KAL_SPAWN_CONFINE`);缺页、故障报告、采样与触页记录;资源偏好(`kal_env_resources`、
22+
`KAL_SPAWN_RESOURCES_*`)与可用内存(`kal_memory_info`)。测试成员 `openkal` 随之移动,并观察基址上的区域、只读衰减、内存与
23+
资源偏好。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像,sha256 两处一致。
1824
- **openkal-ld/run/tools/bind 0.3.2。** 在 openkal 0.22 的实现上构建(openkal-linux 0.23.0、openkal-macos 0.20.0、openkal-windows
1925
0.18.0):映像启动程序时可以在位置上得到系统的空设备(`KAL_SPAWN_NULL_*`),自身无改动。测试成员 `openkal-tools`、
2026
`openkal-bind` 随之移动。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像,sha256 两处一致。

‎pkgs/o/openkal-emscripten.lua‎

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

4747
xpm = {
4848
linux = {
49+
["0.12.0"] = {
50+
url = {
51+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",
52+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.12.0/openkal-emscripten-0.12.0.tar.gz",
53+
},
54+
sha256 = "95e62daa863ad194c041a75fe2a3adbf159f90dcc57386905ba66b14e059baaa",
55+
},
4956
["0.11.0"] = {
5057
url = {
5158
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.11.0.tar.gz",
@@ -139,6 +146,13 @@ package = {
139146
},
140147
},
141148
macosx = {
149+
["0.12.0"] = {
150+
url = {
151+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",
152+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.12.0/openkal-emscripten-0.12.0.tar.gz",
153+
},
154+
sha256 = "95e62daa863ad194c041a75fe2a3adbf159f90dcc57386905ba66b14e059baaa",
155+
},
142156
["0.11.0"] = {
143157
url = {
144158
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.11.0.tar.gz",
@@ -232,6 +246,13 @@ package = {
232246
},
233247
},
234248
windows = {
249+
["0.12.0"] = {
250+
url = {
251+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.12.0.tar.gz",
252+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.12.0/openkal-emscripten-0.12.0.tar.gz",
253+
},
254+
sha256 = "95e62daa863ad194c041a75fe2a3adbf159f90dcc57386905ba66b14e059baaa",
255+
},
235256
["0.11.0"] = {
236257
url = {
237258
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.11.0.tar.gz",

‎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.24.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.24.0/openkal-linux-0.24.0.tar.gz",
26+
},
27+
sha256 = "af872024a9c861d71a86ee08b75b9b924b0632e9e5ad322cc7a3f44903bbcfcf",
28+
},
2229
["0.23.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.23.0.tar.gz",
@@ -217,6 +224,13 @@ package = {
217224
},
218225
},
219226
macosx = {
227+
["0.24.0"] = {
228+
url = {
229+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.0.tar.gz",
230+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.24.0/openkal-linux-0.24.0.tar.gz",
231+
},
232+
sha256 = "af872024a9c861d71a86ee08b75b9b924b0632e9e5ad322cc7a3f44903bbcfcf",
233+
},
220234
["0.23.0"] = {
221235
url = {
222236
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.23.0.tar.gz",
@@ -415,6 +429,13 @@ package = {
415429
},
416430
},
417431
windows = {
432+
["0.24.0"] = {
433+
url = {
434+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.24.0.tar.gz",
435+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.24.0/openkal-linux-0.24.0.tar.gz",
436+
},
437+
sha256 = "af872024a9c861d71a86ee08b75b9b924b0632e9e5ad322cc7a3f44903bbcfcf",
438+
},
418439
["0.23.0"] = {
419440
url = {
420441
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.23.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.21.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.21.0/openkal-macos-0.21.0.tar.gz",
26+
},
27+
sha256 = "f0b372d98852ce287d97c6fd380cfa543c01682897193f1b7dbb2b4effc26491",
28+
},
2229
["0.20.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.20.0.tar.gz",
@@ -217,6 +224,13 @@ package = {
217224
},
218225
},
219226
macosx = {
227+
["0.21.0"] = {
228+
url = {
229+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.0.tar.gz",
230+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.21.0/openkal-macos-0.21.0.tar.gz",
231+
},
232+
sha256 = "f0b372d98852ce287d97c6fd380cfa543c01682897193f1b7dbb2b4effc26491",
233+
},
220234
["0.20.0"] = {
221235
url = {
222236
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.20.0.tar.gz",
@@ -415,6 +429,13 @@ package = {
415429
},
416430
},
417431
windows = {
432+
["0.21.0"] = {
433+
url = {
434+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.21.0.tar.gz",
435+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.21.0/openkal-macos-0.21.0.tar.gz",
436+
},
437+
sha256 = "f0b372d98852ce287d97c6fd380cfa543c01682897193f1b7dbb2b4effc26491",
438+
},
418439
["0.20.0"] = {
419440
url = {
420441
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.20.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.19.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.19.0/openkal-windows-0.19.0.tar.gz",
28+
},
29+
sha256 = "014f0032c79853b4d3037b53525d6c70a7f60f86964ca00a040546f5fbbec9ac",
30+
},
2431
["0.18.0"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.18.0.tar.gz",
@@ -240,6 +247,13 @@ package = {
240247
},
241248
},
242249
macosx = {
250+
["0.19.0"] = {
251+
url = {
252+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",
253+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.19.0/openkal-windows-0.19.0.tar.gz",
254+
},
255+
sha256 = "014f0032c79853b4d3037b53525d6c70a7f60f86964ca00a040546f5fbbec9ac",
256+
},
243257
["0.18.0"] = {
244258
url = {
245259
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.18.0.tar.gz",
@@ -459,6 +473,13 @@ package = {
459473
},
460474
},
461475
windows = {
476+
["0.19.0"] = {
477+
url = {
478+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.19.0.tar.gz",
479+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.19.0/openkal-windows-0.19.0.tar.gz",
480+
},
481+
sha256 = "014f0032c79853b4d3037b53525d6c70a7f60f86964ca00a040546f5fbbec9ac",
482+
},
462483
["0.18.0"] = {
463484
url = {
464485
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.18.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.23.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.23.0/openkal-0.23.0.tar.gz",
29+
},
30+
sha256 = "3c89b8c0bfc84089abd500e9247f3ead5d755a305fae237fde687ef286657eae",
31+
},
2532
["0.22.0"] = {
2633
url = {
2734
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.22.0.tar.gz",
@@ -178,6 +185,13 @@ package = {
178185
},
179186
},
180187
macosx = {
188+
["0.23.0"] = {
189+
url = {
190+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",
191+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.23.0/openkal-0.23.0.tar.gz",
192+
},
193+
sha256 = "3c89b8c0bfc84089abd500e9247f3ead5d755a305fae237fde687ef286657eae",
194+
},
181195
["0.22.0"] = {
182196
url = {
183197
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.22.0.tar.gz",
@@ -334,6 +348,13 @@ package = {
334348
},
335349
},
336350
windows = {
351+
["0.23.0"] = {
352+
url = {
353+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.23.0.tar.gz",
354+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.23.0/openkal-0.23.0.tar.gz",
355+
},
356+
sha256 = "3c89b8c0bfc84089abd500e9247f3ead5d755a305fae237fde687ef286657eae",
357+
},
337358
["0.22.0"] = {
338359
url = {
339360
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.22.0.tar.gz",

‎tests/examples/openkal/mcpp.toml‎

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

2020
[dependencies.mcpplibs]
21-
openkal = "0.22.0"
21+
openkal = "0.23.0"
2222

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

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

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

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

3535
[target.'cfg(arch = "wasm32")'.dependencies.mcpplibs]
36-
openkal-emscripten = "0.11.0"
36+
openkal-emscripten = "0.12.0"
3737

3838
[target.'cfg(arch = "riscv64")'.dependencies.mcpplibs]
3939
openkal-opensbi = "0.8.3"

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
// zero, and released; (0.21) where the implementation states it, part of an
1616
// executable region is a file's bytes, read from where the file holds them;
1717
// (0.22) the null device beside a stream at one position is refused, and is
18-
// refused as unsupported where the implementation does not state it.
18+
// refused as unsupported where the implementation does not state it; (0.23) a
19+
// region at an address, zero; a read-only attenuation; the machine's memory
20+
// and the resource preference.
1921
// The terminal is not observed here,
2022
// because a test run has none; the implementations observe it on a terminal
2123
// they make.
@@ -235,6 +237,46 @@ int main() {
235237
kal_fs_remove(root, "okt.x", 5);
236238
}
237239

240+
// 0.23: a region at an address, and a region zero when returned; a
241+
// directory attenuated read-only refuses a creation beneath it; the
242+
// machine's memory and this program's resource preference are told.
243+
if ((kal_interfaces() & KAL_IFACE_EXEC) && (kal_exec_props() & KAL_EXEC_PROP_PLACE)) {
244+
const kal_uintptr a = 65536;
245+
void* any = kal_exec_alloc(a);
246+
if (any) {
247+
kal_exec_free(any, a);
248+
auto* r = static_cast<unsigned char*>(kal_exec_alloc_at(any, a));
249+
check(r == any, "a region is reserved at the address asked for");
250+
check(r && r[0] == 0 && r[a - 1] == 0, "and is zero");
251+
if (r) {
252+
check(kal_exec_alloc_at(r, a) == nullptr, "an address already held is refused");
253+
kal_exec_free(r, a);
254+
}
255+
}
256+
}
257+
if (kal_fs_preopen_count() > 0 && kal_fs_preopen(0, &root, nullptr, 0, nullptr) == kal_ok
258+
&& (kal_fs_props(root) & KAL_FS_PROP_ATTENUATE)) {
259+
kal_dir_rights rights{};
260+
rights.self_size = sizeof rights;
261+
rights.flags = KAL_DIR_READ_ONLY;
262+
kal_dir ro{};
263+
check(kal_fs_dir_attenuate(root, &rights, &ro) == kal_ok, "a directory is attenuated read-only");
264+
kal_file f{};
265+
check(kal_fs_open(ro, "okt.ro", 6, KAL_OPEN_WRITE | KAL_OPEN_CREATE, &f) != kal_ok,
266+
"and a creation beneath it is refused");
267+
kal_fs_remove(root, "okt.ro", 6);
268+
kal_fs_close_dir(ro);
269+
}
270+
{
271+
kal_memory_status m{};
272+
m.self_size = sizeof m;
273+
check(kal_memory_info(&m) != kal_ok || !(m.present & KAL_MSTATUS_TOTAL) || m.total_bytes > 0,
274+
"the machine's memory is told where it is stated");
275+
const int pref = kal_env_resources();
276+
check(pref == KAL_RESOURCES_BALANCED || pref == KAL_RESOURCES_PERFORMANCE || pref == KAL_RESOURCES_ECONOMY,
277+
"and the resource preference is one of three");
278+
}
279+
238280
if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14);
239281
return failures == 0 ? 0 : 1;
240282
}

0 commit comments

Comments
 (0)