LFS 6.1-testing issues

Bryan Kadzban bryan at kadzban.is-a-geek.net
Wed Apr 13 10:16:52 PDT 2005

On Wed, Apr 13, 2005 at 07:50:03AM -0500, Bruce Dubbs wrote:
> In any case, we are getting closer.  I did follow the book precisely and 
> took the option of not changing anything in the console configuration. 
> This worked in the past.  It would certainly be easy enough to throw in 
> a "stty sane" or "stty erase ^?" in /etc/profile, but the question now 
> is why is that necessary?

None of your boot scripts (or your login scripts) set stty erase ^H,
correct?  You never know...

stty seems to pull those settings in from a tcgetattr() call.  The
"struct termios" that that call fills in, has the ^H character code set
in the c_cc[VERASE] element (this defines which keycode acts as the
"erase" keycode).

tcgetattr() is part of glibc.

glibc's sysdeps/unix/sysv/linux/tcgetattr.c file defines tcgetattr() as
a weak alias for __tcgetattr, which basically calls the TCGETS ioctl on
the passed-in file handle.

In the kernel, in drivers/char/tty_ioctl.c, that ioctl value translates
real_tty->termios into a user-space version, and copies it into the
passed-in buffer.

real_tty's value depends on whether the tty that gets passed into the
ioctl handler is a pseudo-terminal master, or something else.  If it's a
PTY master, then real_tty is its "link" (presumably the PTY slave,
though I don't know that for sure).  Otherwise, real_tty is the
tty_struct that was passed in.  (This is all happening in
drivers/char/tty_ioctl.c, function n_tty_ioctl.)

Beyond that, I get lost in the kernel.  I *think* the tty_struct that
gets passed in depends on the line discipline (I can't find any
promising callers of n_tty_ioctl, and the only other promising reference
to it is the spot that sets it as the ioctl handler for the N_TTY line
discipline, which seems to be the "standard" TTY line discipline).  I
also know that ->termios has to be initialized somewhere (when the line
discipline is opened? doesn't seem to be it though), but I can't figure
out where.

Did you say you were using some kind of framebuffer console?  Does it
help at all if you change that, or did you try that already?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20050413/7d108115/attachment.sig>

More information about the lfs-dev mailing list