Commit Graph

95 Commits

Author SHA1 Message Date
Peter Wemm
d061973c76 Create a special option file "opt_global.h" which is included by all
source files via a 'cc -include opt_global.h ...' type arrangement.
This means we can untangle certain header files.

options.i386 has a placeholder until it has a real member so we can avoid
having to teach config about it just yet.

Reviewed by: bde
1997-04-27 20:01:47 +00:00
John Polstra
9081eec1fb Make the necessary changes so that an ELF kernel can be built. I
have successfully built, booted, and run a number of different ELF
kernel configurations, including GENERIC.  LINT also builds and
links cleanly, though I have not tried to boot it.

The impact on developers is virtually nil, except for two things.
All linker sets that might possibly be present in the kernel must be
listed in "sys/i386/i386/setdefs.h".  And all C symbols that are
also referenced from assembly language code must be listed in
"sys/i386/include/asnames.h".  It so happens that failure to do
these things will have no impact on the a.out kernel.  But it will
break the build of the ELF kernel.

The ELF bootloader works, but it is not ready to commit quite yet.
1997-04-22 06:55:47 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Bruce Evans
c08d58eade Moved nonstandard compiler profiling options out of config. Just print
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.
1996-12-13 12:46:28 +00:00
Bruce Evans
f5227a832c Compile genassym without -static (undo rev.1.20). The default can be
depended on now, and linux_genassym has depended on it for a long time.
1996-11-06 14:56:11 +00:00
Bruce Evans
9e72552ff0 Centralized the definition of CWARNFLAGS into bsd.kern.mk. 1996-10-08 22:09:03 +00:00
Bruce Evans
e2e0d560a2 Added -I- to ${INCLUDES}. This makes 4.4Lite's (mis?)use of "foo.h"
for headers in the compile directory work unsurprisingly.  Without
-I-, the search for "foo.h" begins in the directory of the file
that includes it, and the compile directory is only searched because
`-I.' is in ${INCLUDES}.

Removed -I$S/sys from ${INCLUDES}.  It was once necessary to find
things like "param.h" in $S/sys.  Now <sys/param.h> is found in $S.
1996-09-27 16:34:16 +00:00
Bruce Evans
09a8dfa260 Don't depend in the kernel on the gcc feature of doing arithmetic on
pointers of type `void *'.  Warn about this in future.
1996-08-31 14:48:13 +00:00
Andrey A. Chernov
d17e5f0b6f Add /usr/sbin to sysctl because /usr/sbin not in standard path 1996-08-21 16:31:34 +00:00
Gary Palmer
a01e62f093 Add -Wunused to try and catch any future offenders
Reviewed by:	bde
1996-06-12 05:54:46 +00:00
Jordan K. Hubbard
43b74d6191 Bring back the `config file in the kernel' feature from the 1.x days. This
is conditionalized by the INCLUDE_CONFIG_FILE option in your kernel config
file and is not turned on by default.

Submitted-By: Bill Pechter <pechter@shell.monmouth.com>
1996-06-08 23:27:16 +00:00
Peter Wemm
fd54183bb9 Instead of: cpp blah file.s | as -o file.o, use instead:
cc -c -x assembler-with-cpp -o file.o file.s.

This means that any cpp fatal errors will now be detected, as well as
running *.s files through an ansi cpp instead of a traditional cpp.

(fixes to allow *.s to compile under both ansi and traditional to follow)
1996-05-31 01:01:24 +00:00
Wolfram Schneider
9fb933075e `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
Joerg Wunsch
1c393ef6fb Replace the dependency of install' from kernel' by a test for the
existance fo `kernel'.

Submitted by:	peter
1996-05-02 21:40:50 +00:00
Poul-Henning Kamp
e911eafcba removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
        ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
        NPDEPG

Major macro cleanup.
1996-05-02 14:21:14 +00:00
Joerg Wunsch
d5d7648201 Make install' depend on kernel'. Some idiot tried to install a
non-built kernel and complained in Usenet... :-)
1996-04-27 07:30:49 +00:00
Peter Wemm
6386a7e079 When doing a 'make depend', dont blow away the existing .depend until
the generation of a new one is complete.
1996-03-30 14:57:02 +00:00
Bruce Evans
1d4bbd7d60 Added necessary quotes (${CPP} might have spaces in it). Removed
unnecessary quotes.
1996-03-29 14:08:30 +00:00
Peter Wemm
d66a506616 Mega-commit for Linux emulator update.. This has been stress tested under
netscape-2.0 for Linux running all the Java stuff.  The scrollbars are now
working, at least on my machine. (whew! :-)

I'm uncomfortable with the size of this commit, but it's too
inter-dependant to easily seperate out.

The main changes:

COMPAT_LINUX is *GONE*.  Most of the code has been moved out of the i386
machine dependent section into the linux emulator itself.  The int 0x80
syscall code was almost identical to the lcall 7,0 code and a minor tweak
allows them to both be used with the same C code.  All kernels can now
just modload the lkm and it'll DTRT without having to rebuild the kernel
first.  Like IBCS2, you can statically compile it in with "options LINUX".

A pile of new syscalls implemented, including getdents(), llseek(),
readv(), writev(), msync(), personality().  The Linux-ELF libraries want
to use some of these.

linux_select() now obeys Linux semantics, ie: returns the time remaining
of the timeout value rather than leaving it the original value.

Quite a few bugs removed, including incorrect arguments being used in
syscalls..  eg:  mixups between passing the sigset as an int, vs passing
it as a pointer and doing a copyin(), missing return values, unhandled
cases, SIOC* ioctls, etc.

The build for the code has changed.  i386/conf/files now knows how
to build linux_genassym and generate linux_assym.h on the fly.

Supporting changes elsewhere in the kernel:

The user-mode signal trampoline has moved from the U area to immediately
below the top of the stack (below PS_STRINGS).  This allows the different
binary emulations to have their own signal trampoline code (which gets rid
of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so
that the emulator can provide the exact "struct sigcontext *" argument to
the program's signal handlers.

The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which
have the same values as the re-used SA_DISABLE and SA_ONSTACK which are
intended for sigaction only.  This enables the support of a SA_RESETHAND
flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal
semantics where the signal handler is reset when it's triggered.

makesyscalls.sh no longer appends the struct sysentvec on the end of the
generated init_sysent.c code.  It's a lot saner to have it in a seperate
file rather than trying to update the structure inside the awk script. :-)

At exec time, the dozen bytes or so of signal trampoline code are copied
to the top of the user's stack, rather than obtaining the trampoline code
the old way by getting a clone of the parent's user area.  This allows
Linux and native binaries to freely exec each other without getting
trampolines mixed up.
1996-03-02 19:38:20 +00:00
Peter Wemm
0f7183ad60 Also move /var/db/kvm_kernel.db to /var/db/kvm_kernel.old.db IF we change
sysctl kern.bootfile - since libkvm expects it there.
1996-01-08 03:55:36 +00:00
Poul-Henning Kamp
3b3f55c76f Only change the sysctl variable if it presently points to /kernel. 1996-01-07 22:31:27 +00:00
Garrett Wollman
b6794438ad Delete a couple of unnecessary dependencies on Makefile. 1996-01-05 18:30:10 +00:00
Bruce Evans
62394a63c8 Removed almost all traces of libkern.a. The objects that were in
libkern.a are now specified by listing their source files in
files.${MACHINE}.  The list is machine-dependent to save space.
All the necessary object for each machine must be linked into the
kernel in case an lkm wants one.
1995-12-26 13:58:31 +00:00
Bruce Evans
a5db65d39f Added `-Wstrict-prototypes -Wmissing-prototypes' to CWARNFLAGS so that
prototypes don't go missing again.  Also added -Winline so that some
doubtful (non-)inlines get fixed.

