From owner-freebsd-smp Sun Nov 26 20:14: 2 2000 Delivered-To: freebsd-smp@freebsd.org Received: from mobile.wemm.org (adsl-64-163-195-99.dsl.snfc21.pacbell.net [64.163.195.99]) by hub.freebsd.org (Postfix) with ESMTP id 0F40F37B4C5 for ; Sun, 26 Nov 2000 20:13:59 -0800 (PST) Received: from netplex.com.au (localhost [127.0.0.1]) by mobile.wemm.org (8.11.1/8.11.1) with ESMTP id eAR46wD45035; Sun, 26 Nov 2000 20:06:58 -0800 (PST) (envelope-from peter@netplex.com.au) Message-Id: <200011270406.eAR46wD45035@mobile.wemm.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Jake Burkholder Cc: Greg Lehey , smp@FreeBSD.ORG Subject: Re: BSD/OS interrupt code In-Reply-To: <20001127015006.5B7BDBA7A@io.yi.org> Date: Sun, 26 Nov 2000 20:06:58 -0800 From: Peter Wemm Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Jake Burkholder wrote: > > On Sunday, 26 November 2000 at 14:07:49 -0800, Jake Burkholder wrote: > > > Hi, > > > > > > If anyone with access to the BSD/OS code is interested, I've written > > > a little program that runs their interrupt stub code generator in > > > userland. You can then abort(); and disassemble the stub from > > > the core dump to look at the code all in one piece. Makes it much > > > easier to follow. > > > > > > In case you haven't looked, their interrupt handlers are generated > > > by bcopy-ing various blocks of assembler code into an array at > > > runtime, and then poking in arguments and relocating branches. > > > > Interesting. I was wondering whether something similar would be a > > good idea. On the other hand, We don't waste much space by having > > multiple alternate stubs. What's your feeling? > > I suspect that it would be hard to do this for architectures > other than x86, which has a relatively simple instruction format. > > I also think that BSD/OS went a little too far with this, and > have produced code that is very difficult to understand, let > alone maintain. I think its cool what they did, I'm humbled > and amazed that they made it work, but I don't know that its > right for FreeBSD. I was looking at taking a shot at doing something like this a few days ago. While in .au I went through the leftovers of our old interrupt code and did a cleanup. I also made the APIC code support 32 hardware IRQ sources instead of the old 24 limit. The 24->32 IRQ change affected no less than 6 or 7 places where there are static tables. It is kind of a shame that we're still stuck with it given the large multi-pci bus systems we're running into these days with 32 or 48 hardware interrupt sources. The other reason for looking at this was for certain broken hardware that has IRQ sources connected *only* to the PIC (ie: the apic pin connection is missing). Right now, we cheat by using *one* pic source in auto-EOI mode and daisy-chaining it all to the APIC. This doesn't work if the PIC->APIC interlink is missing (as I believe it is on this box) or there are multiple PIC-only interrupt sources that we need (ie: timer0 and rtc). I dont have the actual hardware in my hands yet, but I have an awful feeling that it is going to require running the PIC *and* APIC at the same time, with different IDT vectors. The stub generation code might help keep down the cost of replicating another 16 sets of slow and fast interrupt handlers.. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message