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 PKGDIR ?= .. 2 L4DIR ?= $(PKGDIR)/../../.. 3 4 TARGET = exec_region_mapper 5 6 MODE = static 7 8 # Relocate the binary to avoid conflicting with actual payloads. 9 10 DEFAULT_RELOC_x86 := 0xb0000000 11 DEFAULT_RELOC_arm := 0xb0000000 12 DEFAULT_RELOC_arm64 := 0xc0000000 13 DEFAULT_RELOC_ppc32 := 0xb0000000 14 DEFAULT_RELOC_amd64 := 0x70000000 15 DEFAULT_RELOC_mips := 0x70000000 16 17 # Locations for interface input and generated output. 18 19 IDL_DIR = $(PKGDIR)/../libsystypes/idl 20 IDL_MK_DIR = $(L4DIR)/idl4re/mk 21 IDL_BUILD_DIR = . 22 IDL_EXPORT_DIR = . 23 24 include $(IDL_MK_DIR)/idl.mk 25 26 # Compound interfaces. 27 28 pager_object_NAME = PagerObject 29 pager_object_INTERFACES = region_mapper system_pager 30 31 COMP_INTERFACES_CC = pager_object 32 33 # Individual interfaces. 34 35 SERVER_INTERFACES_CC = $(call common_interfaces,$(COMP_INTERFACES_CC)) 36 37 # Generated and plain source files. 38 39 SERVER_INTERFACES_SRC_CC = $(call interfaces_to_server_cc,$(SERVER_INTERFACES_CC) $(COMP_INTERFACES_CC)) 40 41 # Normal source files. 42 43 PLAIN_SRC_CC = region_mapper.cc 44 SRC_CC = $(PLAIN_SRC_CC) $(SERVER_INTERFACES_SRC_CC) 45 46 REQUIRES_LIBS = libc libstdc++ libexec libipc 47 PRIVATE_INCDIR = $(IDL_BUILD_DIR) $(IDL_EXPORT_DIR) 48 49 include $(L4DIR)/mk/prog.mk 50 include $(IDL_MK_DIR)/interface_rules.mk 51 52 $(PLAIN_SRC_CC): $(SERVER_INTERFACES_SRC_CC)