Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 1998 20:49:52 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        jkh@time.cdrom.com (Jordan K. Hubbard)
Cc:        itojun@itojun.org, hackers@FreeBSD.ORG, tech-jp@jp.freebsd.org
Subject:   Re: new config
Message-ID:  <199806092049.NAA09520@usr04.primenet.com>
In-Reply-To: <2238.897372943@time.cdrom.com> from "Jordan K. Hubbard" at Jun 8, 98 11:15:43 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > 	If something is already decided about this topic, please give me
> > 	some pointer for the discussion archive.  I do not want to spend
> > 	my time to this, if it will never be merged into.
> 
> Well, every time this comes up, a number of folks chime in with "but
> config(8) is fundamentally WRONG!  We must get rid of it entirely, not
> upgrade it!" and it is my suggestion that you simply ignore all of
> those people and go right on ahead with this idea.
> 
> The reason I suggest ignoring them has to do with the fact that it's
> exceedingly easy to point out the flaws in config(8) but obviously not
> so easy to architect a complete replacement or someone would have done
> so by now.  Note that I'm not even talking about an implementation,
> I'm talking about a reasonable attempt to even _architect_ such a
> thing.  I've seen many a pie-in-the-sky treatise go by about how
> things ought to work, but not much which really went into significant
> detail on how a migration away from config(8) should be done and a
> sample timeline showing which tasks will need to be done and in what
> order.

1)	Commit the ELF/a.out bootblock changes, the location of which
	was posted to the -current list some time ago.

	Yes, I know this leaves only 28 bytes and you have to disable
	the spashkit and the bad144 to build blocks that can boot both
	a.out and ELF kernels.  I don't care.  The bootblock issue is
	a boondoggle.  It will go away when the a.out code is removed.

	The problem of bootblock size can be dealt with later; it won't
	hurt to put it off indefiniately, since it's been being put
	off since October of 1993 anyway.

2)	Switch -current to ELF by default.

	You shouldn't be running -current unless you are either
	participating in or testing active developement work.  ELF
	is active developement work.  Switching -current to ELF
	*now* is within the charter for -current, as well as being
	a good idea: shake out the ELF problems *now*, not just
	prior to 3.0R, or you will regret it (the shakeout *must*
	occur; whether this happens before or after 3.0 is released
	is up to the people with commit priviledges).

3)	Load only specifically attributed ELF sections.

	Section attribution via #pragma, ala MS Visual C++, was added
	by Cygnus support a while back, in their support of compilation
	of WIN32 programs using gcc.

	In general, these are sections marked "preload" by the
	compiler that you would be loading.

	The ELF bootblock can aready do this; they don't load debug
	sections, AFAIR.

4)	Transition linker sets to inter-section loader agregates
	instead of true linker agregation.

	This will allow "sysinit" set elements to live in seperate
	ELF sections, yet function as if they were statically linked.

	I will be happy to help with this, but it's not brain surgery,
	and it's an obvious win for supporting pure virtual bas classes
	and Templates in ELF C++.  You might even convince the Linux
	people to do the work for you...

5)	Seperately attribute sections by driver name.

	Cygnus Support added this, as well, in support of the ability
	to develope WIN32 DLL's, COM modules, Active X components,
	and Windows 95/NT Virtual Device Drivers (VxD's).

	At this point, it is the job of an image archiver, *not* a
	linker, to "aggregate" drivers into the kernel image.  The
	changes in (3), above, allow this to work.

	Basically, this is going through all the drivers and adding
	the appropriate "#pragma"'s to them.

6)	Make room in the bootblocks.

	The simplest method would be to delete the a.out code.  If
	someone doesn't want this to happen, then that "someone"
	should implement a three stage boot loader to resolve the
	problem, or the "someone" can lump it over the fact that
	their a,out kernels will no longer load.

7)	Add code to the bootblocks to load the elf sections from
	multiple files.

	Instead of just the kernel file itself, a "/modules/active"
	directory containing discrete ELF modules (or call it whatever
	the hell is the most politically correct thing to call it, I
	don't care) is scanned, and all ELF images sections that meet
	the criteria in (3), above, are loaded.  Now adding a commercial
	driver is as simple as copying an ELF module into a directory.

	This implies a number of small changes to the kernel build
	process; specifically, it implies the use of "ld -r" to make
	drivers atomic, single-file ELF objects.  This is trivial to
	do, since the "-r" option is already supported by the binutils
	linker.

8)	Write a small program that knows how to make hard links
	between "/modules/installed/xyz" and "/modules/active/xyz".

	Call the damn thing "config", if you want, so long as it
	routes around the political (rather than techinical) opposition.

9)	Delete the original "config" program, since there is no longer
	any reason to perform variant builds.

	If you need a variant build, implement it semantically by
	providing a different module for each variation of the
	build, and making the apropriate hard links.  Voila, no more
	variant builds, only variant modules.

10)	Allow seperate sections to be discarded, and the pages used
	recovered, by the kernel.

	This is VM work, and need John Dyson or some other masochist
	like John to work on it.  It is fundamentally kernel paging
	support.

	You will need to support the #pragma assigned "non-pageable"
	attribute at this point.  You should also suppoirt the
	attribute "initialization" and/or "discardable".

11)	Utilizing the facilities above, remove the need for dealing
	with the hard link management program from (8), above.

	This is accomplished by utilising the code changes in (10)
	to support:

	a)	Fallback drivers, which are replaced when specific
		hardware is claimed by another driver.

	b)	Loading of probe code seperate from other code,
		attempting the probe, and unloading the probe code if
		the probe fails.  If the probe succeeds, then the
		rest of the driver is loaded, and the device is
		attached.  And once again, the probe code is discarded.

12)	Delete the hard link management program.

	It's no longer necessary.  All installed drivers can be
	marked as "active".  Now there is no such thing as "config"
	in any way, shape, or form.

13)	Use "install"/"uninstall" to configure code.

	For PCI and other devices with generically discernable vendor
	ID's, you can put up "new hardware found, install driver?"
	requesters.


2 Bonus points

14)	Document and firm up the interfaces used by drivers.

	Ideally, this will conform to the SCO/Novell/Sun driver
	framework so that FreeBSD can use driver disks supplied
	by hardware vendors.

15)	Implement a VxD environment emulation.

	This will allow use of NT miniport drivers.  If done right,
	you will be able to use drivers for PPC and Alpha hardware,
	as well.


> If the new-paradigm weenies also want to use that as a
> sufficient goad to get them to really implement a complete
> replacement, then that's pretty much a win too since nothing else
> seems to be motivating them these days.


Please talk to the Johns (Polstra/Birrell) about starting on this
list; specifically, someone with commit priviledges should commit
the existing code that implements #1 on this grocery list some time
very soon.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806092049.NAA09520>