[syslinux] COM32: console_ansi_raw() and later segfaults

H. Peter Anvin hpa at zytor.com
Sat Dec 13 11:16:37 PST 2008


Gene Cumm wrote:
>>>
>> Well, you typically want to leave most the flags unchanged.
> 
> I can definitely understand that.  As more is touched, it means that
> there's a higher probability something unexpected may happen
> (especially if the BIOS is buggy).
> 

Actually this is only applicable to when compiling for Linux (host mode
for testing), so it doesn't apply at other times at all.

>> Note that we have a restore PM, H. Peter Anvin <hpa at zytor.com> wrote:
>>> Well, I found the issue: console_ansi_std() is touching c_cflag but
>>> not c_lflag.  The next question is should it be touching both or just
>>> c_lflag?
>>>
>> Setting both is probably a good idea.
>>
> 
> I can't speak for other POSIX systems (or even other architectures for
> Linux) but, on my system, the lower 5 bits seem to control a serial
> port's speed (along with 1 other higher bit for speeds starting at
> 57600;  B57600 and B0 are some search keywords in <bits/termios.h>).
> ISIG and ICANON will touch the low 2 bits of c_cflag if used,
> potentially changing the serial port speed in Linux (unless I'm
> misinterpreting the code).

You have to set the proper bits from the proper fields. You can't set
I-flags like ISIG and ICANON in c_cflag; those can only be set in
c_iflag, and so on.

	-hpa




More information about the Syslinux mailing list