Date: Mon, 20 Oct 2003 13:41:05 -0400 (EDT) From: Robert Watson <rwatson@freebsd.org> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: current@freebsd.org Subject: Re: ethercons: ethernet console driver for 5-current Message-ID: <Pine.NEB.3.96L.1031020133640.19616B-100000@fledge.watson.org> In-Reply-To: <20031020170352.GA39640@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 20 Oct 2003, Steve Kargl wrote: > On Mon, Oct 20, 2003 at 12:13:27PM -0400, Robert Watson wrote: > > > > I had a fair amount of time over the last week running in disconnected > > operation, and realized I had too many cables under my desk, so I spent a > > bit of time exploring the FreeBSD console code. After reading a FREENIX > > paper this summer on a Linux ethernet console driver, I took a pass at > > implementing ethernet console support for FreeBSD. > > This looks very interesting! Can we run ddb over the ethercon to debug > a wedged machine? Not currently. In the current implementation, the ethernet console picks up its input, and generates output, using the ethernet layer of the network stack. Since the debugger suspends scheduling, this means interrupt threads, netisrs, etc, aren't running, so for now, ethercons is disabled when "in the debugger" (db_active != 0). This permits other console devices, such as serial console, to be used for the debugger, however, at the same time. To support ethernet debugging, the debugger would need to be able to drive polling of the network interface in an interrupt-thread-free environment, and reproduce more of the lower level network code (i.e., not use mbufs, etc). This is feasible to do, but would probably require adding new interfaces to the ethernet driver, and supporting only ethernet cards that had these additional debugging interfaces. Compared to serial console, you'd also have a lot more situations where the driver/hardware state would be sufficiently inconsistent as to make debugging network-related crashes difficult. On the other hand, Darwin runs quite well with a network debugger; I believe they have a fairly complex UDP/IP implementation in the network debugger, although I haven't inspected it. Apple has the advantage, though, of providing very few ethernet drivers. So I'm happy to look at it, but the level of time investment to get to network debugging from the current (and pretty simple) ethercons device will be fairly high. I know Jonathan Lemon was looking at network console and debugging code previously, but I don't have copies of his patches. If I had to guess, I'd assume he had modified the if_fxp driver, and perhaps others, to provide an appropriate polled interface for use with a debugger, but I don't know for sure. If someone has copies of these patches, I'd be happy to take a look at them. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1031020133640.19616B-100000>