Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 PageTable Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
PageTableIf you intend to use paging, a Locate PageTable command must be present in the configuration file. RTLoc will create a page table that will subsequently be used by the boot code when the program is run. A page table is required for RAM remapping, virtual regions, and page-level protection. RTLoc will determine the size of the page table automatically. However, it can arrive at an incorrect value if the FillRAM command has been used or the configuration uses virtual regions. FillRAM or virtual regions can actually extend the available virtual address space, making a larger page table necessary. In this case, RTLoc issues an error message. The problem is fixed by explicitly specifying Locate's Size parameter. The required size is calculated as follows: Page Table Size = 4k * (1 + Number of 4M regions touched) Consider the address space to be divided into divisions of 4 megabytes each. The first division covers addresses in the range 0 to 4M - 1, the second addresses 4M to 8M - 1, etc. The whole 32-bit address space has 1024 such divisions. Each division overlapped by any region (physical or virtual) defined in the configuration file contributes to the number of 4M regions touched in the formula given above. Example:Suppose you have a PC with 4M of RAM installed in the address range 0 to 4M - 1. The formula above will give: 4k * (1 + 1) = 8k This is the size of the page table calculated by RTLoc. However, if only a single page is appended to the last RAM region by a FillRAM command, the second 4M division of the linear address space is actually used. Thus, the correct page table size would be: 4k * (1 + 2) = 12k which must be specified in the Locate command. If you are not sure of the proper page table size for your system, RTLoc can calculate it for you. Do not specify any size in the Locate PageTable command and run RTLoc. If you get one or more Page table too small errors, just specify the required value given in the error message in the Locate PageTable command and run RTLoc again. The alignment for the page table must be 4k or larger. This is required by the 386 CPU. Parameter Name is ignored. If no page table is located, paging is disabled for the application. In this case, the following features of RTTarget-32 and the CPU are not available:
If the page table is placed in ROM, the following restrictions apply:
By default, RTLoc assigns access rights "System" to the page table for maximum security. With this setting, the application cannot accidentally corrupt the page table. However, it also means that the virtual memory manager must temporarily change the access rights when changes to the page table are required at run-time. For this reason, the virtual memory manager is faster when the page table is located with "ReadWrite" access rights. Example:Locate PageTable PageTable HighMem 0 4k ReadWrite
|