Commit Graph

482 Commits

Author SHA1 Message Date
Andrey A. Chernov
f1e302d4cc c_iflag handling in setting compat modes now more close to V7 1995-03-29 19:50:58 +00:00
Andrey A. Chernov
64a49d2d33 Oops, fix typing error in prev. commit 1995-03-29 19:24:46 +00:00
Andrey A. Chernov
668a9ccefc Handle TTY_BI now instead of TTY_FE && c == 0 1995-03-29 19:22:37 +00:00
Andrey A. Chernov
532f5941b0 Move parmark 0377 double code after control chars processing 1995-03-29 18:55:20 +00:00
David Greenman
2547597bf4 Added a set of braces to make the compiler happy. 1995-03-29 11:54:02 +00:00
Andrey A. Chernov
702c5e7e17 ttyinput() fixes:
1) Preserve old buffer contents when input buffer overflows.

Old code clear buffer and rewrite it again, if !MAXBEL
(for MAXBEL it does right thing :-).
F.e. if you type too long string, last chars passed,
not first ones as expected.
Moreover, it flush output queue too in this case without any needs.

2) Don't do IXOFF, if IGNCR and c==\r, ignore completely.

3) If PARMRK is active and !ISTRIP and char == 0377
put yet one 0377 to distinguish it from parity mark sequence.
POSIX standard (thanx Bruce).

Reviewed by:
Submitted by:
Obtained from:
CVS:
1995-03-28 15:25:13 +00:00
Andrey A. Chernov
63cadaef19 Bug fixed:
parity/framing/break not completely ignored when IGN* is set
but cause output restarted.
CVS:
1995-03-28 11:09:35 +00:00
Bruce Evans
3aa12267a5 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) that I didn't notice when I fixed
"all" such warnings before.
1995-03-28 07:58:53 +00:00
David Greenman
6e14d964ac Removed some redundant 'vmio' checks. 1995-03-27 00:11:45 +00:00
David Greenman
f57459b632 Removed third arg (vmio) to allocbuf() that was added with the original
merged cache changes, and figure it out based on the B_VMIO buffer flag.
Fixes a problem where delayed write VMIO buffers would sometimes get
recopied into kernel-alloced memory.

Submitted by:	John Dyson
1995-03-26 23:29:13 +00:00
David Greenman
bc4c84cf7e Added a third "flags" argument to msync() ...as other systems have. 1995-03-25 16:52:24 +00:00
Bruce Evans
a7d783dddb Add more compatibility cruft:
- ignore the partition table if it is identical with the bogus one in
  /usr/src/sys/i386/boot/biosboot/start.S.  Honoring the bogus size
  field was fatal.  The error is detected but other compatibilty
  cruft weakens the error handling too much for this case.
- weaken the partition entry checking to allow the following treatments
  of C/H/S addresses when C should be >= 1024:
    (1) allow C = 1023, H = max, S = max.
    (2) allow C to be correct modulo 1024.
  Other compatibilty cruft weakens the error handling to allow all
  C/H/S addresses, but there too many errors were reported.

Improve error messages:
- print C/H/S addresses if relevant.
- distinguish primary partition table from extended partition tables.
- don't use diskerr() except for i/o errors.
1995-03-25 12:07:31 +00:00
David Greenman
3ed8a40336 Use 'p' rather than 'curproc' when appropriate. 1995-03-25 01:34:21 +00:00
David Greenman
b35ba931bd Use NDINIT macro to initialize fields for namei. 1995-03-25 01:20:38 +00:00
Peter Dufault
3749fcff67 Set it so you can add and remove line disciplines without replicating
code for looking for open slots in table (and you could hide the table
if you wanted to).
1995-03-21 11:24:05 +00:00
David Greenman
f550a707bd Added a new version of trap_pfault() that disallows kernel page faults
to the user address space unless pcb_onfault is set. The code is currently
commented out because iBCS2 and process debugging parts of the kernel
need to be changed/fixed first.
1995-03-21 07:16:12 +00:00
David Greenman
c6d5f3ac3e Changed some #ifdef DIAGNOSTIC code that I added to be #ifdef DEBUG. 1995-03-21 07:02:51 +00:00
David Greenman
b946193056 Fixed vinvalbuf() to work like NFS wants it to. The previous code wouldn't
flush pages in the vm object if V_SAVE was true.
1995-03-21 01:13:16 +00:00
David Greenman
62b71ed629 Don't gain/lose a reference to the object when yanking its pages in
vinvalbuf()...it will cause vnode locking problems in vm_object_terminate,
and isn't necessary anyway.
1995-03-20 10:19:09 +00:00
David Greenman
ff769afc81 Don't attempt to sync pages in the V_SAVE case of vinvalbuf; doing so can
lead to a deadlock. Just let the VM system deal with it.
1995-03-20 02:08:24 +00:00
David Greenman
9022e4ad9c Fixed bug introduced in the previous commit - the lock must be held until
after the call to exec_check_permissions().
1995-03-19 23:27:57 +00:00
David Greenman
f5277ae71e Lose the lock on the vnode. Changes to implement proper locking in the
vnode pager now require this.

