From owner-freebsd-hackers Tue Jul 9 07:30:47 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA10590 for hackers-outgoing; Tue, 9 Jul 1996 07:30:47 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA10578 for ; Tue, 9 Jul 1996 07:30:40 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id XAA16107 for hackers@freebsd.org; Tue, 9 Jul 1996 23:55:38 +0930 From: Michael Smith Message-Id: <199607091425.XAA16107@genesis.atrad.adelaide.edu.au> Subject: Odd hang in device driver... To: hackers@freebsd.org Date: Tue, 9 Jul 1996 23:55:38 +0930 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Howdy people; I know I unsubscribed, but I've tripped over a curly one and some sage advice would be a lifesaver... I'm seeing a 'Panic: double fault' hang that has me wondering about the save size of auto data on the kernel stack. I have a function I'll call 'fooread()' - it's a device driver read function. Now, because I'm a loser and haven't had time to investigate uiomove properly, and because my interrupt handler uses a ringbuffer, I copy data from the ringbuffer to a temporary buffer, and then uiomove() it out of there in the case of a buffer wrap. Thus, the scratch buffer needs to be the same size as the largest read the driver will allow - in this case, the same size as the ringbuffer. To handle some serious application latency problems (not easily curable 8( ) I recently upped the receive buffer from 1K to 4K, and have subsequently started seeing these double-fault hangs. What has me wondering about the size of aut data issue is that the entry for the function in question is at 0xf01c6d64, and eip for the double fault is 0xf01c6d6d. I'm not sure of gcc's function preamble overhead, but I suspect that it's probably more than 10 bytes, and this is where the advice would be handy. The first code in the function is the traditional : unit = minor(dev); which appears to work for all other devices. And as an aside which would help me avoid the double copy altogether, is it fair to say that : uiomove(buf, a, uio); uiomove(buf + a, b, uio); would have the same effect as uiomove(buf, a + b, uio); ie. is it possible to call uiomove more than once in a read/write function? -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[