18 years agoAdd a debug directory under src/test, where we will house all of our debug
Hiten Pandya [Sat, 26 Jun 2004 13:09:52 +0000 (13:09 +0000)]
Add a debug directory under src/test, where we will house all of our debug
scripts that will aid the debugging of the kernel and other code.

I have added a GDB macro set in file 'gdb.kernel' which contains some
helpful macros, such as listing processes, iterating CPU's globaldata,
a kldstat(1) style macro etc.

The 'gdb.kernel' file was written by:

Hiten Pandya <hmp@backplane.com>,
Matthew Dillon <dillon@apollo.backplane.com>

The kldstat(1) macro should be helpful with the asf(1) utility which
is used for setting the right offset to load the KLD's symbols.

18 years agoAdd a short unconditional sleep in the lockf retry path to try to
Matthew Dillon [Sat, 26 Jun 2004 08:35:15 +0000 (08:35 +0000)]
Add a short unconditional sleep in the lockf retry path to try to
avoid locking up the system when a livelock bug we are trying to track down

18 years agoUnhook bios_howmem (a simple reporting variable), it isn't ready yet.
Matthew Dillon [Sat, 26 Jun 2004 03:03:59 +0000 (03:03 +0000)]
Unhook bios_howmem (a simple reporting variable), it isn't ready yet.

18 years agoUnhook gcc-3.3 from the buildworld process. This also removes the gcc3
David Rhodus [Sat, 26 Jun 2004 02:56:48 +0000 (02:56 +0000)]
Unhook gcc-3.3 from the buildworld process. This also removes the gcc3
leftover files when `make upgrade` is run.

18 years agoAdd some early serial console debugging support to the loader. This is all
Matthew Dillon [Sat, 26 Jun 2004 02:26:22 +0000 (02:26 +0000)]
Add some early serial console debugging support to the loader.  This is all
#ifdef'd out and has no impact on normal builds.

18 years agoSome general cleanups and use M_ZERO instead of bzero() in one case
Matthew Dillon [Sat, 26 Jun 2004 02:15:16 +0000 (02:15 +0000)]
Some general cleanups and use M_ZERO instead of bzero() in one case
(not a bug).

18 years agoWhen a kernel-created thread exits, properly remove it from gd_tdallq and
Matthew Dillon [Sat, 26 Jun 2004 02:14:31 +0000 (02:14 +0000)]
When a kernel-created thread exits, properly remove it from gd_tdallq and
only queue it on gd_tdfreeq only if it was originally allocated.  Note:
kernel threads do not usually exit so this did not fix any known panics.

18 years agoCleanup a comment.
Matthew Dillon [Sat, 26 Jun 2004 02:12:49 +0000 (02:12 +0000)]
Cleanup a comment.

18 years agoIf Preposterous BIOS basemem is detected, instead of truncating to 640K
Matthew Dillon [Sat, 26 Jun 2004 02:12:08 +0000 (02:12 +0000)]
If Preposterous BIOS basemem is detected, instead of truncating to 640K
truncate to 636K in a vain attempt to be play nicer with broken BIOSES.

18 years agoAdd a signature for bootn0 so boot0cfg doesn't complain about it, even
Matthew Dillon [Sat, 26 Jun 2004 02:04:39 +0000 (02:04 +0000)]
Add a signature for bootn0 so boot0cfg doesn't complain about it, even
though it isn't hooked up to the tree yet.

18 years agoStage 1/999: Rewrite boot0 to relocate to higher memory (beyond 64K). This
Matthew Dillon [Sat, 26 Jun 2004 02:00:11 +0000 (02:00 +0000)]
Stage 1/999: Rewrite boot0 to relocate to higher memory (beyond 64K).  This
is currently a demonstration only but will become part of a larger project
to try to make our boot0,1,2/loader code more BIOS-friendly.

18 years agoMerge from FreeBSD-4, revision
Hiten Pandya [Fri, 25 Jun 2004 18:09:56 +0000 (18:09 +0000)]
Merge from FreeBSD-4, revision

1) Fixed potential problem that would cause out-of-order requests
   in twe_startio().
2) Fixed possible race condition in twe_start.

Discussed with, and tested by David Rhodus <drhodus@machdep.com>.

18 years agoRemove a vn == vp case that was breaking out of the namecache lookup loop
Matthew Dillon [Fri, 25 Jun 2004 17:37:19 +0000 (17:37 +0000)]
Remove a vn == vp case that was breaking out of the namecache lookup loop
in vn_fullpath().  This can cause a NULL pointer dereferencing panic.  This
is believed to be pre-namecache legacy code that is no longer required.

