2022-06-17 | Paul Boddie | raw annotate files changeset graph | Introduced a region mapper thread alongside the actual program to be run in a new task, with the region mapper being moved from the test files into libexec. The region mapper needs to reside in a different area of memory, with a special Makefile definition being employed to indicate this. Various adjustments to the task and thread initialisation mechanisms were required, along with fixes to the program regions provided to the region mapper thread (these having been erroneously specified using the region mapper's own segments). A more flexible method of allocating capability slots to the threads in the new task was introduced, and the mapped IPC gate capability (used by the region mapper to provide its service to the program) also needed a special control right, necessitating the expansion of the mapped capability structure. For performance, more pages are allocated to the ext2 filesystem server. One troublesome issue arose with regard to the first free capability setting and possible capability slot conflicts, necessitating a special adjustment of this setting so that the region mapper and actual program may start without the apparent loss of capabilities, this having been seen to affect the external pager. | mmap-region-flags |
1 -- vim:set ft=lua: 2 3 local L4 = require("L4"); 4 5 local l = L4.default_loader; 6 7 local pipe_server = l:new_channel(); 8 9 l:startv({ 10 caps = { 11 server = pipe_server:svr(), 12 }, 13 log = { "pipes", "r" }, 14 }, 15 "rom/dstest_pipe_server", "10"); 16 17 local block_server = l:new_channel(); 18 19 l:startv({ 20 caps = { 21 server = block_server:svr(), 22 }, 23 log = { "blocksvr", "r" }, 24 }, 25 "rom/dstest_block_server", "10"); 26 27 local ext2svr = l:new_channel(); 28 29 l:startv({ 30 caps = { 31 blocksvr = block_server, 32 pipes = pipe_server, 33 ext2svr = ext2svr:svr(), 34 }, 35 log = { "ext2svr", "y" }, 36 }, 37 "rom/dstest_ext2_server", "blocksvr", "rom/e2test.fs", "20", "ext2svr"); 38 39 -- Obtain user filesystems with umask 0022 (18). 40 41 local open_for_user = 6; 42 local ext2svr_paulb = L4.cast(L4.Proto.Factory, ext2svr):create(open_for_user, 1000, 1000, 18); 43 44 l:startv({ 45 caps = { 46 server = ext2svr_paulb, 47 }, 48 log = { "client", "g" }, 49 }, 50 "rom/dstest_exec", "home/paulb/exec_region_mapper", "home/paulb/dstest_exec_payload", "hello", "world");