Kernel
Parameters
Implementing kernel variables as hierarchy path might look very good. However in most of the kernels, the configurable variables are very less(less than 1000). So a static array is more than enough for a micro kernel with very less dynamic variables.
Saving and loading kernel parameters from a file will be suspended until File System code is ready.
Using Multiboot kernel parameter option, boot time arguments can be passed to kernel. So the current kernel parameter design will use grub/menu.lst file as storage for kernel parameters.
Kernel parameter should be architecture independent code but it can contain architecture dependent kernel variables.
A static array “kernel_parameters” in param.c is used to track all the kernel parameters.
While populating the kernel parameters with new value, the kernel parameter module will call back the subsystem’s routines to validate the given value. After validating the values, the kernel won’t assign the value directly; instead it will call the subsystems assign routine. After successful assignment, it will call back the subsystem to notify, kernel parameter is updated successfully.

typedef struct kernel_parameter
KERNEL_PARAMETER, KERNEL_PARAMETER_PTR;
struct kernel_parameter
{
char
parameter_name[30];
void * value_pointer;
int
(*ValidateParameter(KERNEL_PARAMETER_PTR kp, void * new_value,
UINT32 arg1,
UINT32 arg2, UINT32 arg3) )
UINT32 ValidateParameterArg[3];
int
(*AssignParameterStart(KERNEL_PARAMETER_PTR kp, void * new_value));
int
(*AssignParameterComplete(KERNEL_PARAMETER_PTR kp ));
};
Parameter_name uniquely identifies a kernel parameter.
value_pointer
points to the kernel parameter variable / array.
ValidateParameter will be called when a new value is identified
for the kernel parameter. Each kernel parameter can provide its own validator
or it can use generic validators.
ValidateParameterArg will be passed to the ValidateParameter
function when it gets called.
AssignParameterStart will be get called
with new value if ValidateParamter is successful.
If AssignParameterStart is successful then AssignParameterComplete
will be called to complete the operation.
KERNEL_PARAMETER
kernel_parameters[]=
{
All the kernel parameter declaration goes
here.
};