Sockets and partitions

The QNX Neutrino RTOS supports both raw partitions and flash filesystem partitions.

Sockets

QNX flash filesystem drivers support one or more logical flash drives. Each logical flash drive is called a socket. A socket consists of a contiguous and homogeneous region of flash memory. For example, in a system containing two different types of flash device at different addresses, where one flash device is used for the boot image and the other for the flash filesystem, each flash device would appear in a different socket.

Each socket may be divided into one or more partitions. Two types of partitions are supported:

Raw partitions

A raw partition in a socket is any partition that doesn't contain a flash filesystem. The flash filesystem driver doesn't recognize any filesystem types other than the flash filesystem. A raw partition may contain an image filesystem or some application-specific data.

The flash filesystem uses a raw mountpoint to provide access to any partitions on the flash that aren't flash filesystem partitions. Note that the flash filesystem partitions are available as raw partitions as well.

Flash filesystem partitions

A QNX flash filesystem partition contains the POSIX-like flash filesystem, which uses a QNX-proprietary format to store the filesystem data on the flash devices. This format isn't compatible with either the Microsoft FFS2 or PCMCIA FTL specification.

The QNX flash filesystem allows files and directories to be freely created and deleted. It recovers space from deleted files using a reclaim mechanism similar to garbage collection.

The flash filesystem supports all the standard POSIX utilities such as ls, mkdir, rm, ln, mv, and cp. There are also some QNX Neutrino utilities for managing the flash filesystem:

flashctl
Erase, format, and mount flash partitions.
deflate
Compress files for flash filesystems.
mkefs
Create flash filesystem image files.

The QNX flash filesystem supports all the standard POSIX I/O functions such as open(), close(), read(), and write(). The devctl() function supports special actitivies such as erasing.

Creating a flash filesystem partition

To create a flash filesystem partition for any BSP:

  1. Start the flash filesystem driver.
  2. Erase the entire flash medium.
  3. Format the partition.
  4. Slay the flash filesystem driver.
  5. Restart the flash filesystem driver.

For example, for a board than can be booted from flash:

  1. Start the flash system driver:
    devf-generic -s0x0,32M
    

    You should now see an fs0p0 entry under /dev.

  2. To prepare the area for the partition, erase the entire flash:
    flashctl -p/dev/fs0 -ev
    
  3. Format the partition:
    flashctl -p/dev/fs0p0 -f
    
  4. Slay the flash filesystem driver:
    slay devf-generic
    
  5. Finally, restart the driver:
    devf-generic &
    

You should now see the following entries:

Entry Description
/dev/fs0p0 OS image (32 MB)
/dev/fs0p1 Flash filesystem partition (32 MB)