Microkernel and process manager (QNX Neutrino)
procnto* [-a d|e|s] [-bl] [-c clockcycles_offset_max] [-d umask] [-F number] [-fa] [-fe] [-fl] [-h] [-H size] [-mmemmgr_configuration] [-n] [-P priority[s]] [-p] [-S bytes_after[,bytes_before]] [-s] [-T timeout] [-t] [-u umask] [-v]
QNX Neutrino
In QNX Neutrino 6.6 and later on ARMv7 processors, specifying this option allows misaligned accesses to be performed in hardware. On these targets, ThreadCtl(_NTO_TCTL_ALIGN_FAULT, ...) no longer changes the alignment-fault behavior on a per-thread basis.
For backwards compatibility, specify -b~l to handle these kinds of calls to procmgr_ability() as they were in pre-7.0.4 versions (the default).
In a future release, the -bl option will be the default behavior.
At startup, procnto samples ClockCycles() on each CPU, as simultaneously as possible. The kernel looks at the sample values and determines the maximum offset amongst them. This maximum offset, based on measured samples, may be changed to 0:
Max ClockCycles offset measured_maximum_offset greater than clockcycles_offset_max
To determine the current limit, use the ksh builtin command, ulimit, or call getrlimit() (see the QNX Neutrino C Library Reference).
The default is the lazy scheme.
The size parameter indicates the number of bytes to grow the heap in advance. You can postfix this value with a multiplier character, such as k (kilobyte) or m (megabyte). For example:
1m == 1024k == 0x100000
If the number is less than 1024 and it isn't postfixed by a multiplier character, it's assumed to be in kilobytes. The default value is 64 KB, and the minimum size permitted is 1 KB.
Assuming that you haven't explicitly allocated a lazy stack, specifying -n guarantees that page faults on stacks won't result in a SIGBUS if the system runs out of memory. When combined with -mL (superlocking), this option ensures that stack memory is prefaulted to the maximum size, which means that there shouldn't be any page faults for (legitimate) access to stack memory.
Range | Priorities |
---|---|
Idle thread | 0 |
Unprivileged | 1 through (priority − 1) |
Privileged | 1 through 255 |
In order to run at a priority above the unprivileged range, a process must have the PROCMGR_AID_PRIORITY ability enabled (see procmgr_ability() in the C Library Reference). The default value of priority is 64. If priority is less than 10, procnto uses a value of 10; if priority is greater than 256, it uses a value of 256.
(QNX Neutrino 6.6 or later) You can append an s or S to the priority if you want out-of-range priority requests by default to use the maximum allowed value (reach a maximum saturation point) instead of resulting in an error.
This option doesn't interfere with adaptive partitioning because preemption checks are independent of adaptive partitioning and are based strictly on priority.
If you specify the -s option, the kernel rejects any attempts to lock a PTHREAD_PRIO_INHERIT mutex whose owner isn't known to the kernel and that the locking thread claims is from a different process. In this case, pthread_mutex_lock() and SyncMutexLock() give an error of EINVAL.
When a process terminates, any outstanding connections are closed. This means that an _IO_CLOSE message is synthesized and sent to the resource manager responsible for that connection.
Because it is not guaranteed that the server will reply in a reasonable amount of time (e.g., a Qnet node may be down), a TimerTimeout() call before the send guarantees that the termination process will proceed.
The procnto system process contains the microkernel, process management, memory management and pathname management. It's required in all bootable images made using the mkifs utility. For more information, see the QNX Neutrino System Architecture guide.
There are different versions of procnto for different processors (see the Board Support Package for your board for specific information). The most common version is procnto-smp-instr, which runs on single- or multicore systems and is instrumented for system analysis. For more information, see the System Analysis Toolkit User's Guide and the Analyzing Performance chapter of the IDE User's Guide.
(QNX Neutrino 7.0.1 or later) If you're running a safety version of the kernel, the release level includes an uppercase S.
The kernel also manages named semaphores, which appear in the pathname space under /dev/sem. The sem_* client functions handle named semaphores; for more information, see the QNX Neutrino C Library Reference.
Memory configuration options
The memory configuration characters that you can specify with the -m option include the following:
The L option is a superset of the l option. You can combine them, but they're processed in the order that you specify them, resulting in different combinations of locking and superlocking:
Options | Locked? | Superlocked? |
---|---|---|
lL | Yes | Yes |
l~L | No | No |
~lL | Yes | Yes |
~l~L | No | No |
Ll | Yes | Yes |
L~l | Yesa | Yes |
~Ll | Yes | No |
~L~l | No | No |
a In QNX Neutrino 7.0.4 or later, you can't turn off locking if superlocking is in effect.
The default is not to use ASLR (~r).
A child process normally inherits its parent's ASLR setting. You can use the on command, the SPAWN_ASLR_INVERT flag for spawn(), or the POSIX_SPAWN_ASLR_INVERT extended flag for posix_spawn() to change this setting for a new process.
The /proc filesystem
The Process Manager component of procnto implements a /proc filesystem that includes the following:
# cat /proc/config align_fault:off fd_close_timeout:30 fpustate:c ker_verbose:1 maxfds:1000 nohalt:0 nonlazy_stack:1 nopreempt:0 pregrow_size:65536 priv_prio.prio:64 priv_prio.saturate:0 procfs_ctl_umask:022 procfs_umask:066 shutdown_stack_len:128/0 safe_shared_mutexes:1 thread_timer_prealloc:1 proc_thread_pool:3,10,75 thread_stack_prot:NOEXEC mm_cleanup_prio:10 mmflags:0x19 (BACKWARDS_COMPAT,LOCKALL,SUPERLOCKALL)
The settings correspond to the command-line options as follows:
Field | Option | Description |
---|---|---|
align_fault | -ad, -ae, -as | Indicates whether unaligned accesses cause a fault; off or on. Disabling unaligned access emulation with the command-line option enables the generation of a fault on an unaligned access. |
fd_close_timeout | -T | The time, in seconds, to wait for a close() to succeed in the event of a process termination |
fpustate | -f* | Floating-point flags; see below |
ker_verbose | -v | The verbosity level |
maxfds | -F | The maximum number of file descriptors that can be open at the same time |
nohalt | -h, -~h | Whether or not CPU halting is disabled in the idle thread; 0 or 1 |
nonlazy_stack | -n | (QNX Neutrino 7.0.4 or later) Whether or not nonlazy stack allocation is being used; 0 or 1 |
nopreempt | -p | Whether or not kernel preemption is disabled; 0 or 1 |
pregrow_size | -H | The initial heap size for procnto, in bytes |
priv_prio.prio | -P | The lower end of the range of privileged priorities |
priv_prio.saturate | -P | Whether or not out-of-range priority requests use the maximum allowed value (reach a maximum saturation point) instead of resulting in an error |
procfs_ctl_umask | -d | The file-creation mask, in octal, used for the /proc/pid/ctl entries |
procfs_umask | -u | The file-creation mask, in octal, used for the /proc/pid/as entries |
shutdown_stack_len | -S | The number of bytes after and before the stack pointer to include in a kernel dump |
safe_shared_mutexes | -s | Whether or not the kernel rejects any attempts to lock priority-impacting mutexes whose owner isn't known to the kernel and that the locking thread claims is from a different process; 0 or 1 |
thread_timer_prealloc | -t | Whether the kernel allocates a thread's software timer when the thread is created (1), or the first time the timer is needed (0) |
proc_thread_pool | None; see the PROC_THREAD_POOL environment variable | The configuration of procnto's thread pool, including the low-water mark, high-water mark, and maximum number of threads |
thread_stack_prot | -mx, -m~x | Whether or not the PROT_EXEC flag is enabled for system-allocated threads; EXEC or NOEXEC |
The fpustate field indicates which FPU flags are set. These include the following:
Bit | Option | Description |
---|---|---|
0x1 | — | The CPU_FLAG_FPU bit isn't set on at least one core (i.e., at least one core has no floating-point unit) |
0x2 | -fe, -~fe | Floating-point emulation is active, either because -fe was given, or because the device has no FPU |
0x4 | -fl, -~fl | The lazy FPU context switch policy is enabled |
0x8 | -fa, -~fa | An FPU context structure is preallocated for every new thread |
The mmflags field indicates which memory-management flags are set. You can use the -m command-line option to set some. The flags include the following:
Flag | Option | Description |
---|---|---|
BACKWARDS_COMPAT | -mb | Backward compatibility is enabled |
CACHEOP_NOCACHE | None | Because of a specific chip erratum, cache operations can't be done on non-cacheable memory |
LOCKALL | -ml, -mL | All memory is locked |
RANDOMIZE | -mr | Address space layout randomization (ASLR) is being used |
REQUIRE_EXEC | -mX | Any attempts by mmap() or mprotect() to turn on PROT_EXEC for a memory-mapped file mapping fail if the file doesn't have execute permission for the client process |
SHMEM_GUARD | -mg | Add a guard page before any shared memory allocations |
SUPERLOCKALL | -mL | All memory is superlocked |
To disable preemption in kernel code:
procnto-smp-instr -p