Commit Graph

29 Commits

Author SHA1 Message Date
Matthew Dillon
66a11b9fb1 Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after:	1 week
2001-12-09 01:57:09 +00:00
Peter Wemm
4336b13f61 Untangle some special magic that happened for conflicting defintions for
local files.* and options.* files on the third pass.
2001-02-28 02:07:47 +00:00
Peter Wemm
2db1cff10d Collect together a handful of copies of the option generator code into a
single newopt(char *name, char *value) function.  Change newdev() to
do the same thing rather than depending on the evil 'cur' device hack.
2001-02-22 03:40:50 +00:00
Peter Wemm
68f4fced95 ${BDECFLAGS} work. And fix a real error in the process. A "MAXUSERS"
string could have been passed to free();  There are some warnings here
I am not sure how to fix as they are in the lex scanner code, etc.
2001-02-19 04:43:21 +00:00
Peter Wemm
3b10a240e5 Remove the need to list each and every cpu platform. Config will now
take your word for the 'machine' switch.
2001-02-04 13:17:38 +00:00
Peter Wemm
ace858085f Redo the stray header file cleanup code to not depend on timestamps
or access times or anything.  Just bite the bullet and keep a list of
header files that we know about.
2001-01-31 08:42:35 +00:00
Benno Rice
9abfa9d14b Add support for configuring PowerPC kernels.
Reviewed by:	peter
2001-01-22 12:10:45 +00:00
Peter Wemm
10ca19cf93 Implement option strings that we can use in #ifdefs (where unavoidable)
as a replacement for the evil #define NFOO.  If 'device npx' is in the
static kernel, a synthetic option '#define DEV_NPX 1' will be available
to stick in an opt_xxx.h file.  "#if NNPX > 0" can be replaced with
"#ifdef DEV_NPX" and we can get rid of the overloaded meaning of the
device count mechanism.
2001-01-19 12:49:21 +00:00
Warner Losh
faa913d76d Fix buffer overflows in filenames. If you had a path > 80 characters
for your /usr/obj/path/to/my/files path to the kernel, then weird
things happened.  make buildkernel would fail because config was
dumping core or generating bad file names (depending on the lenght of
the path).

While I was here, also use strlcpy, strlcat and snprintf (or asprintf)
as necessary.  Minor format policing for the snprintf calls as well.
2000-11-21 19:58:55 +00:00
Doug Rabson
918c9eec57 Add ia64 support. 2000-09-29 13:36:47 +00:00
Peter Wemm
f71c01cc52 Borrow phk's axe and apply the next stage of config(8)'s evolution.
Use Warner Losh's "hint" driver to decode ascii strings to fill the
resource table at boot time.

config(8) no longer generates an ioconf.c table - ie: the configuration
no longer has to be compiled into the kernel.  You can reconfigure your
isa devices with the likes of this at loader(8) time:
  set hint.ed.0.port=0x320

userconfig will be rewritten to use this style interface one day and will
move to /boot/userconfig.4th or something like that.

It is still possible to statically compile in a set of hints into a kernel
if you do not wish to use loader(8).  See the "hints" directive in GENERIC
as an example.

All device wiring has been moved out of config(8).  There is a set of
helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98)
that extract the 'at isa? port foo irq bar' from the old files and produces
a hints file.  If you install this file as /boot/device.hints (and update
/boot/defaults/loader.conf - You can do a build/install in sys/boot) then
loader will load it automatically for you.  You can also compile in the
hints directly with:  hints "device.hints"  as well.

There are a few things that I'm not too happy with yet.  Under this scheme,
things like LINT would no longer be useful as "documentation" of settings.
I have renamed this file to 'NOTES' and stored the example hints strings
in it.  However... this is not something that config(8) understands, so
there is a script that extracts the build-specific data from the
documentation file (NOTES) to produce a LINT that can be config'ed and
built.  A stack of man4 pages will need updating. :-/

Also, since there is no longer a difference between 'device' and
'pseudo-device' I collapsed the two together, and the resulting 'device'
takes a 'number of units' for devices that still have it statically
allocated.  eg:  'device fe 4' will compile the fe driver with NFE set
to 4.  You can then set hints for 4 units (0 - 3).  Also note that
'device fe0' will be interpreted as "zero units of 'fe'" which would be
bad, so there is a config warning for this.  This is only needed for
old drivers that still have static limits on numbers of units.
All the statically limited drivers that I could find were marked.

Please exercise EXTREME CAUTION when transitioning!