18 years agoMerge from FreeBSD-4, revision
Hiten Pandya [Fri, 25 Jun 2004 17:16:27 +0000 (17:16 +0000)]
Merge from FreeBSD-4, revision

Pin 0 on the first I/O APIC is always an ExtINT pin.  Some BIOS's are
broken and list the type of the pin as INT rather than ExtINT in the MP
Table.  To workaround, force pin 0 of ioapic 0 to be ExtINT if it is of
type INT.  This is not a MFC as -current has very different apic code now.
Current's mptable parser might need a similar workaround.

This fixes a bunch of Fujitsu machines; more information about the problem
can be viewed at:


Discussed-with:  David Rhodus <drhodus@machdep.com>
                 Matthew Dillon <dillon@backplane.com>

Test equipment was kindly provided by David Rhodus!

18 years agoFix a race in the initialisation of struct lock by moving the TAILQ_INITs
Joerg Sonnenberger [Fri, 25 Jun 2004 15:32:18 +0000 (15:32 +0000)]
Fix a race in the initialisation of struct lock by moving the TAILQ_INITs
under the protection of the pool token.

18 years agoAdd missing WI_UNLOCK
Joerg Sonnenberger [Fri, 25 Jun 2004 09:13:30 +0000 (09:13 +0000)]
Add missing WI_UNLOCK

18 years agoImplement duel-console mode and make it the default. Adjust the boot
Matthew Dillon [Fri, 25 Jun 2004 05:38:00 +0000 (05:38 +0000)]
Implement duel-console mode and make it the default.  Adjust the boot
flags to match.  -D means duel console mode (but it is now the default),
-h makes the serial console the only console, and a new option, -V, makes
the video console the only console.  Support for pre-programming the flags
in the stage1/2 boot will be added in the future.

18 years agoTurn on the DDB_TRACE config option, so that we will get a trace as soon
Hiten Pandya [Fri, 25 Jun 2004 05:09:38 +0000 (05:09 +0000)]
Turn on the DDB_TRACE config option, so that we will get a trace as soon
as we hit a panic and enter DDB.

This is the automatic equivalent of doing a manual 'tr' on DDB.

David Rhodus <drhodus@machdep.com>, Matthew Dillon <dillon@backplane.com>

18 years agoMerge rev. 1.7 of FreeBSD's src/sys/dev/twa/twa_freebsd.c.
Hiten Pandya [Fri, 25 Jun 2004 03:37:03 +0000 (03:37 +0000)]
Merge rev. 1.7 of FreeBSD's src/sys/dev/twa/twa_freebsd.c.

Fix a typo that made the busdma tag have a 0 highaddr.

18 years agoConvert the M4'd btxldr.s to a preprocessed btxldr.S (taken from FreeBSD-5)
Matthew Dillon [Fri, 25 Jun 2004 00:38:38 +0000 (00:38 +0000)]
Convert the M4'd btxldr.s to a preprocessed btxldr.S (taken from FreeBSD-5)

18 years agoBring in 1.33 from FreeBSD-5:
Matthew Dillon [Thu, 24 Jun 2004 23:31:06 +0000 (23:31 +0000)]
Bring in 1.33 from FreeBSD-5:

When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
While we end up the same place, we end up with two different CS register
values after the jump and 0xf000 is compatible with the hardware reset value.
This makes a difference if the BIOS does a near jump before a far jump.

Detective work and patch by:     Adrian Steinmann <ast@marabu.ch>

18 years agoDrop to the debugger if unable to sync out the buffers during shutdown.
David Rhodus [Thu, 24 Jun 2004 16:49:13 +0000 (16:49 +0000)]
Drop to the debugger if unable to sync out the buffers during shutdown.

18 years agoMerge from vendor branch GCC:
Joerg Sonnenberger [Thu, 24 Jun 2004 14:16:11 +0000 (14:16 +0000)]
Merge from vendor branch GCC:
This is GCC 3.4, not 3.3

18 years agoThis is GCC 3.4, not 3.3
Joerg Sonnenberger [Thu, 24 Jun 2004 14:16:11 +0000 (14:16 +0000)]
This is GCC 3.4, not 3.3

18 years agoGet rid of the PFIL_HOOKS option, integrate pfil in the system permanently.
Matthew Dillon [Thu, 24 Jun 2004 08:15:18 +0000 (08:15 +0000)]
Get rid of the PFIL_HOOKS option, integrate pfil in the system permanently.
(previously the packet filters couldn't even be kldload'd without PFIL_HOOKS).

