SYSTEM_CONFIG


The SYSTEM_CONFIG macro is used by MESS drivers to provide info about devices and the RAM size.

This page is no longer relevant, as the concepts described within have been replaced by devices.

Syntax


SYSTEM_CONFIG_START(<short config name>)
  CONFIG_DEVICE(<short name>_<device>_getinfo)
  ..
  CONFIG_RAM_DEFAULT(<default ram size>)
  CONFIG_RAM(<ram size>)
  ..
SYSTEM_CONFIG_END

CONFIG_RAM and CONFIG_RAM_DEFAULT

When the CONFIG_RAM and/or CONFIG_RAM_DEFAULT options are used in a driver then the MESS framework will make sure the following global variables are set and ready for use by the driver:

  • mess_ram_size
    • The size of the RAM area chosen by the user or, when only CONFIG_RAM_DEFAULT is available, the default size.
  • mess_ram
    • A pointer to memory claimed by the framework. The amount of memory claimed is available in the mess_ram_size variable.

Example

SYSTEM_CONFIG_START(mydriver)
  CONFIG_DEVICE(mydriver_floppy_getinfo)
  CONFIG_DEVICE(mydriver_printer_getinfo)
  CONFIG_RAM_DEFAULT(64*1024)
  CONFIG_RAM(32*1024)
  CONFIG_RAM(16*1024)
SYSTEM_CONFIG_END

This config adds two devices; a floppy drive and a printer. It also adds three possible ram sizes for the system, in this case it can have 16k, 32k or 64k of memory, with 64k being the default.

You need to provide some additional info for each device. This is done using the device_getinfo reference we added above.