Commit Graph

1061 Commits

Author SHA1 Message Date
Peter Wemm
e8fa13fdd9 Clean up some dead wood. Kill the page table page for mapping the
proc0/idlePTD/bootstrap stack into place in user space.  We save 4K.
Remove p0upa, it is now unneeded.
1997-04-07 08:38:19 +00:00
Peter Wemm
a2a1c95c10 The biggie: Get rid of the UPAGES from the top of the per-process address
space. (!)

Have each process use the kernel stack and pcb in the kvm space.  Since
the stacks are at a different address, we cannot copy the stack at fork()
and allow the child to return up through the function call tree to return
to user mode - create a new execution context and have the new process
begin executing from cpu_switch() and go to user mode directly.
In theory this should speed up fork a bit.

Context switch the tss_esp0 pointer in the common tss.  This is a lot
simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer
to each process's tss since the esp0 pointer is a 32 bit pointer, and the
sd_base setting is split into three different bit sections at non-aligned
boundaries and requires a lot of twiddling to reset.

The 8K of memory at the top of the process space is now empty, and unmapped
(and unmappable, it's higher than VM_MAXUSER_ADDRESS).

Simplity the pmap code to manage process contexts, we no longer have to
double map the UPAGES, this simplifies and should measuably speed up fork().

The following parts came from John Dyson:

Set PG_G on the UPAGES that are now in kernel context, and invalidate
them when swapping them out.

Move the upages object (upobj) from the vmspace to the proc structure.

Now that the UPAGES (pcb and kernel stack) are out of user space, make
rfork(..RFMEM..) do what was intended by sharing the vmspace
entirely via reference counting rather than simply inheriting the mappings.
1997-04-07 07:16:06 +00:00
Peter Wemm
271b264e4c No longer use an i386tss as the basis of our pcb - it wasn't particularly
convenient and makes life difficult for my next commit.  We still need
an i386tss to point to for the tss slot in the gdt, so we use a common
tss shared between all processes.

Note that this is going to break debugging until this series of commits
is finished.  core dumps will change again too. :-(  we really need
a more modern core dump format that doesn't depend on the pcb/upages.

This change makes VM86 mode harder, but the following commits will remove
a lot of constraints for the VM86 system, including the possibility of
extending the pcb for an IO port map etc.

Obtained from: bde
1997-04-07 06:45:18 +00:00
Stephen McKay
bc19f8a39e Prevent wedging of the stat clock because of missed interrupts.
This should cure the "alternate system clock has died!" problem.

Discussed with: bde, joerg
1997-04-06 13:25:48 +00:00
John Dyson
a04c970a7a Fix the gdb executable modify problem. Thanks to the detective work
by Alan Cox <alc@cs.rice.edu>, and his description of the problem.

The bug was primarily in procfs_mem, but the mistake likely happened
due to the lack of vm system support for the operation.  I added
better support for selective marking of page dirty flags so that
vm_map_pageable(wiring) will not cause this problem again.

The code in procfs_mem is now less bogus (but maybe still a little
so.)
1997-04-06 02:29:45 +00:00
Bruce Evans
12f2987754 Removed a wrong comment of mine.
Removed unused #includes.
1997-04-01 16:22:31 +00:00
David Greenman
9caaadb63a Changed the way that the exec image header is read to be filesystem-
centric rather than VM-centric to fix a problem with errors not being
detectable when the header is read.
Killed exech_map as a result of these changes.
There appears to be no performance difference with this change.
1997-03-31 11:11:26 +00:00
Joerg Wunsch
514e9fd6b8 Implement the `detach' command for remote GDB. It gets you back at DDB. 1997-03-30 16:03:00 +00:00
Poul-Henning Kamp
3d4d8fe94d Sanitize APM a bit. Convert various #ifdef to id_flags instead.
You may want to add "flags 0x31" to apm0 if you have a lousy
implementation.  Read LINT.
1997-03-29 11:07:12 +00:00
Bruce Evans
83eab616cf Don't keep cpu interrupts enabled during the lookup in vm_page_zero_idle().
Lookup isn't done every time the system goes idle now, but it can still
take > 1800 instructions in the worst case, so if cpu interrupts are kept
disabled then it might lose 20 characters of sio input at 115200 bps.

Fixed style in vm_page_zero_idle().
1997-03-29 04:35:26 +00:00
Bruce Evans
b8fa61d129 Added a setjmp() and a longjmp() so that an unexpected trap inside
ddb isn't necessarily fatal.  You can now do silly things like
`call vprint' and `show map' without losing control.
1997-03-28 12:56:07 +00:00
Bruce Evans
b825df51c6 Backed out rev.1.5. if %cs is bad, %eip may be bad, but this is no longer
fatal.
1997-03-28 12:46:52 +00:00
Joerg Wunsch
403d7829ac Something long overdue: compile inb() and outb() into the kernel as
functions if DDB is available.  The remaining occurences are usually
only inlined and thus not available in DDB.

I'm sure Bruce will have 23 additions to these 30 lines of code, but
at least it's a starting point. ;-)
1997-03-28 12:37:44 +00:00
Andrey A. Chernov
e5df661c83 Remove recently commited support for iobase == -2 ("port none")
is is really probe routine task (return -1 for no ports)
1997-03-28 01:02:17 +00:00
Mike Pritchard
89b37cfe4b Change sigreturn() to return EFAULT if it is passed an
address outside of the process's address space.
Now it matches its man page :-).  Closes PR# 2682.

Discussed with: bde
Submitted by:	Jonathan Lemon <jlemon@americantv.com>
1997-03-25 23:43:01 +00:00
Andrey A. Chernov
e4960ae4f5 Replace more verbose "at <not configured>" with less verbose "at ?",
we don't need much attention here, because this diagnostic printed first
and then card will be configured.
1997-03-25 03:29:40 +00:00
Andrey A. Chernov
70b57d05df Follow config intention for iobase:
print "at <not configured>" for iobase == -1 (autodetect not happens)
and not print anything for iobase == -2 (none)
Old code treat this two special config numbers as big port numbers.
1997-03-25 03:13:05 +00:00
Bruce Evans
fce002fdef Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used.  In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.
1997-03-24 11:25:10 +00:00
KATO Takenori
5fa4a05818 Fix typo.
Submitted by:	Bruce Evans <bde@zeta.org.au>
1997-03-24 07:23:05 +00:00
KATO Takenori
a8e282d6c3 Oops, I forgot to `cvs add'. This file is a part of new CPU
identification and initialization routines.
1997-03-22 19:00:36 +00:00
KATO Takenori
4c024bbdf8 Improved CPU identification and initialization routines. This
supports All Cyrix CPUs, IBM Blue Lightning CPU and NexGen (now AMD)
Nx586 CPU, and initialize special registers of Cyrix CPU and msr of
IBM Blue Lightning CPU.

If revision of Cyrix 6x86 CPU < 2.7, CPU cache is enabled in
write-through mode.  This can be disabled by kernel configuration
options.

Reviewed by:	Bruce Evans <bde@freebsd.org> and
            	Jordan K. Hubbard <jkh@freebsd.org>
1997-03-22 18:54:54 +00:00
John Dyson
8e56e56134 Decrease the latency/overhead in the prezero code when there is
an adequate number of prezeroed pages.
1997-03-22 04:28:16 +00:00
Bruce Evans
a92a5c234e Quoted CMD640. It's still missing from options.i386.
Removed stale comment saying that npx0 is mandatory.
1997-03-13 19:03:58 +00:00
Stefan Eßer
09d5def9ce Activate CMD640 workaround 1997-03-12 19:59:58 +00:00
Bruce Evans
13a44161a2 Moved userland assembler macros from <machine/asmacros.h> to
<machine/asm.h>.
1997-03-09 13:57:33 +00:00
Bruce Evans
644ba7e84e Cloned src/lib/libc/i386/DEFS.h to create <machine/asm.h> for the i386.
The former file was too hard to get at from other parts of the src tree
and will go away.
1997-03-09 10:39:15 +00:00
Stefan Eßer
81cf5d7aae improve pcibus_check: Only assume PCI if at least one PCI to anything bridge
on bus 0.
This fixes problems with EISA-only systems mistakenly being assumed to support PCI.
1997-03-05 20:52:00 +00:00
Bruce Evans
a5c1768dd5 Made FPU stuff conditional on npx as well as I586_CPU. 1997-03-05 16:30:55 +00:00
Bruce Evans
65ff42dd17 Only print clock calibration messages if the system was booted with -v.
Submitted by:	partly by gpalmer
1997-03-05 08:08:48 +00:00
Gary Palmer
0b146b65d2 Back out the patch to break up the clock probe lines. Instead, follow
Bruce's suggestion of deleting "relative to mc146818A clock ",
thus shortening the line ...
1997-03-05 00:54:00 +00:00
Gary Palmer
5c5e8d766c Split the rather long and line-wrapping clock probe messages on boot.
(2.2?)

Submitted by:	Mathew Dood <winter@jurai.net>
1997-03-04 09:24:01 +00:00
Andrey A. Chernov
50ac8e2f59 Add missing #include <machine/segments.h> for ISPL and SEL_UPL macros 1997-03-01 05:44:09 +00:00
Bruce Evans
9bb932b6f2 Print function args in the current radix instead of always in hex.
Print the stack pointer together with the frame pointer in the trap,
syscall and interrupt messages.  The frame pointer is not very useful
for locating syscall args since syscall functions don't have a frame
pointer.

Print all the numbers in the trap, syscall and interrupt messages in
the default radix.  The syscall number was confusing because it was
printed in decimal.

Use %#n format more and 0x%x less.  0x%x of course doesn't work with
a variable radix.  ddb is now fairly consistent about using %+#n to
print all numbers.  It omits the '+' for signed numbers the '#' in a
few cases (e.g., for function args) to save space.
1997-02-28 12:36:18 +00:00
Bruce Evans
014e652753 Fixed the gcc ellipsis change to work with gcc-1.x. 1997-02-28 07:12:34 +00:00
Alexander Langer
a28b3400eb Typo police. 1997-02-24 00:37:43 +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
Bruce Evans
f79ef55e7a Replaced START_ENTRY by _START_ENTRY. -current hasn't got my cleanup
of DEFS.h which renamed it.
1997-02-17 07:21:28 +00:00
Bruce Evans
dab159e3d6 Select between the generic math functions and the i387-specific ones
at runtime.

etc/make.conf:
Nuked HAVE_FPU option.

lib/msun/Makefile:
Always build the i387 objects.  Copy the i387 source files at build
time so that the i387 objects have different names.  This is simpler
than renaming the files in the cvs repository or repeating half of
bsd.lib.mk to add explicit rules.

lib/msun/src/*.c:
Renamed all functions that have an i387-specific version by adding
`__generic_' to their names.

lib/msun/src/get_hw_float.c:
New file for getting machdep.hw_float from the kernel.

sys/i386/include/asmacros.h:
Abuse the ENTRY() macro to generate jump vectors and associated code.
This works much like PIC PLT dynamic initialization.  The PIC case is
messy.  The old i387 entry points are renamed.  Renaming is easier
here because the names are given by macro expansions.
1997-02-16 18:26:31 +00:00
Bruce Evans
a7d00b5bf6 Moved definition of FUNCTION_ALIGNMENT to a machine-dependent place.
Changed it from 4 to 16 for i386's.  It can be anything for i386's,
but compiler options limit it to a power of 2, and assembler and
linker deficiencies limit it to a small power of 2 (<= 16).
We use 16 in the kernel to get smaller tables (see Makefile.i386 and
<machine/asmacros.h>).  We still use the default of 4 in user mode.

Use HISTCOUNTER instead of (*kcount) in the definition of KCOUNT()
for consistency with other macros.
1997-02-13 10:47:29 +00:00
Bruce Evans
47cac30b9a Align text to 16-byte boundaries if profiling is enabled. This will
allow a fourfold reduction in the size of the profiling buffers.  This
goes with rev.1.91 of Makefile.i386 which does the same thing for C
functions.
1997-02-13 08:31:53 +00:00
Bruce Evans
3d1713a8a5 Restored changes from rev.1.58-1.60 which were blown away by the
previous commit.
1997-02-11 15:03:31 +00:00
John Dyson
996c772f58 This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>
1997-02-10 02:22:35 +00:00
Poul-Henning Kamp
b7a652ab84 I have no idea what this is all about, but it works and Bruce hasn't
complained so it cannot be entirely bad :-)