Moral support by: phk, msmith, dfr, asmodai, imp, and others
2000-06-13 22:28:50 +00:00
Peter Wemm
3f664fc689 A checkpoint of a part of a work-in-progress. Some more cleanups for
config(8).  This commit allows control of the creation of the
#include "foo.h" files.  We now only create them explicitly when needed.
BTW; these are mostly bad because they usually imply static limits on
numbers of units for devices.  eg: struct mysoftc sc[NFOO];
These static limits have Got To Go.
2000-06-10 22:13:40 +00:00
Bruce Evans
838aeb6957 Remove even known options if they are in the wrong options header. This
fixes movement of options.  Stale copies were left behind.
2000-01-09 12:52:01 +00:00
Peter Wemm
b5cda9cb3c Support getting *.$MACHINE from sys/conf as well as sys/$MACHINE/conf.
This would mean that we could move files.alpha, files.i386, files.pc98
etc all next to conf/files, and the various Makefiles next to each
other.  This should go a long way towards committers "seeing" the
Alpha etc stuff and remembering to update that too as it would be
right next to the i386 config files.  Note this does not include
the GENERIC etc files as they can't be shared.  I haven't actually
moved the files, but the support is here for it.  It still supports
the per-machine conf directories so that folks working on a new arch
can just distribute a subdir of files.
2000-01-08 16:48:12 +00:00
Bruce Evans
ab55b0e78f Fixed removal of unknown options. For options files with only a single
known option, unknown options following the known option were not
removed.  Now I think only unknown options in unknown options files
are not removed.  This is harmless because unknown options files should
not be used, but removing the files would be cleaner.
2000-01-08 14:34:50 +00:00
Peter Wemm
1c56dc3655 Further cleanup. Also remove the following unused or defunct tokens:
and, bio, cam, master, minor, net, priority, sequential, size, slave, trace
1999-10-10 17:36:11 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Peter Wemm
02e7144a4e Detect and remove defunct or unknown options from opt_*.h files. This
can happen when options are removed from the options files.
1999-07-01 16:17:13 +00:00
Peter Wemm
96217b0fbc More cleanups, tweaks and features.
- make this work:   options FOO123=456   *without quotes*
- grumble (but accept) vector xxxintr, and tty/net/bio/cam flags.
- complain if a device is specified twice (eg: 2 x psm0)
- don't require quotes around:  port IO_COM2
- recognize negative numbers.  (ie: options CAM_DEBUG_UNIT=-1)
- GC some more unused stuff (we don't have composite disks from config(8)).
- various other nits (snprintf paranoia etc)
1999-04-24 18:59:19 +00:00
Peter Wemm
e6fbbbe459 Further cleanups. i386_ioconf.c and alpha_ioconf.c were essentially the
same and were merged into a single newbus_ioconf.c.  CG'd some more unused
code.
1999-04-18 13:36:29 +00:00
Peter Wemm
188334f6de Get out the blow torch and hack away all the unused stuff. Note that
I zapped the MACHINE_MIPS stuff, it isn't likely to be useful apart from
recognition of the machine name.  It would be reasonable to expect new
ports would look something like the alpha/i386 from a config perspective.
1999-04-17 14:41:41 +00:00
Bruce Evans
8778add542 Convert the maxusers directive to a normal MAXUSERS option (normally
define MAXUSERS in opt_param.h as directed in /sys/conf/options;
if it's not mentioned there, then define it in IDENT; never define
it in PARAM).  MAXUSERS probably should be a completely normal option.

Don't define PARAM now that it is empty.

Cleaned up similar conversion of cpu directives to XXX_CPU options.
1998-07-12 08:10:33 +00:00
Bruce Evans
d8dd03ae32 Warn about redefined options. Keep using the last value processed.
Options are processed reverse file order, so the first definition in
the config file wins (except for directives that are converted to
option).
1998-07-12 02:31:08 +00:00
Philippe Charnier
d58316915f Use err(3), add usage(). -Wall clean. 1997-09-15 06:37:10 +00:00
Joerg Wunsch
5bd7b80934 Part #2 of the config cleanup. More aggressive, replaced an NIH
version of strdup() by a macro, killed many calls to strdup(), thus
potentially wasting less malloc'ed space (their args were never be
free()ed desptie despite of being malloc'ed).  Probably still a huge
memory leak at all...  Also killed two totally useless variables.

I've tested it as i could, but wouldn't be surprised if unexpected
problems showed up.  So watch out this space!
1996-12-14 19:53:49 +00:00
Joerg Wunsch
f0b48d9876 Round #1 of cleaning up the config(8) mess. This is only the more
conservative part of the tidyup, like fixing potential buffer overflow
conditions.  It is believed to be safe to go into 2.2.

Pointed out by:	lozenko@cc.acnit.ac.ru (Evgeny A. Lozenko)
1996-12-14 19:44:13 +00:00
Poul-Henning Kamp
1d95dc910b Backout yacc changes. 1996-06-02 17:22:01 +00:00
Poul-Henning Kamp
829bde8e5b yacc rule changes. 1996-05-30 23:16:31 +00:00
Peter Wemm
6d41b96fd7 Implement support for conf/options and i386/conf/options.i386
Note that this code is dormant unless the options files exist.
Also, parsing of quoted options in the config files is improved.

What this allows, is all the options in LINT to be specified to be
configured as #defines in a file rather than on the CC command line at
kernel build time.  This means that 'make depend' will catch dependencies
on actual *options*, meaning that you can run 'config' and 'make depend'
in complete safety WITHOUT removing the compile directory each time.

Unfortunately, this requires a pass over the source to get the individual
files to #include the new .h files that would be generated by config.
This has a small compile time penalty (appears up to about 2% slower)
from a "fresh" build.  Of course, you should not be needing to do complete
rebuilds very often once this was completed, so it would be an overall
win for most people.

Since this code is dormant and we've got a lot of other things happening
on the kernel tree at the moment (prototypes, devfs, static declarations
etc) I am not planning on doing any changes to activate this feature just
yet.
1995-12-11 10:52:34 +00:00