/* mydriver_main.c:  major functions of mydriver */

#import <syslog.h>
#import <kernserv/kern_server_types.h>

kern_server_t instance;

/* mydriver_init:  Called when mydriver is loaded. */
void mydriver_init(void)
{
    printf("My driver loaded\n");
}

/* mydriver_signoff:  Called when mydriver is unloaded. */
void mydriver_signoff(void)
{
    printf("My driver unloaded\n\n");
}

/* mydriver_do_log:  Called by mydriver_server, which was created by MiG. */
kern_return_t mydriver_do_log(port_t server)
{
    printf("Calling kern_serv_log.\n");
    kern_serv_log(&instance, LOG_WARNING, 
        "This is the log message (at level %s).", 
        (int)"LOG_WARNING", 0, 0, 0, 0);
    printf("Returned from calling kern_serv_log\n");
    return KERN_SUCCESS;
}   