Subject: Re: console device selection
To: None <garrett_damore@tadpole.com>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 09/02/2006 20:49:02
In article <44F91E2B.9010207@tadpole.com> you write:
>I just spent some time looking at the x86 console selection code, mostly
>to see if I could come up with any examples for a "clean" way to
>implement console selection code.
>
>Boy, was I mistaken.
>
>I think we need to consider a way for the various framebuffers,
>keyboards, and serial devices to register with a console selection
>framework, which can then do the "right" thing.  I propose, therefore,
>something along these lines:
>
>struct cons_device {
>    int   preference;
>    const char *name;
>    int (*initialize)(void);
>    int devtypes;  /* 0 = input, 1 = output, 2 = both? */
>};
>
>struct cons_register(&cons_device);

There's an existing system that does something like this in 
sys/dev/cninit.c and sys/dev/cons.h.  It's based around something 
akin to the static device switch tables we used to have, so it might 
need some work to bring it into the 21st century.  If nothing else, 
someone should remember to kill it when you get your new version 
together.

-- 
Ben Harris