QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Code segment size limit as displayed in "sin" and "sin mem" |
Ref. No. |
QNX.000007862 |
Category(ies) |
Utilities, Kernel |
Issue |
'sin mem' produces the following output:
PROGRAM PID sys/Proc32 1 0005 F0000000 122880 -B-3--------DC- 000D F0040000 268M -B-3--------D-- 10A9 00035000 28672 -B--+--G-----C- 0009 FF801000 29056 ---3---G-------
How does the size limit reflect the code and data segments from 'sin'?
|
Solution |
'sin mem' cannot be used to determine the current size of the code segment and how much of it is being.
Suppose a segment (5) had a base of 0x70000 and a length of 20k (0x5000):
segment 0x5: base 0x70000 {virtual addresses} { physical addresses} x09 -> [0x70000] -> <nowhere> -> [0x71000] -> 0x100000 -> [0x72000] -> <nowhere> -> [0x73000] -> 0x0ff000 -> [0x74000] -> 0x1f0000 lim 0x4fff
So, the segment has a SPAN of 20k, however only 3 of the 5 pages actually occupy memory, so it has a SIZE of 12k.
'Sin mem' shows the SPAN of the segments; 'sin' shows the SIZE of them.
Proc32 configures it's data segment to have a large SPAN which allows it to change page mappings and lookup page addresses without having to muck around with segments. It's data segment has a considerably smaller SIZE. |
|