I did a add_drv to add a new charecter driver and oops the system
crashes and when it tries to reboot ofter that it crashes again! I think
its a bug with solaris 2.3 ??? any help is thanked apriori -:)
The following driver program crashed the system and what more whenever
it tries to sync and reboot it crashes again. So effectively the
system is not able to come up at all. Is it a bug in solaris 2.3 ?
This panic and sink happens when it tries to configure /devices
directory.
#include <limits.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <sys/user.h>
#include <sys/errno.h>
#include <sys/uio.h>
#include <sys/modctl.h>
#include <sys/devops.h>
static char foxmessage[] =
"The quick brown fox jumps over lazy dog ";
struct mod_ops mod_driverops;
static struct modldrv modldrv_= {
&mod_driverops,
"Sample Driver",
NULL
static struct modlinkage modlinkage_ = {Quote:};
MODREV_1,
&modldrv_,
NULLint
_init(void)
{
return (mod_install(&modlinkage_));
int chdinit()Quote:}
{
return 0;
int chdwrite(dev,uio)Quote:}
dev_t dev;
struct uio *uio;
{
printf("Write calls ignored\n");
return 0;
int chdread(dev,uio)Quote:}
dev_t dev;
struct uio *uio;
{
char c;
while ( (uio->uio_iovcnt>0) && (uio->uio_iov->iov_len>0) ) {
c=foxmessage[uio->uio_offset % (sizeof(foxmessage) -1)];
if (ureadc(c,uio))
return EFAULT;
}
return 0;
int chdopen( dev, flags )Quote:}
dev_t dev;
int flags;
{
return 0;
int chdclose( dev )Quote:}
dev_t dev;
{
return 0;
thanxQuote:}
};
Vittal
--
___________________________________________________________________________
Beauty lies in the eyes of the beholder !
/________________________________________________________________________
|
| ___________________________________________________________________
/|
|
| | | Vittal Sathyanatayanan |
|
|
| | | ,,, |
|
|
| | | (o o) | |
| Email Address:
| |
|
| |/________________________________________________________________________
|
|__________________________________________________________________________