18 years agoBackout 1.19. It prevents some machines from booting (READ timeout).
Matthew Dillon [Thu, 24 Jun 2004 07:55:26 +0000 (07:55 +0000)]
Backout 1.19.  It prevents some machines from booting (READ timeout).
I must be misinterpreting how the ATA_A_IDS bit works, or perhaps it is
a write-only bit?   I don't know.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
18 years agoThe route table treats sockaddr data as opaque, which means that the unused
Matthew Dillon [Thu, 24 Jun 2004 07:45:22 +0000 (07:45 +0000)]
The route table treats sockaddr data as opaque, which means that the unused
fields in the structure passed to rtalloc() MUST BE ZERO.

The syncache code allocates a governing struct syncache structure which
contains an embedded struct route, but it does not zero this structure.
When used in a mixed IPV4/IPV6 environment, it is possible for a structure
to be allocated for IPV4 whos unused fields for the route lookup (e.g.
sin_port and sin_zero) may contain garbage.  This screws up the route
table lookup and causes the wrong route to be returned.

I believe the proper fix in this case is to rewrite the route table code,
but since that would take a very long time the fix I am committing is
to have tcp_rtlookup() zero out the sockaddr_in before it builds it for
the rtalloc() call.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
With-help-from: Hiten Pandya <hmp@nxad.com>

18 years agoThis is less, correct name in upgrade file.
Eirik Nygaard [Wed, 23 Jun 2004 20:40:50 +0000 (20:40 +0000)]
This is less, correct name in upgrade file.

Noticed by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

18 years agoFix a broken vrele() in the session tty exit code.
Matthew Dillon [Wed, 23 Jun 2004 16:45:23 +0000 (16:45 +0000)]
Fix a broken vrele() in the session tty exit code.

Submitted-by: Joerg Sonnenberger <joerg@britannica.bec.de>
18 years agoHack in the code from FreeBSD-5 to set the timings for NVIDIA/AMD chipsets.
Matthew Dillon [Wed, 23 Jun 2004 16:15:24 +0000 (16:15 +0000)]
Hack in the code from FreeBSD-5 to set the timings for NVIDIA/AMD chipsets.
This seems to greatly reduce READ_BIG: ILLEGAL REQUEST problems accessing
a CD on my AMD64 box (NVidia3 chipset, secondary controller, master, PIO4).
The problem occurs at a much lower frequency in overnight tests.  Further
testing is ongoing.

18 years agoDo a partial synch from FreeBSD-5 of the NVIDIA and NFORCE ATA setup code.
Matthew Dillon [Wed, 23 Jun 2004 06:53:13 +0000 (06:53 +0000)]
Do a partial synch from FreeBSD-5 of the NVIDIA and NFORCE ATA setup code.
Our previous code was totally bogus.