Submitted by:	John Dyson
1995-03-19 23:08:12 +00:00
David Greenman
edf8a81561 Removed redundant newlines that were in some panic strings. 1995-03-19 14:29:26 +00:00
David Greenman
967a3bf893 Fix from Doug Rabson: Don't try to release a pbuf we didn't get.
Minor style change by me.
1995-03-19 13:28:54 +00:00
David Greenman
50475e8bd3 Removed unnecessary call to vnode_pager_uncache(). We automatically clear
the VTEXT flag after all mappers have finished with the object.
1995-03-19 12:08:03 +00:00
David Greenman
ab828ab8bd Moved call to vnode_pager_uncache in rename() to before the VOP_RENAME.
It was previously after the VOP_RENAME and the reference and lock on
the vnode had already been lost, allowing interesting internel
inconsistencies. This is one of the two reasons why freefall was crashing
every hour or two (the other being nullfs bugs).
Don't call vnode_pager_uncache in revoke(). revoke() is only allowed on
VCHR and VBLK vnodes.
1995-03-19 11:16:58 +00:00
David Greenman
d7e3d98a5e Patch from Kirk McKusick to fix a bug introduced in the Poul's vfs_cache
rewrite.
1995-03-19 09:33:51 +00:00
David Greenman
0338878131 Woops, add back that #define...it's used later in the file. 1995-03-18 07:06:51 +00:00
David Greenman
9e4817309b Fixed comments and removed b_cylinder #define. 1995-03-18 06:38:04 +00:00
David Greenman
89247e0412 Integrated change from 1.1.5: Fixed broken disksort to sort by pblkno
rather than by cylinder.
1995-03-18 06:32:48 +00:00
David Greenman
6a21a04a14 Changed names of goaway routines into shutdown routines. 1995-03-17 04:18:07 +00:00
Bruce Evans
b5e8ce9f12 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.
1995-03-16 18:17:34 +00:00
Bruce Evans
fe7172b1a6 Fix support for extended partitions (forgot to release the buffer). 1995-03-15 16:25:08 +00:00
David Greenman
5eb7d0cd2e Special cased the handling of mb_map in the M_WAITOK case. kmem_malloc()
now returns NULL and sets a global 'mb_map_full' when the map is full.
m_clalloc() has further been taught to expect this and do the right thing.
This should fix the "mb_map full" panics that several people have reported.
1995-03-15 07:52:06 +00:00
Bruce Evans
ec00834c18 Finish the previous change. The device name got lost in diskerr(). 1995-03-12 08:17:30 +00:00
Poul-Henning Kamp
47f196941e Update a couple of counters. 1995-03-12 02:01:20 +00:00
David Greenman
3d2a8cf3d9 Added a comment. 1995-03-11 22:29:07 +00:00
David Greenman
17dda4c929 Added some additional DIAGNOSTIC code that makes sure that freed
memory addresses and types are with the valid range. Increased
MAX_COPY to 256 (used to verify no freed memory use with DIAGNOSTIC).
1995-03-11 22:28:16 +00:00
David Greenman
f8a0b2dd88 Reorganized an if() expression for efficiency. 1995-03-10 21:18:24 +00:00
David Greenman
914e6eb70d Whoops, back out that last change - I misread what Poul had done there. 1995-03-10 20:29:51 +00:00
David Greenman
dbd90d413f Don't thrash the name cache while trying to fill up the object cache.
(Make a new cache entry until desiredvnodes is reached).
1995-03-10 20:26:29 +00:00
David Greenman
a74a73d96c Removed some #include's of unnecessary include files. 1995-03-10 08:44:20 +00:00
Poul-Henning Kamp
fbd6e6c9ef Clean up and improve the namecache.
1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
Clean up and improve the namecache.

1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
gets forced out of the VM/cache.  The latter is not numerous enough to keep
the pool of vnodes needed for the namecache sufficiently big.

2. Purge invalid entries in the namecache as soon as we notice them.  This
avoids a stale entry pushing out a valid entry on the LRU list.

3. Speed up the lookup in the namecache by avoid a special case branch.

4. Make the cache purge routines do the thing they're supposed to, and in
a decently efficient manner.

5. Make the size of the namecache follow the number of vnodes, so that we
can always point to all the vnodes we have in core.

6. Readability has gone way up.

7. Added a "options NCH_STATISTICS" feature that will gather more
detailed statistics on the performance of the namecache.

Reviewed by:    davidg

