Commit Graph

412 Commits

Author SHA1 Message Date
Poul-Henning Kamp
f4d1e3d1e7 Remove the slice for the first 63 sectors for the OnTrack case, it's useless
and nobody care about it anyway.
1995-04-20 06:01:51 +00:00
Bill Paul
de2a1afc47 Undo the stupidity I inflicted on these files and replace it with
some (hopefully) less offensive stupidity:

If we detect that a user has loaded a module that fails to initialize
itself correctly, panic. There really isn't a safe way to recover from
something like this; we can't know that the module is bad until after
the entry point is called, by which time it's too late to do anything
about it.
1995-04-20 05:08:53 +00:00
Poul-Henning Kamp
0e175c5ef0 Added support for disks which "OnTrack Disk Manager" has munged.
I suggest you do all partitioning using the OnTrack SW, to avoid
confusing it.
1995-04-20 01:21:51 +00:00
Bill Paul
e1797c1a96 Couple of small cosmetic changes:
- Add $Id$ string.
- Fix comment ("we might *not* be able to unload the
module afterwards without panicking...")
- Get rid of variable 'j' that I used in name checking
for(;;) loop and use 'i' instead (I thought there'd be
a problem with this, but there isn't).
1995-04-18 14:10:21 +00:00
Bill Paul
f13524346b Fix module handling to stop oddball modules (if_ppp_mod, if_sl_mod,
if_tun_mod, etc...) from crashing the system. These modules are useful,
but because they don't yet have proper load()/unload() functions,
they can lead to panics: if, for example, you load the if_ppp module,
any user can panic the system by running modstat.

You can also hang the system outright if you try to unload the PPP
module too.

Changes are as follows:

- Save the name passed to us during the RESERVE stage for name matching
(we can't load if_ppp_mod twice: we've have two ppp0's and two ppp1's,
which is beyond strange). This makes the lkmexists() cheks somewhat
redundant, but there's no way around it that I can see.

- If we call the module entry point and find that we have no lkm_any
structure in our 'private' section, create a fake one. This keeps
modstat happy. We mark such modules as LM_UNKNOWN.

- Don't allow LM_UNLOAD modules to be unloaded: it just ain't
possible. (Unless someone wants to write a pppunattach() function. :( )

- In lkmunreserve(), mark private.lkm_any as NULL so we don't get
confused later. I think this is bogus, but I can't prove it.

XXX: the name matching used to keep the user from loading two
instances of the same module can easily be defeated simply by
changing the module name or, in the case of the oddball modules,
simply by renaming the module files. I haven't found a nice simple
way to tell one module from another.
1995-04-18 02:29:26 +00:00
David Greenman
5baf11ce97 Removed unused & empty bufstats() function. 1995-04-16 12:02:42 +00:00
David Greenman
cece489df8 Killed gratuitous b_vp=NULL in bufinit. The entire buffer is already
bzero()'d.
1995-04-16 11:45:30 +00:00
David Greenman
1a477b0c27 Changed #ifdef around printlockedvnodes() from DEBUG to DDB. 1995-04-16 11:33:33 +00:00
David Greenman
5124d59831 Make vegetarian and animal rights people happy and use 0xdeadc0de instead
of 0xdeadbeef as the fill pattern. Decreased MAX_COPY to 64 (256 was a bit
overzealous in most cases).
1995-04-16 11:25:15 +00:00
David Greenman
d94a4c0434 1) Check for curproc != NULL in bread/bwrite. John convinced me that this
is necessary in order for panic+sync to work. Will also gloss over a panic
that Jordan was having with the install floppies that remains unexplainable.
2) Handle "bogus_page" a little better.
3) Set page protection to VM_PROT_NONE if the entire page has become !valid.

Submitted by:	John Dyson (2&3), me (1).
1995-04-16 05:11:14 +00:00
Bruce Evans
e2f03b0df0 Speed up ttnread() in the !(ICANON | ISIG) case by copying to user space
through a temporary buffer instead of one character at a time.  The old
method takes about 6 usec/char on a 486DX2/66.  This is larger than than
the combined interrupt and PIO overhead for a 16550!

This change was first implemented in 1.1.5.  It was rewritten for 2.1.
The clist access functions allow a simpler implementation at some cost
in correctness and speed.  There needs to be an ungetc() function to
recover from EFAULT, and it wastes time to copy through a temporary
buffer.

Don't snoop on single characters that weren't read due to EFAULT.
Rewrite a snoop comment in my approximation to English.

Undo bogus exportation of ttnread().
1995-04-15 21:04:58 +00:00
Poul-Henning Kamp
194c19ed17 Changes needed for kzip to work. 1995-04-15 06:54:13 +00:00
David Greenman
cf8ad5100d Fixed serious off by one bug I introduced that will likely cause the
machine to panic whenever the name cache fills up.