bsd.kmod.mk:
Also added `-Wreturn-type -Wimplicit -Wnested-externs' to catch up
with the kernel.
1995-12-16 01:57:25 +00:00
David Greenman
82faa9875a i386 is defined by the compiler, so don't define it here. LOAD_ADDRESS
is only used in the Makefile, so don't define it in CFLAGS.
1995-11-19 19:49:43 +00:00
Peter Wemm
30a4b938d0 Add a DRIVER_S= definition that config wants to use for assembler
source.  This was copied from NORMAL_S..
1995-11-01 15:03:02 +00:00
Guido van Rooij
026d3dc8e3 When moving kernel to kernel.old, also change kern.bootfile.to
kernel.old. This is a solution for only the first install
on a running system, but it's better than it is now.
1995-10-30 20:20:49 +00:00
David Greenman
c91d636e6f Use the new config(8) %SFILES token to auto-generate the SFILES list.
Note: THIS REQUIRES THAT YOU REBUILD CONFIG(8)!!!
1995-10-29 11:10:53 +00:00
Bruce Evans
8c13738f38 Make everything except the unsupported network sources compile cleanly
with -Wnested-extern.
1995-08-16 16:11:48 +00:00
Bruce Evans
5542b158d8 Fix clean rule to remove remove everything that isn't created by config
except .depend and `version'.
1995-07-22 23:55:41 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Garrett Wollman
1d86aba60b Make `make links' work by leaving swapkernel.c off out of the links processing
(it is never generic).
1995-05-11 19:48:45 +00:00
Nate Williams
070e3ec139 Modify behavior of INCLUDES to never look in /usr/include unless we
can't find the src/include directory.

Reviewed by:	"Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
Submitted by:	Mike Pritchard <pritc003@maroon.tc.umn.edu>
1995-04-05 04:10:58 +00:00
Nate Williams
146e71662f Added -I/usrinclude to the tail end of the INCLUDES line. This hack
will cause kernel compiles to work even if the src/includes directory
doesn't exist but still do the 'Right Thing' and pull files from the
source tree if it does exist.

Reviewed by:	Bruce Evans
1995-04-03 01:13:50 +00:00
Bruce Evans
ce7c8b00ff CVS:
Enable -Wimplicit again.
bash: /src/z1: No such file or directory
1995-03-28 08:02:37 +00:00
Bruce Evans
8e4150e95a Reviewed by:
Submitted by:
Obtained from:

Disable previous change.  I missed a lot of implicit declarations.
1995-03-25 23:21:36 +00:00
Bruce Evans
feae7fb7d3 Add -Wimplicit to ${CWARNFLAGS} so that implicitly declared functions
don't come back.  There are still a few for unsupported network protocols.
1995-03-25 17:50:19 +00:00
David Greenman
403ef252fa Removed obsolete vtrace() remnants. 1995-03-04 03:24:45 +00:00
Justin T. Gibbs
0bf316f5ac Fix "dependency" spelling error. Implement "clean" entries for device
config entries.  Add clean rules to aic7xxx and aic7xxx_seq.h.

Submitted by: Pointed out by Bruce Evans <bde@zeta.org.au>
1995-03-01 10:08:07 +00:00
Bruce Evans
c5489d9047 Use relative include path and -nostdinc avoid getting anything from
/usr/include.
1995-02-26 05:05:53 +00:00
Poul-Henning Kamp
50bd4cabd3 Pass '-m' to symorder. Kernels without INET will fail otherwise. 1995-01-29 23:42:11 +00:00
Bruce Evans
b5d89ca8ad Load the kernel symbol table in the boot loader and not at compile time.
(Boot with the -D flag if you want symbols.)

Make it easier to extend `struct bootinfo' without losing either forwards
or backwards compatibility.

