Subject: kern/808: tty defaults wrong for serial bootblocks
To: None <gnats-admin@NetBSD.ORG>
From: Luke Mewburn <lukem@dodo.melb.cpr.itg.telecom.com.au>
List: netbsd-bugs
Date: 02/19/1995 21:35:01
>Number:         808
>Category:       kern
>Synopsis:       tty defaults (7E1) are wrong for i386 serial boot blocks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   lm
>Arrival-Date:   Sun Feb 19 21:35:01 1995
>Originator:     Luke Mewburn
>Organization:
"	Werj"
>Release:        1.0
>Environment:
System: NetBSD dodo 1.0 NetBSD 1.0 (DODO) #7: Fri Dec 16 17:01:27 EST 1994 simonb@dodo:/slab/0/src/sys/arch/i386/compile/DODO i386


>Description:
	When using -DSERIAL on the i386 boot blocks, problems occur
	when the kernel switches the com ports from the bootblocks
	default of 9600 8N1 to 9600 7E1. 

	This causes the output of commands running in /etc/rc such as
	fsck to output crud until you manage to change your terminal
	emulation.

	In essence, this is all due to an archaic default of 7E1,
	instead of the more usable 8N1 (TTYDEF_CFLAG, defined in
	sys/ttydefaults.h)

	If this doesn't get changed for historical ("hysterical")
	reasons, I think it's time to forget the past cause I hate
	swapping terminal modes and my terminal is 8N1 for all other
	other applications... ;)

>How-To-Repeat:
	- Install i386 bootblocks compiled with -DSERIAL.
	- Connect a terminal to com0, 9600, 8N1.
	- Reboot, and watch the crud fly.

>Fix:
	- Apply this patch to /sys/sys/ttydefaults.h.
	- % cd /usr/src/include ; make install
	- Rebuild the only things that directly use TTYDEF_CFLAG:
	    - kernel
	    - bin/stty

*** ttydefaults.h.orig	Mon Feb 20 16:16:50 1995
--- ttydefaults.h	Mon Feb 20 16:17:01 1995
***************
*** 52,58 ****
  #define	TTYDEF_IFLAG	(BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
  #define TTYDEF_OFLAG	(OPOST | ONLCR | OXTABS)
  #define TTYDEF_LFLAG	(ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
! #define TTYDEF_CFLAG	(CREAD | CS7 | PARENB | HUPCL)
  #define TTYDEF_SPEED	(B9600)
  
  /*
--- 52,58 ----
  #define	TTYDEF_IFLAG	(BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
  #define TTYDEF_OFLAG	(OPOST | ONLCR | OXTABS)
  #define TTYDEF_LFLAG	(ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
! #define TTYDEF_CFLAG	(CREAD | CS8 | HUPCL)
  #define TTYDEF_SPEED	(B9600)
  
  /*


--
Luke Mewburn                                                  <lm@werj.com.au>
``This is the central trick of the censor: to exaggerate the importance of the
  challenging speech, to suppress it, and to deny the suppression.''
    -- 'Guilty Secrets; Free Speech & Defamation in Australia', Roger Pullan
>Audit-Trail:
>Unformatted: