Commit Graph

429 Commits

Author SHA1 Message Date
Poul-Henning Kamp
ee1cbe818e When past cyl 1024 it's ok if CHS is (0xff,0xff,0xff).
It's actually recommended it seems...
1995-05-01 00:45:33 +00:00
Bruce Evans
0c3f2f6436 Change dsioctl() interface to allow DIOCSYNCSLICEINFO to update the caller's
slice pointer and to print the device name in error messages.

Finishing implementing DIOCSYNCSLICEINFO (except for locking).
1995-04-30 15:16:02 +00:00
David Greenman
af9c31e108 Added UIO_NOCOPY case to ureadc() to quiet gcc. 1995-04-30 05:11:46 +00:00
David Greenman
fc3d49a9dc Check for curproc != NULL before dereferencing it. 1995-04-30 05:09:13 +00:00
Andrey A. Chernov
2c3be6c34e set[ug]id(): call suser() only when neccesarry
Submitted by: bde
1995-04-29 11:46:15 +00:00
Jordan K. Hubbard
bcac561761 Bruce is right - ENOTTY is more appropriate than EINVAL in this case. 1995-04-29 11:36:47 +00:00
Jordan K. Hubbard
65b36cbb7d fixes the ioctl routine to not chew up massive amounts of kernel time
if an invalid ioctl is done on /dev/klog.  logioctl() needs to return
an errno instead of -1 on a failed ioctl.
Submitted by:	Mike Pritchard <mpp@mpp.com>
1995-04-29 05:09:19 +00:00
Andrey A. Chernov
d3cdb93dd8 Implement POSIX SAVED_IDS for setuid/setgid 1995-04-28 18:17:29 +00:00
Andrey A. Chernov
611d721e70 setre*(): simplify return scheme, pointed by Bruce 1995-04-28 17:00:27 +00:00
Andrey A. Chernov
4bc8f31ff3 Implement setreuid/setregid according to SunOS manpage 1995-04-27 19:23:24 +00:00
Bruce Evans
48b2a92193 Add ioctls DIOCGSLICEINFO and DIOCSYNCSLICEINFO. The latter isn't
finished or tested.
1995-04-24 17:07:08 +00:00
Bruce Evans
0f1a48177b Undo the move of `#include "sc.h"' etc. to cons.h. It broke anything
that includes <machine/cons.h>.
1995-04-24 16:43:01 +00:00
Bruce Evans
b0ba7f5601 Make bad144 debugging code conditional on ds_debug. 1995-04-24 06:04:36 +00:00
Bruce Evans
e770b51673 Declare the console switch functions completely.
Move declarations of console functions to cons.h (they should be
config(8)ed).
1995-04-23 12:55:55 +00:00
Andrey A. Chernov
e876c909da Make setreuid/setregid active syscalls 1995-04-23 12:22:06 +00:00
Bruce Evans
453de7da68 Correct the type of the `acflag' arg to suser(). 1995-04-23 08:31:02 +00:00
Poul-Henning Kamp
453e527dcb We will use /sbin/init on cdrom too. 1995-04-23 04:13:51 +00:00
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