(cvs is dumping core on me :-(  )
1995-03-09 20:27:04 +00:00
Poul-Henning Kamp
b2e10d6d6f Clean up and improve the namecache.
1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
gets forced out of the VM/cache.  The latter is not numerous enough to keep
the pool of vnodes needed for the namecache sufficiently big.

2. Purge invalid entries in the namecache as soon as we notice them.  This
avoids a stale entry pushing out a valid entry on the LRU list.

3. Speed up the lookup in the namecache by avoid a special case branch.

4. Make the cache purge routines do the thing they're supposed to, and in
a decently efficient manner.

5. Make the size of the namecache follow the number of vnodes, so that we
can always point to all the vnodes we have in core.

6. Readability has gone way up.

7. Added a "options NCH_STATISTICS" feature that will gather more
detailed statistics on the performance of the namecache.

Reviewed by:	davidg
1995-03-09 20:23:45 +00:00
Poul-Henning Kamp
a0e8a1e29b Another little optimization to the nameicache.
If an entry is stale, ditch it.
1995-03-08 01:40:44 +00:00
Poul-Henning Kamp
2425396b27 Improve the quality of the hash used in the namei-cache. 1995-03-08 01:08:03 +00:00
David Greenman
5dcf309046 Removed most of the special policy regarding the seperation of VMIO and
dir/metadata buffers as it seems to have anomolous effects.
1995-03-07 19:53:27 +00:00
David Greenman
acc835fd3f Put VAGE vnodes at the head of the free list. 1995-03-07 18:59:45 +00:00
Poul-Henning Kamp
30f467d84a Update vfs_cache.c to use the <sys/queue.h> macros. This makes it easier
to read, but doesn't change the speed.

Reviewed by:	phk
Obtained from:	via NetBSD
1995-03-06 06:45:52 +00:00
David Greenman
9bd1697199 Added some more of John's "anti-chatter" fixes - set the page activation
count to 0 after activating the page; the previous behavior biased the
pages too high in some cases.

Submitted by:	John Dyson
1995-03-04 15:16:07 +00:00
Bruce Evans
7262c5ee2c Support extended DOSpartitions.
Accept even suspicious partitions.

Moved most handling of the compatibility slice to dsopen().

Report i/o errors.
1995-03-04 11:44:05 +00:00
Bruce Evans
2973a0eba4 Don't warn about missing labels for non-BSD slices.
Don't print debugging messages by default.

Initialize the compatibility slice here and not in the machine-dependent
code.

Fix initialization of the label for the whole disk slice.

Make it clear that write protection of labels doesn't apply when there is
no label.
1995-03-04 11:42:27 +00:00
David Greenman
403ef252fa Removed obsolete vtrace() remnants. 1995-03-04 03:24:45 +00:00
David Greenman
22470903a0 Fixes from John Dyson to work around vnode lock hang. Basically, remove
the VOP_BMAP calls, and add one to bdwrite.

Submitted by:	John Dyson
1995-03-03 22:13:16 +00:00
David Greenman
9d55322b75 Don't try to cluster busy buffers.
Submitted by:	John Dyson
1995-03-02 19:36:50 +00:00
David Greenman
fde2cdc48a Various changes from John and myself that do the following:
New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that
are used to reduce the actual number of wakeups.
New function vm_page_protect which is used in conjuction with some new
page flags to reduce the number of calls to pmap_page_protect.
Minor changes to reduce unnecessary spl nesting.
Rewrote vm_page_alloc() to improve readability.
Various other mostly cosmetic changes.
1995-03-01 22:08:55 +00:00
David Greenman
3aed948b88 No longer assume that a process's address space can be directly written to. 1995-03-01 04:09:50 +00:00
Andrey A. Chernov
5d8619d1f2 Workaround IXOFF bug when output queue is full && RTS control is on 1995-02-28 23:21:33 +00:00
David Greenman
519b3d1aa6 Do a vnode_pager_uncache after the VOP_RENAME to lose the remaining
reference to the old vnode.

Suggested by:	Bruce Evans
1995-02-28 02:52:48 +00:00
Paul Traina
8c5c37cd75 Incorporate bde's code-review comments.
(a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous.
(b) remove all of the wrappers that have been replaced by ttselect
(c) fix formatting in syscons.c and definition in syscons.h
(d) add cxdevtotty

NOT DONE:
(e) make pcvt work... it was already broken...when someone fixes pcvt to
	link properly, just rename get_pccons to xxxdevtotty and we're done
1995-02-28 00:21:11 +00:00
Ugen J.S. Antsilevich
0739a0dc6e same 1995-02-27 19:47:53 +00:00
David Greenman
7500ed1d63 Backed out previous change. I forgot (for about the fourth time) that
v_rdev is a #define which is dereferenced through v_specinfo->si_rdev,
and that isn't initialized until later in checkalias().
1995-02-27 10:15:38 +00:00
David Greenman
f9ceb7c7b5 Initialize v_rdev in getnewvnode() - it appears that some filesystems
may not properly initialize this field in all cases, and this would
result in very anti-social behavior (overwriting on some other random
device/location).

Submitted by:	John Dyson
1995-02-27 06:50:08 +00:00
Bruce Evans
0fe414febc Eliminate my private type `bool_t'. 1995-02-26 03:15:36 +00:00
Paul Traina
77f77631e7 (a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer
    to a valid tty structure based upon a dev_t
(c) make syscons structures the same size whether or not APM is enabled so
    utilities don't crash if NAPM changes (and make the damn kernel compile!)
(d) rewrite /dev/snp ioctl interface so that it is device driver and i386
    independant
1995-02-25 20:09:44 +00:00
David Greenman
4494100855 Fixed thrashing buffer problem.
Submitted by:	John Dyson
1995-02-25 01:46:26 +00:00
Poul-Henning Kamp
6c20486de4 Clean a bunch of -Wall warnings. 1995-02-24 08:51:34 +00:00
Andrey A. Chernov
81c427da32 Add releasing of input flow control into
ttyflush(FREAD)
1995-02-24 02:36:01 +00:00
David Greenman
9b4b42d17b Implemented mbstat.m_wait and mbstat.m_drops. 1995-02-23 19:10:21 +00:00
Andrey A. Chernov
227b711d8e Add two IXOFF checks to not confuse with CRTS_IFLOW.
Now TS_TBLOCK used as general input flow flag
for both IXOFF and CRTS_IFLOW cases.
1995-02-23 03:02:38 +00:00
Andrey A. Chernov
d8947494e5 Revive hadrware input flow control
Submitted by: iverson@lionheart.com
1995-02-22 23:20:51 +00:00
Bruce Evans
30ca037de1 Use dsname() to get consistent names. 1995-02-22 22:46:48 +00:00
Bruce Evans
ae623967ec Fix initialization of the copy of the label passed to setdisklabel().
Fix the sign of the adjustment after writing a label.

Writing of labels should work now.

Merge adjust_label() into fixlabel().  Detect more errors and don't
write if there is an error.  Adjust sectors/unit and total sectors
to the numbers on the slice.

Add a function dsname() to print slice device names consistently, and
use it.
1995-02-22 21:51:53 +00:00
David Greenman
a3a8bb29d2 vfs_cluster.c:
Various more tweaks from John Dyson to improve read ahead calculations.

vfs_subr.c:
Only wakeup if numoutput is 0 in vwakeup().

Submitted by:	John Dyson
1995-02-22 09:39:22 +00:00
David Greenman
701d45805b Added some code to make sure that buffers associated with directories and
metadata aren't thrashed by regular file I/O.
Added mechanism to limit the amount of outstanding I/O on a given vnode.
Pagedaemon wakeup policy changed to skew priority a little in favor of
file caching.
Slight code reorganization to improve clarity.
Added a few more comments.

Submitted by:	John Dyson
1995-02-22 09:30:13 +00:00
David Greenman
7a53944444 Only do object paging_in_progress wakeups if someone is waiting on this
condition.
Added some comments.

Submitted by:	John Dyson
1995-02-22 09:16:07 +00:00
Bruce Evans
cf343b5640 Discard junk from partition tables when reading the tables for applications
the same as when initializing the in-core copies.  Adjust checksums in
labels after adjusting labels.  This finishes fudging the on-disk label to
make it coherent with the in-core label.

Handle EIO during initialization better.

Initialize the compatibility slice to the whole disk If there are no real
slices.

Don't warn about adjusting offsets in the label to make the 'c' partition
start at 0.  The 'c' offset is now always absolute on-disk and 0 in-core
so an adjustment is usually required.

Don't confuse LABEL_PART with RAW_PART so much.

Check for partitions being within slices differently.
1995-02-21 08:38:24 +00:00
Bruce Evans
22544eb7a0 Don't generate any errors here other than EIO. An invalid partition
table is not an error, it just causes a smaller slice table.
1995-02-21 08:37:09 +00:00
Poul-Henning Kamp
d66cc71bb5 Speed md5 up around 30% by shorting out a couple of cumbersome
memcpy equivalent functions.
1995-02-21 06:01:49 +00:00
David Greenman
68940ac1a0 Use of vm_allocate() and vm_deallocate() has been deprecated. 1995-02-20 22:23:31 +00:00
Guido van Rooij
e6373c9ec0 Implement maxprocperuid and maxfilesperproc. They are tunable
via sysctl(8). The initial value of maxprocperuid is maxproc-1,
that of maxfilesperproc is maxfiles (untill maxfile will disappear)

Now it is at least possible to prohibit one user opening maxfiles

-Guido

Submitted by:
Obtained from:
1995-02-20 19:42:42 +00:00
Bruce Evans
a3f4faced6 Don't flush the message buffer when it fills up. 1995-02-19 15:02:26 +00:00
David Greenman
9219d44e66 Truncate the pte address to a page boundry. This probably won't fix the
panic, but at least it's more correct.
1995-02-19 02:50:31 +00:00
Bruce Evans
bd6edcba54 Keep absolute offsets in on-disk labels for backwards compatibility. This
requires complications to adjust the offsets to relative when a block
containing the label is read and back to absolute when such a block is
written.  The adjustment is not made on the whole disk slice.

Don't allow setting the offset of partition C to nonzero in in-core labels.
This will cause some (nonstandard) disktab entries to fail.  They will
need to be changed to have relative offsets (and no partitions outside
of the slice).

Don't write protect the (nonexistent) label on the whole disk slice.

Writing labels and bootstraps should work right now (except if there is
no DOSpartition table).
1995-02-18 22:10:44 +00:00
David Greenman
0e65588688 Only clear B_VMIO in brelse() - a bunch of special processing is required
whenever this happens, and that wasn't occurring in some cases.
1995-02-18 02:55:09 +00:00
Bruce Evans
7a867ed547 Add compatibility cruft.
Slice 0 is now for the first BSD slice.  The first BSD slice is
the first DOSpartition with id 0xa5 or the whole disk if their
are no DOSpartitions (except the latter is not yet implemented).
Existing partitions on it work the same as in 2.0 except the
'd' partition is no longer special and partitions are relative
to the skice.

Slice 1 is now for the whole disk and gets a read-only label
describing the disk.  Previously, slice 0 was for the whole disk
and there was no label on it.

Slices 2-31 are for DOSpartitions.  Slice 0 is an alias for one
of these if there is a BSD slice.  Previously, slices 1-31 were
for DOSpartitions.

diskslice_machdep.c:
Expand whole disk slice to include all DOSpartitions.  More work
is required for >1024 cylinders and to rewrite the label iff the
driver is unsure about the geometry.

subr_diskslice.c:
New function dsisopen() to help handle media changes.
1995-02-16 15:19:19 +00:00
Bruce Evans
de13c90ff2 Adjust slice names in diskerr() for the rearranged slice numbers. The
mapping from numbers to names is messy for backwards compatibility.
E.g., for driver "sd", unit "0":

slice 0: omit the slice number for compatibility; names are sd0[a-h].
slice 1: omit the partition letter 'c' because the whole disk device
         shouldn't have anything to do with partitions; sd0 is the
         only name.
slices 2-31: subtract 1 from slice number to compensate for the
         compatibility slice 0; names are sd0s[1-30][a-h].
1995-02-16 14:47:38 +00:00
Joerg Wunsch
3ab1adc555 Alow overriding of the various SHM* options.
Submitted by:	Heikki Suonsivu <hsu@fx7.cs.hut.fi>
1995-02-16 11:29:19 +00:00
Garrett Wollman
5f540404a8 getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, ...) would construct the returned
timeval incorrectly, truncating the usec part.

Obtained from: Stevens vol. 2 p. 548
1995-02-16 01:07:43 +00:00
David Greenman
eb2463e1fc Fixed botched previous change - use 'pageno' not initialized to NULL 'kva'.
Submitted by:	Lars Fredriksen
1995-02-16 00:41:16 +00:00
Andrey A. Chernov
93a56d1fd1 Restore deleted in second time my & bde fixes.
UGEN STOP IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1995-02-15 22:25:51 +00:00
Ugen J.S. Antsilevich
964587caee More changes to support user calls.
It's 22:00  here,utility still to come(hopefully tomorrow
morning..)
1995-02-15 18:41:57 +00:00
Ugen J.S. Antsilevich
019b4d63ae Fix couple of nasty bugs..
- Overflow now calculated right
- Close works ok,does not looses tty
- Better overflow handling now the snooping stops
   on overflow,but programm notified and can reconnect if
   it want to..Default maximal buffer set to 664 K and this
   is probably too much..:)))
Utility still to come
1995-02-15 16:35:38 +00:00
Bruce Evans
23564ff8c3 Remove duplicated code from ttymalloc(). Disable ttyfree().
Restore fixes to flushing that were lost in the previous commit.

Clean up snoop changes.

Add my TODO list from 1.1.5.  The improvements in 1.1.5 should be "obtained"
first.
1995-02-15 16:00:56 +00:00
David Greenman
402cc72db6 Fixed bug caused by attempting a connect with a null 'nam'. 1995-02-15 11:30:35 +00:00
Ugen J.S. Antsilevich
dde8a05baa Here it came-the all-brand-new snoop device..
Users-beware..
It is tested and working for me but probably have some bugs i
didn't noticed so test it and reply...
It can:
 look at what's sent to the user from tty device
 snoop on pty's,vty's and serial tty's
It (still) can't:
 write to tty
 see what user types in local echo mode
It is probably bad styled and
 very dependant on tty_pty.c,sio.c and syscons.c
I would be really happy if another ppl would make their
changes because i am not sure this is the best snoop
we can have..but it is good..:)))))
1995-02-14 21:21:26 +00:00
Søren Schmidt
1e1e0b4463 First attempt to run linux binaries. This is only the changes needed to
the generic kernel. The actual emulator is a separate LKM. (not finished
yet, sorry).
Submitted by:	sos@freebsd.org & sef@kithrup.com
1995-02-14 19:23:22 +00:00
Poul-Henning Kamp
ed78b305f6 YPfix 1995-02-14 06:34:49 +00:00
Poul-Henning Kamp
cb21b8cf38 YFfix. 1995-02-14 06:33:53 +00:00
Poul-Henning Kamp
9977034cd2 YFfix 1995-02-14 06:31:13 +00:00
David Greenman
2655f62632 In sync(), don't dereference the proc pointer if it's NULL. Should fix
most or all of the problems with calling sync() without a curproc (which
can happen in machdep.c during a panic sync).
1995-02-13 13:45:04 +00:00
Poul-Henning Kamp
1e3a24e880 Actually access the right first page if the file.
Bruce finally caught this bogon for me, Thank you Bruce !
Due to some part of the VM/buffer/pmap magic doing clustering, this bogon
managed to work better than 99.9% of the time.  Amazing.
If You ever again see a weird message from the gzip code, please tell me.
1995-02-13 07:40:33 +00:00
Andrey A. Chernov
6d50a4a80f Purge queues in ttylclose(), if ttywflush() failed 1995-02-13 02:18:28 +00:00
Andrey A. Chernov
dee8849b8d Replace previous fix with less agressive, just return EIO
if ttywait can't drain queue.
1995-02-13 02:03:57 +00:00
Andrey A. Chernov
911b598f11 1. If some output still present at the end of ttywait, kill it.
2. Even if ttywait() fails, call ttyflush(FREAD) in ttywflush.
This two fixes guarantee that queues are empty after calling ttywflush()
in any case
1995-02-12 23:01:13 +00:00
David Greenman
4aa2b6cf22 Minor code improvement to uiomove() 1995-02-12 09:11:47 +00:00
David Greenman
914a63ebd4 Wire the page table before doing the vm_fault(). Fixes a panic that
happens when using gdb.

Submitted by:	John Dyson
1995-02-10 22:36:11 +00:00
David Greenman
b1e4a738e0 Removed unnecessary check for pr_scale in the AST/OWEUPC case. 1995-02-10 06:43:47 +00:00
David Greenman
5a32829d98 Check P_PROFIL flag for profiling rather than pr_scale as it makes more
sense.
1995-02-10 06:25:14 +00:00
Jordan K. Hubbard
3663f75c18 >32 PTY support
Submitted by: Heikki Suonsivu <hsu@cs.hut.fi>
1995-02-09 11:13:30 +00:00
Bruce Evans
a2d5fd1975 Disable bogus attempt to switch from the TS_ISOPEN state to the
TS_WOPEN state when CLOCAL is toggled from on to off while there
is no carrier.  There is no way back, and with sio there is no way
forward either (TS_ISOPEN will never be set again for the current
open).  This bug was observed in 1.1 and was fixed in 1.1.5.
1995-02-08 22:02:02 +00:00
Garrett Wollman
6b8fda4d12 Merge in the socket-level support for Transaction TCP. 1995-02-07 02:01:16 +00:00
David Greenman
a635d6c76a Use M_NOWAIT instead of M_KERNEL for socket allocations; it is apparantly
possible for certain socket operations to occur during interrupt context.

Submitted by:	John Dyson
1995-02-06 02:22:12 +00:00
Bruce Evans
0bc786d076 Update kmem_malloc() call to new waitflag(s) interface.
This might fix recent problems on thud and freefall.
1995-02-05 07:08:27 +00:00
David Greenman
b82c50c4e6 Make B_NOCACHE and B_INVAL buffers work correctly - throw away the data in
the page cache.

Submitted by:	John Dyson
1995-02-03 03:35:56 +00:00
David Greenman
9f518539fd Calling semantics for kmem_malloc() have been changed...and the third
argument is now more than just a single flag. (kern_malloc.c)
Used new M_KERNEL value for socket allocations that previous were
"M_NOWAIT". Note that this will change when we clean up the M_ namespace
mess.

Submitted by:	John Dyson
1995-02-02 08:49:08 +00:00
David Greenman
9dc4f38bff Rewrote rlist_free(). The previous code was a good example of how to
write software wrong. rlist_alloc() needs a rewrite, too, but this will
have to wait.
1995-01-31 06:48:53 +00:00
Poul-Henning Kamp
087b6ad948 $Id: -> $Id$ 1995-01-31 04:33:41 +00:00
Bruce Evans
c9c9e30a03 Increase the reserved clist space for the raw queue from 512 to TTYHOG.
This might help avoid tty buffer overflows on loaded systems.
1995-01-30 06:16:59 +00:00
Bruce Evans
e45d35c3f8 Don't waste 1264K for each MB of unused text.
Remove misplaced comment.
1995-01-29 03:03:23 +00:00
Andreas Schulz
aa98692ffb Correct a name of one structure member in the sigaltstack structure.
Now it matches the man page and also the only other commercial implementation
i have found so far ( Solaris 2.x).
Changed the name from ss_base to ss_sp.
1995-01-29 01:19:25 +00:00
David Greenman
6a1c735df7 Fix problem with freeing busy pages reported by Nick Sayer.
Submitted by:	 John Dyson
1995-01-26 03:34:31 +00:00
David Greenman
9532143ae6 Fixed a variety of deadlock and panic bugs, removed the bypass code, and
implemented the ability to limit bufferspace by memory consumed. (vfs_bio.c)
Fixed recently introduced bugs that caused extra I/O to happen in some
cases. (vfs_cluster.c)

Submitted by:	John Dyson
1995-01-24 10:00:46 +00:00
David Greenman
fbdfe8ac22 Changed buffer allocation policy (machdep.c)
Moved various pmap 'bit' test/set functions back into real functions; gcc
generates better code at the expense of more of it. (pmap.c)
Fixed a deadlock problem with pv entry allocations (pmap.c)
Added a new, optional function 'pmap_prefault' that does clustered page
table preloading (pmap.c)
Changed the way that page tables are held onto (trap.c).

Submitted by:	John Dyson
1995-01-24 09:56:33 +00:00
David Greenman
0a2d61c61c Kill redundant declarations of d_open_t and d_close_t. 1995-01-23 18:46:13 +00:00
Poul-Henning Kamp
1aaca524e0 Fixed $Id$ 1995-01-23 02:31:53 +00:00
Bruce Evans
d7e3a89f1f Don't count the parent's previous timeslice in the child's resource usage
(it was counted twice).

Set the start time more accurately.
1995-01-21 15:08:57 +00:00
Bruce Evans
a2562ad917 Keep track of open devices better to avoid closing the console device when
the physical device is closed.  Previously only the reverse case was handled.
Abuse the cdevsw interface instead of the vfs interface to do this.

Remove unnecessary #includes.
1995-01-21 14:12:15 +00:00
Andrey A. Chernov
60efec1dab Restore original fix from ohki, not check m for NULL it is already done
in the code above.
Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
1995-01-21 06:32:26 +00:00
Andrey A. Chernov
f76c8e8cc3 Change if (m->valid == 0) to if (m && m->valid == 0) 1995-01-20 23:30:42 +00:00
Bill Paul
fc042b6935 Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
When using cp to copy a file under the following circumstanes:

- original file in on an NFS filesystem
- destination file is on the same NFS filesystem
- the file is less than 8Mbytes in size
- the file is larger than 65536 bytes in size

the cp process can get frozen in device-wait and never wake up (cp uses
mmap() in this case).
A small change to allocbuf() fixes this.
1995-01-20 20:11:31 +00:00
David Greenman
761dd66739 Attempt to close a hole using splhigh/splx. There still appears to be a
serious one in the same area that I don't have time to fix.
1995-01-15 09:35:58 +00:00
Bruce Evans
20415301cd Fix security holes in sigreturn(), ptrace() and procfs. sigreturn()
attempted to check for insecure and fatal eflags and segment
selectors, but missed many cases and got the IOPL check back to
front.  The other syscalls didn't check at all.

sys_process.c, machdep.c:
Only allow PT_WRITE_U to write to the registers (ordinary and FP).

psl.h, locore.s, machdep.c:
Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR.  We are not supposed
to assume anything about the reserved bits.  Use PSL_USERCHANGE
and PSL_KERNEL instead.  Rename PSL_USERSET to PSL_USER.

exception.s:
Define a private label for use by doreti when returning to user
mode fails.

machdep.c:
In syscalls, allow changing only the eflags that can be changed on
486's in user mode (no longer attempt to allow benign IOPL changes;
allow changing the nasty PSL_NT; don't allow changing the i586
bits).

Don't attempt to check all the cases involving invalid selectors
and %eip's.  Just check for privilege violations and let the invalid
things cause a trap.

procfs_machdep.c:
Call the ptrace register functions to do all the work for reading
and writing ordinary registers and for single stepping.

trap.c:
Ignore traps caused by PSL_NT being set.  Previously, users could
cause a fatal trap in user mode by setting PSL_NT and executing an
iret, and a fatal trap in kernel mode by setting PSL_NT and making
a syscall.  PSL_NT was cleared too late and not in enough modes to
fix the problem.

Make all traps in user mode (except T_NMI) nonfatal.

Recover from traps caused by attempting to load invalid user
registers in doreti by restarting the traps so that they appear to
occur in user mode.
---

Fix bogons that I noticed while fixing the above:

psl.h:
Fix some comments.

Uniformize idempotency ifdef.

exception.s, machdep.c:
Remove rsvd[0-14].  rsvd0 hasn't been reserved since the 486 came
out.  Replace rsvd0 by `align'.  rsvd[0-11] used wrong (magic
non-unique) trap numbers.  Replace rsvd[1-14] by rsvd.

locore.s:
Enable alignment check flag on 486's and 586's.

machdep.c:
Use a better type for kstack[].

Use TFREGP() to find the registers.

Reformat ptrace functions from SEF to something closer to KNF.

procfs_machdep.c:
The wrong pointer to the registers got fixed as a side effect.

Implement reading and writing of FP registers.

/proc/*/*regs now work (only) for processes that are in memory.

Clean up comments.

trap.c, trap.h:
Remove unused trap types.
1995-01-14 13:20:26 +00:00
David Greenman
ec2bb6ade1 Increase maxfiles to NPROC*2. This makes the per-process open file limit
highly bogus, however, and this needs to be fixed.
1995-01-12 03:38:12 +00:00
David Greenman
c3d05da5e3 MFS doesn't bother to associate a struct mount with the vnode...so work
around this by not trying to cluster this type of I/O.

Submitted by:	John Dyson
1995-01-11 01:53:18 +00:00
David Greenman
5943df8331 PG_FAKE is no longer used - so don't bother to clear it. 1995-01-10 09:20:34 +00:00
David Greenman
480dff540b Fixed some formatting weirdness that I overlooked in the previous commit. 1995-01-10 07:32:52 +00:00
David Greenman
0d94caffca These changes embody the support of the fully coherent merged VM buffer cache,
much higher filesystem I/O performance, and much better paging performance. It
represents the culmination of over 6 months of R&D.

The majority of the merged VM/cache work is by John Dyson.

The following highlights the most significant changes. Additionally, there are
(mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to
support the new VM/buffer scheme.

vfs_bio.c:
Significant rewrite of most of vfs_bio to support the merged VM buffer cache
scheme.  The scheme is almost fully compatible with the old filesystem
interface.  Significant improvement in the number of opportunities for write
clustering.

vfs_cluster.c, vfs_subr.c
Upgrade and performance enhancements in vfs layer code to support merged
VM/buffer cache.  Fixup of vfs_cluster to eliminate the bogus pagemove stuff.

vm_object.c:
Yet more improvements in the collapse code.  Elimination of some windows that
can cause list corruption.

vm_pageout.c:
Fixed it, it really works better now.  Somehow in 2.0, some "enhancements"
broke the code.  This code has been reworked from the ground-up.

vm_fault.c, vm_page.c, pmap.c, vm_object.c
Support for small-block filesystems with merged VM/buffer cache scheme.

pmap.c vm_map.c
Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of
kernel PTs.

vm_glue.c
Much simpler and more effective swapping code.  No more gratuitous swapping.

proc.h
Fixed the problem that the p_lock flag was not being cleared on a fork.

swap_pager.c, vnode_pager.c
Removal of old vfs_bio cruft to support the past pseudo-coherency.  Now the
code doesn't need it anymore.

machdep.c
Changes to better support the parameter values for the merged VM/buffer cache
scheme.

machdep.c, kern_exec.c, vm_glue.c
Implemented a seperate submap for temporary exec string space and another one
to contain process upages. This eliminates all map fragmentation problems
that previously existed.

ffs_inode.c, ufs_inode.c, ufs_readwrite.c
Changes for merged VM/buffer cache.  Add "bypass" support for sneaking in on
busy buffers.

Submitted by:	John Dyson and David Greenman
1995-01-09 16:06:02 +00:00
Bruce Evans
4c5e4b09a7 Fix error handling for new TIOCSDRAINWAIT ioctl. 1995-01-06 14:56:42 +00:00
Stefan Eßer
623976474c Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Reviewed by: <wollman>
First hooks and defines for the ISDN driver,
that soon will see the light ...
1995-01-05 19:51:51 +00:00
Andrey A. Chernov
33c38bd574 Fight against hanging modems: add timeout to ttywait.
Reviewed by: Bruce
1995-01-05 00:01:07 +00:00
Jordan K. Hubbard
95da7f140e Another part of Bill Paul's fix to swapgeneric to properly use the -a flag.
Submitted by:	wpaul
1994-12-31 17:15:16 +00:00
Bruce Evans
62f603b64d Change an 0 to WHOLE_DISK_SLICE. 1994-12-30 12:19:11 +00:00
Bruce Evans
2336b9d7d7 Print "(null)" instead of "<null>" for NULL string args for consistency
with the libc and ddb printf's.

Print "(fmt null)\n" for NULL formats.
1994-12-30 12:17:42 +00:00
David Greenman
8f5067ba28 Make printf() a bit more robust and allow NULL strings (print them as
"<null>"). It bad to have diagnostic printfs cause panics when they are
trying to tell you about another problem.
1994-12-28 06:28:34 +00:00
David Greenman
be6a1d148e Fixed multiple bugs that cause null pointers to be followed or FREEed data
to be accessed if a process blocks when it is being run down.
1994-12-28 06:15:08 +00:00
Bruce Evans
13d7c724ca Obtained from: 1.1.5
Fix single-stepping of emulated FPU instructions.

Don't panic if an FPU instruction is attempted but there is no FPU
and no FPU emulator is configured.
1994-12-24 07:22:58 +00:00
David Greenman
602d2b481a Protect vnode buffer chain manipulation with splbio to prevent list
corruption..
1994-12-23 04:52:55 +00:00
Bruce Evans
222d875bec Print `slicename' and not a bogus pointer in diskerr() 1994-12-22 04:42:31 +00:00
Joerg Wunsch
91c38cb885 Ooops, i forgot one NVT > 0 in a previous commit. Now pcvt will also
work as the system's console.
1994-12-18 19:42:41 +00:00