Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So continuing from the other side of this line...

File Descriptors

In the FLAT and PROTECTED builds, the file descriptors are maintained in a table internal to the OS.  In PROTECTED mode, this requires a system call to access the file descriptors.  In the KERNEL build mode, however, this system call overhead is wasteful.  Ideally, the file descriptor table would be moved out of the OS and into the process address space where it can be accessed directly.

Overlapped Address Spaces

Currently, the user-process virtual address space and the kernel-mode virtual address space do not overlapped.  This is an odd arrangement and forces the user address space into awkward regions.  This was done so that a single address environment can support both user- and kernel- mode operation.

More correctly, the user address space should include the entire virtual address space (other that regions that may have specific hardware functionality such as vector tables).  And the user address space should overlap the kernel address space.

Supporting such overlapping address spaces would require to changes to the currently MMU handling:

  1. First, on entry into a kernel mode system call, MMU mapping of the user address space must be disabled so that the kernel address space is accessible, and
  2. When pointer parameters are passed to the OS, these will be references to user space data.  The user-address space must be re-established prior to a accessing the user-space data passed with the system call.
  3. Care must be taken in general when interacting with any user-space resource, memory, callbacks, etc., to assure that the correct address environment is in place.  Many places now assume that that is true.

Libraries

Libraries. But not all of the symbols that might be exported from the base code map to system calls. Many of the NuttX facilities operate simply in user mode: Think of strlen(), printf(), rand(), etc. With this strict enforcement of address spaces, the only way that these addition functions can be called is if they are brought into the same address space as the program.

...

  • Differing pages sizes are possible, but use of 4KiB pages used (this is the smallest page size for the Cortex-A).
  • With a 4KiB page table, 256 page table entries (PTEs) are required to span the 1Mib region.

Advantages/Disavantages

...

Advantages. The most important benefits of the ARMv7-A page table are:

...

Code Block
    #define ARCH_STACK_NSECTS ARCH_PG2SECT(CONFIG_ARCH_STACK_NPAGES)

Context Switches

...

Then what happens on each context switch?

...