2. Config complains if you use -g:
Debugging is enabled by default, there is no ned to specify the -g option
3. Config warns you if you don't use -s:
Building kernel with full debugging symbols. Do
"config -s BSD" for historic partial symbolic support.
To install the debugging kernel, do make install.debug
(BSD was the name of the config file I used; I print out the same
name).
4. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 and config to
work if a kernel name other than 'kernel' is specified. This is
not absolutely necessary, but useful, and it was relatively easy.
I now have a kernel called /crapshit :-)
5. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 "clean" target
to remove both the debug and normal kernel.
6. Modify all to install the stripped kernel by default and the debug
kernel if you enter "make install.debug".
7. Update version number of Makefiles and config.
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.
candidate for this is "npx0", more are likely to follow.
Check for pseudo-devices that are being configured, but don't appear
in any "files" file. The ``pseudo-device bpf 2'' already hit me too
often.
and the kernel will have a 'config interface version number'. If an
incompatable change is made to the kernel that requires a rebuild of
config(8) (such as the cam devtab stuff), then the version number would be
bumped in both places. If a user neglects to rebuild config, then they
will get a nagging (but non-fatal) warning that they need to rebuild
config.
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!
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)
the profiling level in config and decide what to do in makefiles.
Makefile.i386:
Align functions to 16-byte boundaries if profiling is enabled. This
will allow a fourfold reduction in the size of the profiling buffers.
looking at a high resolution clock for each of the following events:
function call, function return, interrupt entry, interrupt exit,
and interesting branches. The differences between the times of
these events are added at appropriate places in a ordinary histogram
(as if very fast statistical profiling sampled the pc at those
places) so that ordinary gprof can be used to analyze the times.
gmon.h:
Histogram counters need to be 4 bytes for microsecond resolutions.
They will need to be larger for the 586 clock.
The comments were vax-centric and wrong even on vaxes. Does anyone
disagree?
gprof4.c:
The standard gprof should support counters of all integral sizes
and the size of the counter should be in the gmon header. This
hack will do until then. (Use gprof4 -u to examine the results
of non-statistical profiling.)
config/*:
Non-statistical profiling is configured with `config -pp'.
`config -p' still gives ordinary profiling.
kgmon/*:
Non-statistical profiling is enabled with `kgmon -B'. `kgmon -b'
still enables ordinary profiling (and distables non-statistical
profiling) if non-statistical profiling is configured.
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.
/*
* filename [ standard | optional ] [ config-dependent ]
* [ dev* | profiling-routine ] [ device-driver] [ no-obj ]
* [ compile-with "compile rule" [no-implicit-rule] ]
* [ dependancy "dependancy-list"]
*/
I added
no-obj - This entry does not create anything linkable to the kernel.
dependancy - Add additional dependancy rules to a target.
no-implicit-rule - Don't assume .c -> .o type rules. Config is really
dumb in this area and assumes that everything is a .c file
irregarless of extention. This was the best choice really
since there may even be .c file that you don't want to follow
the standard rules.
This was all done so that the building to the aic7770 assembler and using
the aic7770 assembler in the building of the aic7770 driver could be config
dependant. I can now have an entry like this for the driver:
aic7770 optional ahc device-driver \
compile-with "${CC} $> -o $@" \
dependancy "$S/gnu/misc/aic7770/aic7770.c" \
no-obj no-implicit-rule
aic7770_seq.h optional ahc device-driver \
compile-with "${.CURDIR}/aic7770 -o $@ $S/gnu/misc/aic7770/aic7770.seq"\
dependancy "$S/gnu/misc/aic7770/aic7770.seq aic7770" \
no-obj no-implicit-rule
i386/isa/aic7770.c optional ahc device-driver \
dependancy "aic7770_seq.h"
I also added '\' escaping to newlines so that this doesn't look as gross as
it could have.
Reviewed by: jkh
/usr/src/usr.sbin.config:
o -DSTATCLOCK gives kludges to support the rtc non-device as well as
old kludges to support the clk non-device.
/usr/src/usr.sbin/config.8:
o Document the trivialness of the new vector.h.
/usr/src/usr.sbin/mkglue.c:
o Only print DEVICE_NAMES and NR_DEVICES in vector.h. These are
only required to support vmstat. The vmstat interface will need
to be improved for dynamic loading.
/usr/src/usr.sbin/mkioconf.c:
o Print device ids to be used as indexes into DEVICE_NAMES.
o Print secondary interrupt handler entry points (xxxintr()) instead
of primary ones (VdevU()). Primary ones are now XintrI() and
XfastintrI() and are independent of the config so they are not
handled here.
o Minor cleanups.
Submitted by: Bruce Evans