ddb_aout.c:
Get the symbol table from wherever the loader put it.
Nuke db_symtab[SYMTAB_SPACE].

boot.c:
Enable loading of symbols.  Align them on a page boundary.  Add printfs
about the symbol table sizes.
Pass the memory sizes to the kernel.
Fix initialization of `unit' (it got moved out of the loop).
Fix adding the bss size (it got moved inside an ifdef).
Initialize serial port when RB_SERIAL is toggled on.
Fix comments.
Clean up formatting of recently added code.

io.c:
Clean up formatting of recently added code.

netboot/main.c, machdep.c, wd.c:
Change names of bootinfo fields.

LINT:
Nuke SYMTAB_SPACE.
Fix comment about DODUMP.

Makefile.i386:
Nuke use of dbsym.
Exclude gcc symbols from kernel unless compiling with -g.
Remove unused macro.
Fix comments and formatting.

genassym.c:
Generate defines for some new bootinfo fields.  Change names of old ones.

locore.s:
Copy only the valid part of the `struct bootinfo' passed by the loader.
Reserve space for symbol table, if any.

machdep.c:
Check the memory sizes passed by the loader, if any.  Don't use them yet.

bootinfo.h:
Add a size field so that we can resolve some mismatches between the loader
bootinfo and the kernel boot info.  The version number is not so good for
this because of historical botches and because it's harder to maintain.
Add memory size and symbol table fields.  Change the names of everything.