I include the email that probably explains it for people who already know:

> >Compiling with -O3 inlines functions.  However the function that is being
> >inlined in makeinfo.c (add_word_args()) is a vararg function and must not be
> >inlined.
> >
> >The code in question is K&R style, and AFIK, there is no way for the compiler
> >to determine that the function uses vararg.  Either change the code to use
> >prototypes, or use stdarg, or add a directive to prevent inlining.
>
> Not declaring a varargs function as varargs before it is used gives
> undefined behaviour.
>
> However, in practice the bug is probably in FreeBSD's <varargs.h>, which
> doesn't use gcc's __builtin_next_arg().  gcc should notice that it is
> used and not inline functions that have it.  <stdarg.h.> uses it, but I
> think there's another gcc builtin that it should be using.

Patch attached.  The ellipsis causes gcc to flag this as a varargs function,
and the name "__builtin_va_alist" is special cased in gcc to hide the last
argument in the arglist.

Reviewed by:	bde & phk
Submitted by:	jlemon@americantv.com (Jonathan Lemon)
1997-02-07 20:22:15 +00:00
KATO Takenori
d5605f2a31 Deleted i386_cpus[]. i386_cpus[] is a static variable in identcpu.c.
Found-by: lint
1997-02-02 10:43:35 +00:00
David Greenman
e4c46b5e82 Removed PG_N from here, too. Some machines don't like it and it's unnecessary. 1997-01-30 20:22:02 +00:00
David Greenman
3def491346 Removed unnecessary PG_N flag from device memory mappings. This is handled
by the CPU/chipset already and was apparantly triggering a hardware bug that
causes strange parity errors.
1997-01-30 19:36:58 +00:00
Bruce Evans
49a116737e Estimate an initial overhead of 0 usec instead of 20 usec in DELAY().
I have code to calibrate the overhead fairly accurately, but there
is little point in using it since it is most accurate on machines
where an estimate of 0 works well.  On slow machines, the accuracy
of DELAY() has a large variance since it is limited by the resolution
of getit() even if the initial delay is calibrated perfectly.

Use fixed point and long longs to speed up scaling in DELAY().
The old method slowed down a lot when the frequency became variable.
Assume the default frequency for short delays so that the fixed
point calculation can be exact.

Fast scaling is only important for small delays.  Scaling is done
after looking at the counter and outside the loop, so it doesn't
decrease accuracy or resolution provided it completes before the
delay is up.  The comment in the code is still confused about this.
1997-01-29 22:51:44 +00:00
Bruce Evans
26add14927 Disabled logging of masked exceptions on exit. Keep the side effect of
saving the state (see rev.1.17).
1997-01-29 13:46:28 +00:00
Bruce Evans
4123678332 Sync with <pci/pcibus.h>. pcibus.c unfortunately still compiled (with
only 3 or 4 warnings) when pb_maxirq went away.
1997-01-25 18:51:01 +00:00
Bruce Evans
f42cf36fa8 Fixed some formatting bugs (mostly regressions in rev.1.48). Replaced
some magic numbers by pmap constants.  Cosmetic.
1997-01-24 20:37:57 +00:00