From owner-freebsd-current Thu Nov 4 23:35:28 1999 Delivered-To: freebsd-current@freebsd.org Received: from celery.dragondata.com (celery.dragondata.com [205.253.12.6]) by hub.freebsd.org (Postfix) with ESMTP id 3B64E14D23 for ; Thu, 4 Nov 1999 23:35:22 -0800 (PST) (envelope-from toasty@celery.dragondata.com) Received: (from toasty@localhost) by celery.dragondata.com (8.9.3/8.9.3) id BAA95943; Fri, 5 Nov 1999 01:34:15 -0600 (CST) (envelope-from toasty) From: Kevin Day Message-Id: <199911050734.BAA95943@celery.dragondata.com> Subject: Re: vga driver and signal To: hasty@rah.star-gate.com (Amancio Hasty) Date: Fri, 5 Nov 1999 01:34:15 -0600 (CST) Cc: doconnor@gsoft.com.au (Daniel O'Connor), current@FreeBSD.ORG, yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA), mike@smith.net.au (Mike Smith) In-Reply-To: <199911050254.SAA50665@rah.star-gate.com> from "Amancio Hasty" at Nov 04, 1999 06:54:11 PM X-Mailer: ELM [version 2.5 PL1] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Kind of complex though. Also the interrupt latency problem is still there. > > Not sure that this is as elegant as what you are suggesting , can > the kernel schedule a user level routine to be executed when an interrupt > occurs? I guess on Windoze land this is called a driver call-back. > > In a project I'm working on now (that some of you saw at FreeBSDCon) I had a need to sync a lot of things to a vsync interrupt. I ended up writing a small driver to attach to the video card. My program would do a blocking read on the device, which would put that process to sleep. The interrupt handler would shove one byte of data back to the process through the read (indicating interrupt status) and wake up the process. This works, but still has a problem if latency and missed interrupts if you aren't reading when the interrupt happens. (I've worked around those too, but that's quite a bit more involved to fix it). You'll probably need to end up changing the scheduler slightly, or playing with rtprio. Kevin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message