Subject: suggested enhancements for the i386 boot mechanisms
To: None <port-i386@NetBSD.ORG>
From: Luke Mewburn <lm@cs.rmit.edu.au>
List: port-i386
Date: 02/04/1998 12:00:48
Something I've wanted for ages was the ability to configure the boot
mechanism of the i386, giving us some of the functionality of the boot
proms on workstations; namely the ability to set variables that affect
the boot operation.

Using what I'm familiar with (openprom), I believe the second stage
boot program should have the following commands added:
	printenv
	setenv var value
	unsetenv var

At least the following variables should be supported:
	var		default 	description
	---		-------		-----------
	console		kbd		use device for input and output
					supported values:
						kbd	pc k/b & vga card
						com0	com0
						com1	com1
						com2	com2
						com3	com3

	com0-mode	9600,8,n,1	settings of com0. elements are:
						baud,#bits,parity,#stop

					baud	110, 300, 1200, 2400, 4800,
						9600, 19200, 38400, 57600,
						115200
					#bits	5, 6, 7, 8
					parity	n (none), e (even), o (odd)
					#stop	1 (1), . (1.5), 2 (2)

	vga-mode	vga		type of video:
						mono	old mono card
						vga	vga 80x24
						vga43	vga 80x43

	com1-mode	9600,8,n,1	as per com0-mode
	com2-mode	9600,8,n,1	as per com0-mode
	com3-mode	9600,8,n,1	as per com0-mode

	auto-boot?	true		if true, boot automatically.  values:
						true
						false

	boot-device	(see text)	device to look for 2nd stage boot
					and kernel on. default is where 1st
					stage boot came from. format: xxNs
					(e.g., sd0a, wd0f, ...)

	boot-file	netbsd		kernel to boot.

					XXX: how do we support a list of
					kernels to try (netbsd.gz, netbsd.old,
					etc)
				
	security-mode	none		security level. values:
					none	no security
					command	all commands except boot
						(without args) require
						password

	security-passwd	(no default)	password for security-mode

There's an issue on where to store the variables; all in first stage
boot, all in second stage boot, or split as appropriate. The console
stuff should be available to the first stage boot, so all of the
messages generated by the second stage boot go to the right place.
Thoughts?

Installboot shouldn't trash the variables defined, but maybe there
should be an option to install a set of defaults.

Other potential enhancements include:
	* more detailed help
	* simple editing commands
	* enhanced `ls' (with nicer formatting, sorting, etc. it's
	  not difficult, doesn't take too much code, and is *much*
	  friendlier to the user)
	* completion for command words and directories (maybe)
	* supporting net booting from bios bootblock? maybe vice-versa