From owner-freebsd-hackers Wed Jan 18 22:57:04 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id WAA12160 for hackers-outgoing; Wed, 18 Jan 1995 22:57:04 -0800 Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id WAA12154 for ; Wed, 18 Jan 1995 22:56:59 -0800 Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.8/8.6.6) id BAA00363 for freebsd-hackers@freebsd.org; Thu, 19 Jan 1995 01:54:52 -0500 From: Wankle Rotary Engine Message-Id: <199501190654.BAA00363@skynet.ctr.columbia.edu> Subject: More serial console stuff... To: freebsd-hackers@FreeBSD.org Date: Thu, 19 Jan 1995 01:54:48 -0500 (EST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 4218 Sender: hackers-owner@FreeBSD.org Precedence: bulk Okay, I think I'm almost ready to actually commit the serial console stuff to the boot blocks and kernel. ("Hide the kids! He's going to commit!") But I've got a couple small things I need to ask about before taking the plunge: First, there's one thing I always do to the boot blocks when I do an installation, which is to change the way 'unit' is calculated. Normally it says this: part = unit = 0; This always forces unit 0 to be the default, which screws up autobooting on my system because my root disk is unit 1 (wd1). The change I always make is: part = 0; unit = (drive & 0x7F); This automagically sets the unit to 0 or 1 accordingly. I've seen this bandied about on the newsgroups, but I've often wondered why it never became official. My guess is that this causes other problems that I'm not aware of (which are undoubtedly related to SCSI disks, which I don't have.) I'm tempted to sneak this in while I'm in the neighborhood, but first I want to find out if this hack was already rejected for a reason. Second, there are incidental problems involved with booting with a serial port as a console. For one thing, you have to remember to edit /etc/ttys properly before you bring the system up multi-user for the first time, or you won't get a login prompt. Newbies aren't likely to be able to figure this out, so I want to idiot-proof it for them. What I want to do is change the default /etc/ttys, but I'm not sure exactly how to go about it. I can either add another getty entry for 'ttyd0' or put a getty on 'console'. Each of these options has its own problems. The latter idea means turning off the getty on 'ttyv0,' otherwise there would be two gettys on the same terminal in the case where you boot in VGA console mode. The former costs you another getty process for a terminal device that might not be used at all (the newbie has to figure out how to turn it off too -- serial port questions galore). Putting a getty on 'console' is really the nice way to do it, but there are a few small complications: - the getty on /dev/ttyv0 has to go away. This means that if you boot from the VGA console but force the kernel to use a serial console, ttyv0 winds up missing in action. Fixing it is simple: you just need to edit /etc/ttys to suit your system, but again: newbies ahoy. - the default terminal type can't be 'cons25' and 'vt100' (or whatever) at the same time. Leave it set to cons25, and booting from a VT-100 terminal doesn't work quite right. Make it vt100, and syscons gives you grief. SunOS has the same problem and there really isn't a fix: it's up to the user/admin to edit /etc/ttys (/etc/ttytab in SunOS) to take care of this. All aboard the newbie express. - ps and w get confused (w especially): I don't know how many of you have noticed this, but if you actually edit /etc/ttys and replace 'ttyv0' with 'console' (which should be allowed), ps still says that your tty is 'v0' (it should say 'co'). w gets into trouble too, with the result being that it fails to show the commands being run by the user on the console because it can't match 'co' (which it gets from utmp) with any active terminal devices. I haven't even begun to look into the cause of this. Lobotomizing the kernel seems unavoidable. ("You're on a bus hacking at 50 miles an hour and you're trying to juggle a dozen different system configuration details at once. If you mess one of them up, the newbies start pestering you with questions. What do you do? WHAT DO YOU DO?!" :) Anyway, I'm rambling. Quick summary: why the hardcoded unit number in the boot blocks, and does anyone have any suggestions about how to deal with /etc/ttys? -Bill -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~T~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Bill Paul (212) 854-6020 | System Manager Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Møøse Illuminati: ignore it and be confused, or join it and be confusing! ~~~~~~~~ FreeBSD 2.1.0-Development #0: Fri Jan 13 22:04:07 EST 1995 ~~~~~~~~~