Hacks to save a few bytes:

asm.S, boot.c, boot2.S:
Replace `ouraddr' by `(BOOTSEG << 4)'.

boot.c:
Don't statically initialize `loadflags' to 0.  Disable the "REDUNDANT"
code that skips the BIOS variables.  Eliminate `total'.  Combine some
more printfs.

boot.h, disk.c, io.c, table.c:
Move all statically initialzed data to table.c.

io.c:
Don't put the A20 gate bits in a variable.
1995-01-25 21:40:47 +00:00
Justin T. Gibbs
58e4304e3d Handle the aic7770 driver's dependancies correctly.
YOU MUST REBUILD CONFIG.
1994-12-31 19:27:29 +00:00
David Greenman
150f9c68d5 Go back to -O optimization...Bruce's arguments against -O2 are convincing
enough for me.
1994-11-27 14:26:16 +00:00
David Greenman
63281ad752 Changed optimization level to -O2. 1994-11-24 14:26:11 +00:00
Bruce Evans
d0c8f50566 Don't define KERNEL for compiling genassym. The prototype for the system
printf() is inconsistent with the prototype for the library printf() and
gets declared if DIAGNOSTIC is defined because <vm/vm_page.h> includes
<sys/systm.h>.
1994-11-15 14:43:45 +00:00
Bruce Evans
40974c748a Never strip the kernel.
Recommend -Wimplicit in CWARNFLAGS next.  There are still a few hundred
potential arg mismatches because no function declaration is in scope.

Don't duplicate option `-I.'.

Remove null editing of the assembler source for all profiled objects.
The required magic has been done since prehistoric times by an
asm("mcount") declaration.

Simplify the clean rule.

Don't try to be clever about timestamps involving genassym.  genassym's
timestamp usually got ahead of assym.s's timestamp, so `make' almost
always had to run genassym and compare *assym.s to decide that nothing
needed to be done.  The cost is reassembling a few files whenever
genassym is rebuilt.  Assembling is almost as fast as comparing.

Always go through genassym.o to build genassym.  This would have avoided
numerous bugs involving mkdep -p.  Now it just stops genassym from
depending on the name of the temporary object file.

Use ${CFLAGS} for building genassym.  Mainly ${CWARNFLAGS} were missing.
1994-10-25 19:34:57 +00:00
Garrett Wollman
6a8d662377 LINT: vastly restructured so that it's actually useful for something
Makefile.i386: make definition of STRIP unconditional.
1994-10-21 01:10:54 +00:00
Garrett Wollman
2a07a4c97e Conditionally define CC, CWARNOPTS, etc., so that `makeoptions' in
config files actually does something useful.
1994-10-18 19:45:46 +00:00