Subject: Re: console device selection
To: Ben Harris <bjh21@netbsd.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 09/02/2006 12:51:38
Ben Harris wrote:
> 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.
>
>
Thanks, I'll take a look at it.
- Garrett
--
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134 Fax: 951 325-2191