18 years agoFix an improper DELAY in the ata tag code (but nobody should be using
Matthew Dillon [Wed, 23 Jun 2004 06:52:26 +0000 (06:52 +0000)]
Fix an improper DELAY in the ata tag code (but nobody should be using
the ata tag code anyway).

18 years agoCheck for a queued interrupt being dispatched after the ATA driver
Matthew Dillon [Wed, 23 Jun 2004 06:51:55 +0000 (06:51 +0000)]
Check for a queued interrupt being dispatched after the ATA driver
diabled the controller interrupt and return if so.  Enclose the ATA
command setup in a critical section.

18 years agoFix indentation.
Hiten Pandya [Wed, 23 Jun 2004 06:27:28 +0000 (06:27 +0000)]
Fix indentation.

18 years agoRemove references to FreeBSD in the comments.
Hiten Pandya [Wed, 23 Jun 2004 06:17:50 +0000 (06:17 +0000)]
Remove references to FreeBSD in the comments.

Discussed-with:  Matthew Dillon <dillon@backplane.com>

18 years agoUnbreak the buildworld by fixing a cc_tools dependancy on cc_prep in
Matthew Dillon [Tue, 22 Jun 2004 21:46:54 +0000 (21:46 +0000)]
Unbreak the buildworld by fixing a cc_tools dependancy on cc_prep in
Makefile.inc1 instead of trying to create a dependancy in cc_tools.  The
object tree had not yet been created for cc_prep and this caused files to
be generated in /usr/src, amoung other things.

18 years agoPerl is no longer user during kernel build, so remove the Perl scripts
Chris Pressey [Tue, 22 Jun 2004 20:51:30 +0000 (20:51 +0000)]
Perl is no longer user during kernel build, so remove the Perl scripts
that are no longer needed for this purpose.

Confirmed-with: eirikn

18 years agoMake virecover more robust. Instead of aborting (and causing
Chris Pressey [Tue, 22 Jun 2004 20:37:02 +0000 (20:37 +0000)]
Make virecover more robust.  Instead of aborting (and causing
subsequent RCNG scripts to fail) when the directory /var/tmp/vi.recover
doesn't exist, just re-create it.

Reviewed-by: eirikn, Devon H. O'Dell, GeekGod
18 years agoTurn propolice (-fstack-protector) on by default. Propolice rearranges
Matthew Dillon [Tue, 22 Jun 2004 16:40:32 +0000 (16:40 +0000)]
Turn propolice (-fstack-protector) on by default.  Propolice rearranges
the ordering of local variable declarations so pointers do not get
overwritten by buffer overflows, and checks a magic marker on return to see
if the return address has been blown away.  It's a very important security

18 years agoFix -j builds for gcc-3.4. The .nx build in cc_tools was breaking
Matthew Dillon [Mon, 21 Jun 2004 21:50:02 +0000 (21:50 +0000)]
Fix -j builds for gcc-3.4.  The .nx build in cc_tools was breaking
parallelism because individual source/header dependancies were being built
in parallel, and this was causing the helper programs to build in parallel
and/or generate the same header file in parallel.

Remove all direct dependancies on the helper programs.  Make libgcc
dependant on cc_tools (to generate required header files), clean up
the dependancy target for cc_tools, and force make depend to build
the tools in bsd.hostprog.mk.  This should result in all the tools being
available to the rest of the gcc-3.4 build.

Tested with several -j 8 builds.  There could still be additional
-j issues.

18 years agoFix -j builds for gcc-3.4. The .nx build in cc_tools was breaking
Matthew Dillon [Mon, 21 Jun 2004 21:49:13 +0000 (21:49 +0000)]
Fix -j builds for gcc-3.4.  The .nx build in cc_tools was breaking
parallelism because individual source/header dependancies were being built
in parallel, and this was causing the helper programs to build in parallel
and/or generate the same header file in parallel.

Remove all direct dependancies on the helper programs.  Make libgcc
dependant on cc_tools (to generate required header files), clean up
the dependancy target for cc_tools, and force make depend to build
the tools.  This should result in all the tools being available to the
rest of the gcc-3.4 build.

Tested with several -j 8 builds.  There could still be additional
-j issues.

18 years agoMerge with FreeBSD (HEAD) src/usr.sbin/adduser/*:
Chris Pressey [Mon, 21 Jun 2004 17:47:12 +0000 (17:47 +0000)]
Merge with FreeBSD (HEAD) src/usr.sbin/adduser/*:

Move towards Perl removal from the base by replacing the Perl scripts
`adduser' and `rmuser' with corresponding versions from FreeBSD 5
which are written in the Bourne shell.

Submitted-by: Tim Wickberg <me at k9mach3 dot org>
Additional-testing-by: William DeVries
18 years agoSome more M_NOWAIT->M_INTWAIT. Not sure if the sym changes are correct,
Matthew Dillon [Mon, 21 Jun 2004 15:45:42 +0000 (15:45 +0000)]
Some more M_NOWAIT->M_INTWAIT.  Not sure if the sym changes are correct,
but they are more correct then using M_NOWAIT.

18 years agoGeneral M_NOWAIT -> M_INTWAIT work, except in periodic timeout() routines
Matthew Dillon [Mon, 21 Jun 2004 15:39:31 +0000 (15:39 +0000)]
General M_NOWAIT -> M_INTWAIT work, except in periodic timeout() routines
which can handle occassional malloc() failures and really shouldn't block.

18 years agoCorrect a known panic in the twe driver, M_NOWAIT -> M_INTWAIT work.
Matthew Dillon [Mon, 21 Jun 2004 15:35:41 +0000 (15:35 +0000)]
Correct a known panic in the twe driver, M_NOWAIT -> M_INTWAIT work.

18 years agogcc-3.4 cleanups. missing break / goto labels.
Matthew Dillon [Mon, 21 Jun 2004 06:02:21 +0000 (06:02 +0000)]
gcc-3.4 cleanups.  missing break / goto labels.

18 years agogcc-3.4 cleanups. Add missing break statements, deal with goto labels,
Matthew Dillon [Mon, 21 Jun 2004 05:58:01 +0000 (05:58 +0000)]
gcc-3.4 cleanups.  Add missing break statements, deal with goto labels,
and adjust the use of __FUNCTION__ (string concat is no longer supported).

18 years agoAdding missing break after default: (gcc-3.4).
Matthew Dillon [Mon, 21 Jun 2004 05:31:47 +0000 (05:31 +0000)]
Adding missing break after default: (gcc-3.4).

18 years agogcc-3.4 cleanup.
Matthew Dillon [Mon, 21 Jun 2004 05:28:53 +0000 (05:28 +0000)]
gcc-3.4 cleanup.

18 years agoHook gcc 3.4 into the buildworld. Rearrange HOST_CCVER so it becomes the
Matthew Dillon [Mon, 21 Jun 2004 03:48:07 +0000 (03:48 +0000)]
Hook gcc 3.4 into the buildworld.  Rearrange HOST_CCVER so it becomes the
responsibility of the Makefile element that is overriding CCVER.  Get rid
of the obsolete MY_CCVER magic.  Fix improper use of ${.TARGET} in
cc34/cc_tools/Makefile.tools.  Do not try to override _CPUCFLAGS in
bsd.hostprog.mk, which doesn't handle the generic .nx/.no case.  Instead
remove -mtune, -mcpu, and -march options in NXCFLAGS and NXCXXFLAGS.

Work-by: Joerg Sonnenberger <joerg@crater.dragonflybsd.org>
Reviewed-by: Matthew Dillon <dillon@backplane.com>
18 years agoFix a bug in 2.95.x prototypes that prevents us from building the world with
Matthew Dillon [Mon, 21 Jun 2004 03:39:10 +0000 (03:39 +0000)]
Fix a bug in 2.95.x prototypes that prevents us from building the world with
gcc-3.4.  Note that contrib/gcc is an 'old' contrib that came before our
new 'no-touch' policy for contrib sources so we can modify it directly.

18 years agoAdd a missing break after default: for gcc-3.4 support.
Matthew Dillon [Mon, 21 Jun 2004 03:38:52 +0000 (03:38 +0000)]
Add a missing break after default: for gcc-3.4 support.

18 years agoRemove the last vestiges of -DCCVER from 2.95.x contrib so we can remove
Matthew Dillon [Mon, 21 Jun 2004 03:31:00 +0000 (03:31 +0000)]
Remove the last vestiges of -DCCVER from 2.95.x contrib so we can remove
it from the build tree.

18 years agoFix a prototype error in gcc-3.3's com.h in order to allow gcc-3.4 to compile
Matthew Dillon [Mon, 21 Jun 2004 03:25:33 +0000 (03:25 +0000)]
Fix a prototype error in gcc-3.3's com.h in order to allow gcc-3.4 to compile
it.  This is a bad hack but we are going to remove 3.3 from the tree soon

18 years ago'lrint' is a gcc3.4 builtin and gcc3.4 is unhappy if we use that for anything
Matthew Dillon [Mon, 21 Jun 2004 02:28:34 +0000 (02:28 +0000)]
'lrint' is a gcc3.4 builtin and gcc3.4 is unhappy if we use that for anything

18 years agoMerge with FreeBSD (HEAD) src/usr.sbin/kbdmap/*:
Chris Pressey [Mon, 21 Jun 2004 01:37:42 +0000 (01:37 +0000)]
Merge with FreeBSD (HEAD) src/usr.sbin/kbdmap/*:

Move towards Perl removal from the base by replacing the Perl script
'kbdmap' with the version from FreeBSD 5, which is written in C.

Submitted-by: Tim Wickberg <me at k9mach3 dot org>
Additional-testing-by: William DeVries
18 years agoCheck kp (struct kinfo_proc *kp) against NULL and not 0, because it is a
Hiten Pandya [Mon, 21 Jun 2004 01:03:06 +0000 (01:03 +0000)]
Check kp (struct kinfo_proc *kp) against NULL and not 0, because it is a

18 years agoUse the kern.boottime sysctl for retrieving the system boot time as a
Hiten Pandya [Mon, 21 Jun 2004 00:47:57 +0000 (00:47 +0000)]
Use the kern.boottime sysctl for retrieving the system boot time as a
struct timeval.  This is used to fix the STARTED column for pure kernel

Note, currently, we do not set the start time for pure threads due to
safety issues with microtime(9), although this change conditionalizes
the thread start time appropriately, so that in the future when pure
threads will account their start time, we wouldn't need to change anything
in this utility (with regard to the start time, ofcourse).

Discussed-with:  Matthew Dillon <dillon@apollo.backplane.com>

18 years agomake ==> ${MAKE} ${.TARGET}
Joerg Sonnenberger [Mon, 21 Jun 2004 00:20:33 +0000 (00:20 +0000)]
make ==> ${MAKE} ${.TARGET}

18 years agomake => ${MAKE}
Joerg Sonnenberger [Mon, 21 Jun 2004 00:03:41 +0000 (00:03 +0000)]
make => ${MAKE}

18 years agoMove the 'p_start' field from struct pstats (Process Statistics) into the
Hiten Pandya [Sun, 20 Jun 2004 22:29:10 +0000 (22:29 +0000)]
Move the 'p_start' field from struct pstats (Process Statistics) into the
thread structure and call it 'td_start'.  The behavior of vm_fork(9) is
retained, i.e., it still copies the start time from the parent process just
as it did before.

The 'td_start' will later be used by pure threads to indicate their start
time.  It has not been committed in this round because use of the microtime()
function at such a early point in the boot process might be unsafe.

Note, there should be no problem in accessing the td_start field, unless
the process is a Zombie; due to the way Zombies are reaped, the thread will
be decoupled in kern_wait1() but the process will still be around for a
while it will not be possible to access the td_start field in such
scenarios.  A little note about this has been added on top of struct proc
in <sys/proc.h> for future reference.

This work was a collaboration of Hiten Pandya <hmp@backplane.com> and
Matthew Dillon <dillon@apollo.backplane.com>

18 years agoAllow CCVER to be empty, which will cause the compiled-in default compiler
Matthew Dillon [Sun, 20 Jun 2004 22:19:51 +0000 (22:19 +0000)]
Allow CCVER to be empty, which will cause the compiled-in default compiler
to be used.

18 years agoAdd the STABS default output hack for GCC 3.4 too.
Joerg Sonnenberger [Sun, 20 Jun 2004 21:41:15 +0000 (21:41 +0000)]
Add the STABS default output hack for GCC 3.4 too.

18 years agoFor cc_tools, recurse into cc_prep when building dependencies to get
Joerg Sonnenberger [Sun, 20 Jun 2004 20:59:21 +0000 (20:59 +0000)]
For cc_tools, recurse into cc_prep when building dependencies to get
the patched source tree.
c++filt and gcov use getopt, add the libc version when bootrapping. The
source and header file is copyied by cc_prep in that situation.
Add an explicit directory order in the top-level Makefile.

18 years agoExplicitly recurse into gnu/usr.bin/cc34/cc_prep for depend to ensure
Joerg Sonnenberger [Sun, 20 Jun 2004 20:54:09 +0000 (20:54 +0000)]
Explicitly recurse into gnu/usr.bin/cc34/cc_prep for depend to ensure
that the source tree is prepared for us. This may otherwise fail for

18 years agoExport HOST_CCVER via environment to fixate it to either the specified
Joerg Sonnenberger [Sun, 20 Jun 2004 20:49:45 +0000 (20:49 +0000)]
Export HOST_CCVER via environment to fixate it to either the specified
value or the default CCVER.

18 years agoDon't include _CPUCFLAGS since the host compiler (aka NXCC) might not
Joerg Sonnenberger [Sun, 20 Jun 2004 20:41:07 +0000 (20:41 +0000)]
Don't include _CPUCFLAGS since the host compiler (aka NXCC) might not
understand them. Add HOST_CCVER which replaces CCVER for NXCC and NXCXX.
This defaults to CCVER, but can be overriden via environment e.g. from

18 years agoZero-out the whole pstats structure and then copy the relevant fields,
Hiten Pandya [Sun, 20 Jun 2004 17:44:11 +0000 (17:44 +0000)]
Zero-out the whole pstats structure and then copy the relevant fields,
instead of messing with caddr_t's and range-based zero'ing.

Discussed-with:  Matthew Dillon <dillon@backplane.com>

18 years agoZero the interval timers on fork(2) rather than copying them to the
Hiten Pandya [Sun, 20 Jun 2004 05:55:30 +0000 (05:55 +0000)]
Zero the interval timers on fork(2) rather than copying them to the
child process (SUSv3 compliance).

Discussed-with:  Matthew Dillon <dillon@backplane.com>

18 years agoHook up the asa(1) utility to the build system.
Hiten Pandya [Sun, 20 Jun 2004 02:53:19 +0000 (02:53 +0000)]
Hook up the asa(1) utility to the build system.

18 years agoAdd the POSIXv2 asa(1) utility; it interprets FORTRAN carriage-control
Hiten Pandya [Sun, 20 Jun 2004 02:52:15 +0000 (02:52 +0000)]
Add the POSIXv2 asa(1) utility; it interprets FORTRAN carriage-control

Obtained-from: FreeBSD (they imported it from NetBSD)

18 years agoHook up the recently added utilities [1] to the build.
Hiten Pandya [Sun, 20 Jun 2004 02:36:01 +0000 (02:36 +0000)]
Hook up the recently added utilities [1] to the build.

[1] = asf(1), csplit(1) and tabs(1)

18 years agoDefine __DragonFly_cc_version for CPP
Joerg Sonnenberger [Sun, 20 Jun 2004 02:22:55 +0000 (02:22 +0000)]
Define __DragonFly_cc_version for CPP

18 years agoBring in a trimmed down gcc-3.4-20040618.
Matthew Dillon [Sun, 20 Jun 2004 02:14:58 +0000 (02:14 +0000)]
Bring in a trimmed down gcc-3.4-20040618.

Submitted-by: Joerg Sonnenberger <joerg@crater.dragonflybsd.org>
18 years agoMerge from vendor branch GCC:
Matthew Dillon [Sun, 20 Jun 2004 02:14:58 +0000 (02:14 +0000)]
Merge from vendor branch GCC:
Bring in a trimmed down gcc-3.4-20040618.

Submitted-by: Joerg Sonnenberger <joerg@crater.dragonflybsd.org>
18 years agoAlways set the _CPUCFLAGS in bsd.cpu.gcc2.mk to some known, safe
Joerg Sonnenberger [Sun, 20 Jun 2004 00:43:28 +0000 (00:43 +0000)]
Always set the _CPUCFLAGS in bsd.cpu.gcc2.mk to some known, safe
value. For the !CPUTYPE || CPUTYPE==i386 case _CPUCFLAGS wasn't
reset which breaks a CCVER=gcc34 buildworld, because the default
flags for gcc34 (-mtune=pentiumpro) doesn't work for gcc2.

18 years agoUse our specs, not FreeBSD's.
Joerg Sonnenberger [Sun, 20 Jun 2004 00:20:28 +0000 (00:20 +0000)]
Use our specs, not FreeBSD's.

18 years agoManually recurse into ../cc_prepend for depend to workaround
Joerg Sonnenberger [Sun, 20 Jun 2004 00:19:51 +0000 (00:19 +0000)]
Manually recurse into ../cc_prepend for depend to workaround
buildworld issues.

18 years agoRedo the ProPolice patches, there were partly broken.
Joerg Sonnenberger [Sun, 20 Jun 2004 00:10:52 +0000 (00:10 +0000)]
Redo the ProPolice patches, there were partly broken.

18 years agoIEEE Std. 1003.1-2001 (SUSv3):
Hiten Pandya [Sat, 19 Jun 2004 22:03:08 +0000 (22:03 +0000)]
IEEE Std. 1003.1-2001 (SUSv3):

Add the tabs(1) utility.

Written by Tim J. Robbins of the FreeBSD Project.

18 years agoAdd the csplit(1) utility, which splits files based on context, as
Hiten Pandya [Sat, 19 Jun 2004 21:51:54 +0000 (21:51 +0000)]
Add the csplit(1) utility, which splits files based on context, as
specified by IEEE Std. 1003.1-2001 (SUSv3).

Written by Tim J. Robbins (tjr@) of the FreeBSD Project.

18 years agoFix GCC 3.4 build
Joerg Sonnenberger [Sat, 19 Jun 2004 20:38:22 +0000 (20:38 +0000)]
Fix GCC 3.4 build

18 years agoFix GCC 3.4 build.
Joerg Sonnenberger [Sat, 19 Jun 2004 20:36:04 +0000 (20:36 +0000)]
Fix GCC 3.4 build.

18 years agoFix compilation "Label at end of compound statement" and some missing
Joerg Sonnenberger [Sat, 19 Jun 2004 18:55:48 +0000 (18:55 +0000)]
Fix compilation "Label at end of compound statement" and some missing
prototyps / K&R style functions for GCC 3.4.

18 years agoFix a bogus type declaration to remove a compiler warning - `group'
Chris Pressey [Sat, 19 Jun 2004 17:28:28 +0000 (17:28 +0000)]
Fix a bogus type declaration to remove a compiler warning - `group'
in this case refers to a netgroup name, and should therefore be a
char * instead of a gid_t.

Requested-by: joerg
18 years agoFix GCC 3.4 build
Joerg Sonnenberger [Sat, 19 Jun 2004 17:19:50 +0000 (17:19 +0000)]
Fix GCC 3.4 build

18 years agoRemove the evil inline ==> rpcgen_inline CPP hack, rename the variable
Joerg Sonnenberger [Sat, 19 Jun 2004 16:40:36 +0000 (16:40 +0000)]
Remove the evil inline ==> rpcgen_inline CPP hack, rename the variable
properly. Use ISO C prototyps. Remove useless void casts. Do some other
style updates. Remove !defined(__DragonFly__) cases, one was checking for
__Dragonfly__, which broke buildworld with GCC 3.4. Add a break after
default: in switch statements, which is not portable and an error with
GCC 3.4 and later.

18 years agoFix an aggregious non-terminated buffer issue and also fix the retry code
Matthew Dillon [Sat, 19 Jun 2004 16:03:01 +0000 (16:03 +0000)]
Fix an aggregious non-terminated buffer issue and also fix the retry code
(the buffer was being wiped and needed to be regenerated for the retry).

Reported-by: Vincent Labrecque <vincent@psyfreaks.ca>
18 years agoFix prototype of usage().
Hiten Pandya [Sat, 19 Jun 2004 12:34:52 +0000 (12:34 +0000)]
Fix prototype of usage().

18 years agoFirst stage in cleaning the built-in pathes of gcc. Adapted patch from
Joerg Sonnenberger [Sat, 19 Jun 2004 11:13:30 +0000 (11:13 +0000)]
First stage in cleaning the built-in pathes of gcc. Adapted patch from
cc3/gcc.patch and fit directly into the patching system.

18 years agoInclude ProPolice suport for GCC 3.4.
Joerg Sonnenberger [Sat, 19 Jun 2004 10:34:17 +0000 (10:34 +0000)]
Include ProPolice suport for GCC 3.4.

Obtained-from: http://www.trl.ibm.com/projects/security/ssp

Additional files forgotten in first commit.

18 years agoInclude ProPolice suport for GCC 3.4.
Joerg Sonnenberger [Sat, 19 Jun 2004 10:30:08 +0000 (10:30 +0000)]
Include ProPolice suport for GCC 3.4.

Obtained-from: http://www.trl.ibm.com/projects/security/ssp

Adjust Makefile.langs to use the patched common.opts from cc_prep.

18 years agoCreate twed0 entries in /dev
David Rhodus [Fri, 18 Jun 2004 23:50:34 +0000 (23:50 +0000)]
Create twed0 entries in /dev

18 years agoFix installworld by making it aware of the rconfig examples.
David Rhodus [Fri, 18 Jun 2004 21:45:06 +0000 (21:45 +0000)]
Fix installworld by making it aware of the rconfig examples.

18 years agoAdd a helper utility, called asf(8): Add Symbol File.
Hiten Pandya [Fri, 18 Jun 2004 21:20:55 +0000 (21:20 +0000)]
Add a helper utility, called asf(8): Add Symbol File.

The purpose of this utility is to extract start addresses from kldstat(8)'s
output and prepare a .gdbinit style file (called .asf) with GDB commands to
load the KLD files at the right offset.

The file can then be given to the 'source' command of GDB so that it does
its magic.  This is how one can invoke the asf(8) command:

# asf -k -f -s -x /modules gdb.kldsyms.asf

Note, the '-k' output invokes kldstat(8) automatically, otherwise it
accepts kldstat(8) sytle output on stdin, which can be produced by a
gdb macro so that is is equally useful in post-crash analysis.

One needs to compile the module with debugging symbols, though.

Obtained-from: FreeBSD (CVS, MAIN branch)

18 years agoA sample rconfig script which completely wipes and reinstalls dragonfly
Matthew Dillon [Fri, 18 Jun 2004 18:36:06 +0000 (18:36 +0000)]
A sample rconfig script which completely wipes and reinstalls dragonfly
on a fresh HD.

18 years agochdir into WorkDir before running the downloaded script.
Matthew Dillon [Fri, 18 Jun 2004 04:26:53 +0000 (04:26 +0000)]
chdir into WorkDir before running the downloaded script.

Exit with an error if both -a and a list of hosts are specified on the
command line.

18 years agoWrite a remote configuration utility called 'rconfig'. This initial
Matthew Dillon [Fri, 18 Jun 2004 02:46:46 +0000 (02:46 +0000)]
Write a remote configuration utility called 'rconfig'.  This initial
implementation is very basic and designed to be convienient.  It allows a
CD user to scan the network for configuration servers, download a
configuration script based on a tag name, and execute that script all in
one simple command.  Running the rconfig server is just as easy... you
basically just run the server -a -s and put your scripts in
/usr/local/etc/rconfig/<tagname>.sh and you are done.

Of course the scripts themselves have to be written and can certainly become
quite complex.

In order to use rconfig from a CD Boot at least one network interface must
be properly configured.  The dhclient program is usually used to accomplish

18 years agoThe insn-conditions.c generated by stock GCC does some bad premature
Joerg Sonnenberger [Thu, 17 Jun 2004 23:28:39 +0000 (23:28 +0000)]
The insn-conditions.c generated by stock GCC does some bad premature
optimizations which breaks e.g. genflags. Remove this until a better
solution is found.

18 years agoDefault the MMX/XMM kernel optimizations to the on position. Also make a
David Rhodus [Thu, 17 Jun 2004 19:37:29 +0000 (19:37 +0000)]
Default the MMX/XMM kernel optimizations to the on position. Also make a
note in the loader man page that these optimizations can be turned off at
the loader by setting kern.mmxopt=1.