Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 02:39:28 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Mohana Krishna Penumetcha <pmk@sasi.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: kernel debugging!!!
Message-ID:  <20010111023928.X7240@fw.wintelcom.net>
In-Reply-To: <Pine.LNX.4.10.10101111533330.1340-100000@pcs113.sasi.com>; from pmk@sasi.com on Thu, Jan 11, 2001 at 03:55:56PM %2B0530
References:  <39C1BC04.4A534A80@softweyr.com> <Pine.LNX.4.10.10101111533330.1340-100000@pcs113.sasi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Mohana Krishna Penumetcha <pmk@sasi.com> [010111 02:26] wrote:
> 
> 
> we are testing our driver for 4.0 freeBSD. kernel is panicing in the
> attach routine with the message "double fault". the longest sequence of
> function calls from the attach routine use 180 bytes of kernel stack(this
> includes only the local variable), i read in the mailing lists that kernel
> stack size is 256 bytes. is there a way i can know what is my current
> kernel stack usage? 

Afaik, on i386 you have ~4k of kernel stack, however you have to
realize that driver entry can come from an interrupt generated when
the stack is already nearly exhausted.  I'm not really that much
of a driver programmer, but I've heard of people facing this problem
before, solutions varied, but since each driver instance is single
threaded you can pre-allocate via malloc (i think) the space you
need and attach it to the per-driver data structure (softc afaik).

> we enabled the DDB by selecting the DDB option in the configuration file.
> After kernel panics control doesn't always go to DDB, did i miss anything
> while enabling DDB?

Probably not.

> when control goes to DDB, it is printing eip, esp, ebp register values
> along with some other information. but when i use trace command, it is
> listing the trace from trap only. i think when kernel double faults,
> original stack trace won't be available. can i know where is the problem
> from the above three register values?

My first solution would be to rip out your current "attach" code
and make sure you're actually getting into it by replacing the
routine with a simple 'printf("hello world")' before worrying about
kernel stacks and whatnot.

If even that does work, then try to take a simple driver from the
kernel source (or there may be examples in /usr/share/examples)
and try to get it to link properly.

Basically, take small steps first, and tread lightly, I don't write
drivers, just chat with a bunch of people that do. :)

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


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




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