free memory size?

The .freememk member of _osinfo structure has
unsigned short type. Thus qnx_osinfo() returns
incorrect value of free memory if its size is
more than 64M.
Is there another way to get free memory size?

Thanks,
Gen

Gennadiy Gladchun <gen@a-teleport.com> wrote:

: The .freememk member of _osinfo structure has
: unsigned short type. Thus qnx_osinfo() returns
: incorrect value of free memory if its size is
: more than 64M.
: Is there another way to get free memory size?

Use freepmem instead.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

Thanks. Just I use online help instead of books
and there is no word about .freememk member (and
many other which I see in osinfo.h) in it.

Gen

: The .freememk member of _osinfo structure has
: unsigned short type. Thus qnx_osinfo() returns
: incorrect value of free memory if its size is
: more than 64M.
: Is there another way to get free memory size?

Use freepmem instead.

Gennadiy Gladchun <gen@a-teleport.com> wrote:

: Thanks. Just I use online help instead of books
: and there is no word about .freememk member (and
: many other which I see in osinfo.h) in it.

The documentation for qnx_os_info() has been updated, but might not have
been released yet, so here’s the description of all the fields:

short unsigned cpu_speed
A PC is around 96.

short unsigned num_procs
Max number of processes.

short unsigned tick_size
Tick size, in microsecond units.

short unsigned version
Version number of QNX * 100.

short unsigned timesel
Segment in which the time is kept.

short unsigned totmemk
Use totpmem instead.

short unsigned freememk
Use freepmem instead.

char release
Release letter.

long sflags
System flags, as defined below.

long nodename
Logical node number of this cpu.

long cpu
Processor type 386, 486, 586, 686, …

long fpu
Floating-point unit 287, 387, 487. 587, 687.

char machine[16]
Machine name. Examples include EISA, PCI, PS/2, and ziatech.

char bootsrc
‘F’ - floppy ‘H’ - hard disk ‘N’ - network

short unsigned num_names
Maximum number of names.

short unsigned num_timers
Maximum number of timers.

short unsigned num_sessions
Maximum number of sessions.

short unsigned num_handlers
Maximum number of interrupt handlers.

short unsigned reserve64k
Relocation offset (see -R option to Proc).

short unsigned max_nodes
Number of nodes you are licensed for.

short unsigned proc_freemem
Not used.

short unsigned fd_freemem
Not used.

short unsigned ldt_freemem
Not used.

short unsigned num_fds[3]
Number of file descriptors (see -f option to Proc).

short unsigned pidmask
Process ID bit mask (to determine cyclic and indexing portions of
pid).

long unsigned totpmem
Total memory in the system.

long unsigned freepmem
Free memory in the system.

long unsigned cpu_features
cpu_features & 0xFFF gives the CPU speed, in Mhz.


Note: For QNX4.0, the pidmask was zero. If your code uses the
pidmask, you should have the following test to ensure your
program will work on QNX4.0 as well as later versions of QNX:
if (pidmask == 0) pidmask = 0x00ff;


At least the following flag bits are defined in <sys/osinfo.h>:

_PSF_PROTECTED
Running in protected mode.

_PSF_NDP_INSTALLED
An 80x87 is installed.

_PSF_EMULATOR_INSTALLED
An 80x87 emulator is running.

_PSF_EMU16_INSTALLED
The 16-bit 80x87 emulator is running.

_PSF_EMU32_INSTALLED
The 32-bit 80x87 emulator is running.

_PSF_32BIT_KERNEL
The 32-bit kernel is being used.

_PSF_PCI_BIOS
A PCI BIOS is present.

_PSF_32BIT
Proc32 is running.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.