Submitted by:	John Dyson
1995-04-15 00:49:35 +00:00
David Greenman
f153fb6e99 Backed out previous change - it reduces performance. (oops). 1995-04-13 18:24:33 +00:00
Garrett Wollman
ef46188e27 Actually copy the class field over from the kernel to the user structure. 1995-04-13 15:33:14 +00:00
David Greenman
cf0ec51aec Slight optimization to select(). 1995-04-13 15:27:51 +00:00
Andrey A. Chernov
0a247e7d30 Extract "set" family functions to separate module, needed for
locking in sio f.e.
1995-04-11 17:54:25 +00:00
Poul-Henning Kamp
17755ac806 Changes to make FreeBSD use a CDROM as rootdev, for installation purposes.
If "BOOTCDROM" is defined, you get this pretty special case stuff.
1995-04-10 07:44:31 +00:00
Andrey A. Chernov
83d05492ed Call ptsstop in ptsclose instead of ptcwakeup 1995-04-10 01:45:43 +00:00
Andrey A. Chernov
9d9cea2bce ptcwakeup() was called from wrong places 1995-04-09 22:28:24 +00:00
David Greenman
213fd1b6e8 Changes from John Dyson and myself:
Fixed remaining known bugs in the buffer IO and VM system.

vfs_bio.c:
Fixed some race conditions and locking bugs. Improved performance
by removing some (now) unnecessary code and fixing some broken
logic.
Fixed process accounting of # of FS outputs.
Properly handle NFS interrupts (B_EINTR).

(various)
Replaced calls to clrbuf() with calls to an optimized routine
call vfs_bio_clrbuf().

(various FS sync)
Sync out modified vnode_pager backed pages.

ffs_vnops.c:
Do two passes: Sync out file data first, then indirect blocks.

vm_fault.c:
Fixed deadly embrace caused by acquiring locks in the wrong order.

vnode_pager.c:
Changed to use buffer I/O system for writing out modified pages. This
should fix the problem with the modification date previous not getting
updated. Also dramatically simplifies the code. Note that this is
going to change in the future and be implemented via VOP_PUTPAGES().

vm_object.c:
Fixed a pile of bugs related to cleaning (vnode) objects. The performance
of vm_object_page_clean() is terrible when dealing with huge objects,
but this will change when we implement a binary tree to keep the object
pages sorted.

vm_pageout.c:
Fixed broken clustering of pageouts. Fixed race conditions and other
lockup style bugs in the scanning of pages. Improved performance.
1995-04-09 06:02:46 +00:00
David Greenman
17792ebcb7 Added a few more entries to the list of prime numbers. 1995-04-09 01:19:25 +00:00
Joerg Wunsch
4fb0b0de3e Implement a simple hook (or hack?) to allow graphics device console
drivers to protect DDB from being invoked while the console is in
process-controlled (i.e., graphics) mode.

Implement the logic to use this hook from within pcvt.  (I'm sure
Søren will do the syscons part RSN).

I've still got one occasion where the system stalled, but my attempts
to trigger the situation artificially resulted int the expected
behaviour.  It's hard to track bugs without the console and DDB
available. :-/
1995-04-08 21:32:11 +00:00
David Greenman
bb2d12a636 Check for case of blkno already known to avoid unnecessary VOP_BMAP's.
Submitted by:	John Dyson
1995-04-04 02:10:17 +00:00
David Greenman
22e53424b2 kern_subr.c:
Added a new type to uiomove - "UIO_NOCOPY" which causes it to update
pointers and counts, but doesn't do any data copying. This is needed
for upcoming changes to the way that the vnode pager does its page
outs.
Added a new hash init function call "phashinit" that allocates and
initializes a prime number sized hash table.

vfs_cache.c:
Changed hashing algorithm to use the remainder of dividing by a prime
number to improve the distribution characteristcs. Uses new phashinit
function in kern_subr.c.
1995-04-04 02:01:13 +00:00
Andrey A. Chernov
efb76ea60f Back out changes related to locked bits until more elegant solution will be
found. Fix flags declarations.
1995-04-02 19:26:50 +00:00
Joerg Wunsch
9bb751a368 Attempt to fix the `you can log into console only once' problem (PR
#179).  The fix implements a ttyhalfclose() (sort of), resetting the
session and pgrp pointers when the physical device is about to be
closed.

Suggested by: bde
1995-04-02 16:14:51 +00:00
Andrey A. Chernov
c6345bc1b6 Fix error in TIOCSETC/TIOCSLTC, they need to call TIOCSETA.
Remove static from some functions, needed in sio (later)
1995-04-02 04:15:08 +00:00
Andrey A. Chernov
1ef5e50eee Return EINVAL instead of setting wrong in/out speed
Fix declaration of cc arrays
Remove static from compatspcodes, will needed in sio (later)
1995-04-02 03:51:53 +00:00
Joerg Wunsch
76e2642ce4 subr_prf.c used to provide an exported function kprintf(), but only had
a private declaration for it.  Declare the function publically instead.
1995-04-01 20:19:00 +00:00
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