DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SURF kernel monitor

Adding SURF modules

Additional SURF modules can be defined by creating new instances of the DisplayModules data structure defined in the <surf.h> header file. For example, to add a module for displaying wddisk module events, use code such as the following:

   extern void wddisk_display(FILE *fp, void *event);
   

display_module_t wddisk_display_module = { "wddisk", &wddisk_display };

display_module_t *DisplayModules[] = { &generic_display_module, &surftimer_display_module, &wddisk_display_module }; unsigned NumDisplayModules=sizeof(DisplayModules)/sizeof(display_module_t *);

Note that &generic_display_module must be the first module.

In this example, the wddisk_display( ) routine will be called each time SurfOutputEvent( ) is called for a wddisk module. In order for events to be matched to the appropriate display module, the ASCII string contained in wddisk_display_module must match the string specified for the corresponding module in the link kit's pack.d/surf/space.c file.

Custom display routines should not display any information concerning the event header; this is done as a convenience before the custom routine is called. All information displayed for an event is typically contained on a single line so that other filter programs can easily process the data.

Any events for which there is no display module will be displayed as the header information followed by a series of hex digits with a space between each byte.


© 2005 The SCO Group, Inc. All rights reserved.