Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2002 18:23:33 -0700 (PDT)
From:      "Kamal R. Prasad" <kamalpr@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   i386/36944: kldload causes kernel panic
Message-ID:  <200204100123.g3A1NX604113@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         36944
>Category:       i386
>Synopsis:       kldload causes kernel panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 09 18:30:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kamal R. Prasad
>Release:        4.5-STABLE
>Organization:
>Environment:
>Description:
I have a sample  device driver which when we try to load, causes a kernel panic because of a page fault. (Im new to device drivers so pl. excuse me for any bugs in the code). the c code(chardev_example.c) is pasted below:-
-----------------------------------------------
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/kernel.h>


static int chardev_example_load(struct module* m, int what, void* ar
{
        int err = 0;

        switch (what)
        {
                case MOD_LOAD : uprintf("skeleton kld loaded\n");
                        break;
                case MOD_UNLOAD : uprintf("skeleton kld un-loaded\n"
                        break;
                default:
                        err = EINVAL;
                        break;
        }
        return err;
}

DECLARE_MODULE(chardev_example, chardev_example_load, SI_SUB_KLD, SI_ORDER_ANY);
----------------------------------------------------------
the Makefile is pasted below:-
-----------------------------------------
SRCS=chardev_example.c
KMOD=chardev_example

.include <bsd.kmod.mk>
-----------------------------------------


>How-To-Repeat:
make
kldload -v ./chardev_example.ko

>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204100123.g3A1NX604113>