Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions | Variables
nvram.c File Reference
#include <kernel.h>
#include <memory.h>
#include <device.h>
#include <nvram.h>
#include <string.h>
#include <stdlib.h>
#include <debug.h>
#include <stdio.h>

Functions

devcall nvramInit (void)
 
char * nvramGet (char *name)
 
devcall nvramSet (char *name, char *value)
 
devcall nvramUnset (char *name)
 
devcall nvramCommit ()
 

Variables

struct nvram_header * nvram_header = NULL
 
struct nvram_tuple * nvram_tuples [NVRAM_NHASH]
 

Detailed Description

Functions to access the nvram settings from kernel space.

Function Documentation

devcall nvramCommit ( )

Commit nvram settings to memory. Due to the nature of nvram settings writing to memory everytime would greatly reduce the life of flash, so after making changes you must commit them to memory.

Returns
OK on success, SYSERR on failure
char* nvramGet ( char *  name)

Find the value of a variable.

Parameters
*namename of variable to find
Returns
pointer to requested tuple struct
devcall nvramInit ( void  )

Initialize the nvram variable structures for editing

Returns
OK on success, SYSERR on failure
devcall nvramSet ( char *  name,
char *  value 
)

Change the variable name to value. If name does not exist, create it, otherwise replace the old value with the new.

Parameters
*namename to modify
*valuevalue to set name
Returns
OK on successful change, SYSERR on failure
devcall nvramUnset ( char *  name)

Remove a setting from nvram.

Parameters
*namename to remove from nvram settings
Returns
OK on success, SYSERR on failure