init()
function
loads up the table with the default values. The read()
function then takes values from the parameter file and writes over the
defaults.
Stored in the table are offsets from some reference address in memory
to the address of the parameter in user space. At the end of the
read()
function the values in the table are copied across
from the table into user space, using the offset to compute the
user-space address.
From then on the program deals with the parameters in user space. If changes are made to parameter values this is done in user space.
Prior to a print of the parameters, the values are copied back from
user space to the table via the sync()
function.