[syslinux] COM32: console_ansi_raw() and later segfaults

H. Peter Anvin hpa at zytor.com
Wed Dec 10 14:58:37 PST 2008


Gene Cumm wrote:
> 
> libutil are where console_ansi_raw(), console_ansi_std() and get_key()
> come from.  Just looking through the contents of all of the
> libutil/include/*.h files and the names of all of libutil/*.c files, I
> don't see anything else immediately that appears to refer to the
> console.
> 
> Just did some more testing.  If I use tcgetattr() to fetch the termios
> first, run console_ansi_raw() then use tcsetattr() using the old
> settings it works perfectly.  I also tried playing with
> console_ansi_std() to get it to clear what console_ansi_raw() did and
> I can't seem to find what to tweak, even though they look like they
> mirror each other.  I either get it to segfault or not echo the
> keystrokes again.
> 
> Looking around at the other modes that COM32 can open the console in,
> maybe I need to create a better function to do this.
> 

The big problem, I think, is that the COM32 console library isn't really
designed for switching between drivers -- in the case of closely related
drivers like this, it should work, but has never actually been tested.

The difference between the raw and std consoles is which input driver is
used -- the equivalent to the Linux line discipline.  The best thing
would be to separate the console driver and the line discipline on the
input side, and create a real line discipline abstraction, which can
then be designed to explicitly be switched at runtime.

It shouldn't even be that hard to do.

	-hpa




More information about the Syslinux mailing list