Commit Graph

130 Commits

Author SHA1 Message Date
Doug Rabson ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Julian Elischer 31e22aca20 An effort to make SLICE/DEVFS play with SCSI.
Apparently I didn't make my plans to make dev_t and devsw[] go away
under DEVFS quite clear enough to Peter Dufault as he stitched the SCSI
system together using them when he redid the configuration side of things.
This made is rather an effort to remove all vestiges of dev_t and
devsw[] entries from sd.c in DEVFS/SLICE mode.
1998-05-07 12:13:47 +00:00
Julian Elischer 309251a601 cleanup: remove duplicated dump code.
fix oversight on SLICE ioctl code.
1998-05-07 02:05:21 +00:00
Julian Elischer 7f2f1b784e Add dump support to the DEVFS/slice code.
now we can actually catch our crashes :-)

Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
1998-05-06 22:14:48 +00:00
Dag-Erling Smørgrav 8fc5e57330 Fixed spelling of "fictitious" in diagnostics and comments
PR:		kern/6429
1998-04-27 11:36:06 +00:00
Julian Elischer 26d3bf5f1b close() is no longer a SLICE method.
Close is simply an open with no-read and no-write once internal to SLICE
(it still exports a close to the rest of the kernel)
1998-04-22 10:25:27 +00:00
Julian Elischer 3e425b968d Add changes and code to implement a functional DEVFS.
This code will be turned on with the TWO options
DEVFS and SLICE. (see LINT)
Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes.

/dev will be automatically mounted by init (thanks phk)
on bootup. See /sys/dev/slice/slice.4 for more info.
All code should act the same without these options enabled.

Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others

This code does not support the following:
bad144 handling.
Persistance. (My head is still hurting from the last time we discussed this)
ATAPI flopies are not handled by the SLICE code yet.

When this code is running, all major numbers are arbitrary and COULD
be dynamically assigned. (this is not done, for POLA only)
Minor numbers for disk slices ARE arbitray and dynamically assigned.
1998-04-19 23:32:49 +00:00
Dag-Erling Smørgrav dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Bruce Evans c1087c1324 Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
Eivind Eklund d94f38ace2 Add HW_WDOG to LINT, and turn it into a new-style option. 1998-02-16 23:57:49 +00:00
Eivind Eklund 7b778b5e61 Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)

LFS is temporarily disabled, and will be re-enabled tomorrow.
1998-01-24 02:54:56 +00:00
Julian Elischer 58ffdf1d65 If available, use the device's LOGICAL blocksize as reported by
the "READ_CAPACITY" command, rather than the physical blocksize
reported in the physical geometry code-page.

Also don't print out worrying bogus messages when probing a
device that has no media. There's no point in printing out
something that is unknowable. It just confuses things.

Move the check for valid blocksize out of 'open()' to the subroutine
that actually finds this out, thus probe/attach can also report and
act on the problem.
1997-12-29 07:49:31 +00:00
Julian Elischer 928bf16d25 back out previous commit
got a better version.
1997-12-28 09:10:37 +00:00
Julian Elischer fb05cb0121 Move the sector size check to the right place,
also cope with some drives that return funny values.
The correct fix will come in a few days.
1997-12-28 07:10:54 +00:00
Bruce Evans df1c78063c Use ENOIOCTL instead of -1 (= ERESTART) for diskslice ioctls that are
not handled at a particular level.
1997-12-06 14:27:56 +00:00
Poul-Henning Kamp ab3f746966 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
Bruce Evans 37b4744c2a Fixed the sector size frobbing in sd_strategy() at least not to
break for the usual sector size.  dscheck() adjusts b_bcount to
handle EOF, so we must scale it and not preserve it.  i/o beyond
the end of partitions has been broken since rev.1.96.

Not fixed in:	od driver
1997-11-23 11:30:42 +00:00
Poul-Henning Kamp 4a11ca4e29 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
Joerg Wunsch 4dec470e39 Remove the call to scsi_start_unit() from sd_open(). It was causing
much grieve to owners of IBM drives when used in conjunction with
tagged command queuing, and didn't serve any purpose at all (since
experiments have proven that it simply didn't work).

Instead, call scsi_start_unit() once in sd_attach(), so in case the
drive has been configured to `remote start', it will spin up there.
(If it has spun down later, it must have been because of administrator
action (scsi(8)) anyway.)

While i was at it, bump the timeout for scsi_start_unit() to 30
seconds.  10 seconds were way too few for most drives.
1997-10-12 08:54:47 +00:00
Justin T. Gibbs e74a2bdcb0 Convert to use the new bufq* functions for dealing with buffer
queues.
1997-09-21 22:03:22 +00:00
Joerg Wunsch cae6f73ac2 Revert the logic behind my last change, and use a function called
`is_physical_memory()' now for the decision whether to dump some
region of memory or not.

Suggested by:	davidg
1997-09-13 16:12:15 +00:00
Joerg Wunsch e0b78e19f2 Do not ever try to coredump adapter memory regions.
PR:		4486
Submitted by:	tegge@idi.ntnu.no (Tor Egge)

Implement a function is_adapter_memory() in order to determine what
should nto be dumped at all.  Currently, only populated with the ``ISA
memory hole''.  Adapter regions of other busses should be added.
1997-09-10 12:31:40 +00:00
Bruce Evans e4ba6a82b0 Removed unused #includes. 1997-09-02 20:06:59 +00:00
Julian Elischer 63fe995cb4 Teach both disk drivers how to cope with a hardware watchdog
while dumping core.. I'm tired of getting 1/2 of a core-dump

conditional on -DHW_WDOG for now
this will migrate to 2.2 as that's where I need it.
1997-08-09 01:44:25 +00:00
Tor Egge 7a1d27b301 Introduce an advisory exclusive lock on the scsi link structure.
Change sd_open, sd_close and sd_ioctl to use this lock to ensure
serialization of some critical operations, thus avoiding some
race conditions. Ideas picked from NetBSD (ccd and sd devices).
This fixes one of the problems noted in PR kern/3688.
Reviewed by:	"Justin T. Gibbs" <gibbs@plutotech.com>
1997-06-25 19:07:43 +00:00
Søren Schmidt 19accede88 Remove old code in #if 0, leftovers from the days before != 512byte
sector support.
1997-05-01 19:15:38 +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
Bruce Evans 6617929964 Removed nested #includes of <scsi/scsi_debug.h> and <scsi/scsi_driver.h>
from <scsi/scsiconf.h> and fixed everything that depended on them.
1997-03-23 06:33:55 +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
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
KATO Takenori ed39d36d27 Moved PC-98 routine in sd_get_parms() to pc98_machdep.c. 1997-02-04 22:27:09 +00:00
Bruce Evans 0f49e57b57 Removed `Debugger("no slices")'. It's normal and harmless to have no
slices in sd_open() after a media change when the previous sd_open()
discards the previous slices and then fails.  sd_open() just handles
media changes poorly and fails too often.
1997-01-29 14:18:34 +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 4eb73cdaff Removed all references to b_cylinder (aka b_cylin). It was evil and
hasn't been used for a year or two since disksort() started sorting
on b_pblkno.
1996-12-01 16:34:41 +00:00
Søren Schmidt 7cb29d3394 This update adds the support for != 512 byte sector SCSI devices to
the sd & od drivers. There is also slight changes to fdisk & newfs
in order to comply with different sectorsizes.
Currently sectors of size 512, 1024 & 2048 are supported, the only
restriction beeing in fdisk, which hunts for the sectorsize of
the device.
This is based on patches to od.c and the other system files by
John Gumb & Barry Scott, minor changes and the sd.c patches by
me.
There also exist some patches for the msdos filesys code, but I
havn't been able to test those (yet).

	John Gumb (john@talisker.demon.co.uk)
	Barry Scott (barry@scottb.demon.co.uk)
1996-12-01 11:25:38 +00:00
Bruce Evans a7f8f2ab55 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.
1996-09-14 04:31:09 +00:00
Poul-Henning Kamp bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Satoshi Asami 1225e2435d Second phase of merge, get rid of more machine-independent-dependencies.
Get rid of pc98/pc98/pc98_device.h.

Submitted by:	The FreeBSD(98) Development Team
1996-09-03 10:24:29 +00:00
Peter Wemm 2176b02c56 The sd and od drivers didn't check for negative block numbers (like wd.c
does) before calling dscheck().  dscheck() doesn't appreciate this and
calls Debugger() and returns without setting bp->b_error.

This can happen when there is a casting error and offsets > 2G are
converted to negative off_t's in the disk tools.  (dumpfs used to do this).
1996-08-02 06:10:49 +00:00
Poul-Henning Kamp cba8a5ddd3 Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.

No functional change intended nor expected.

GENERIC should be about one k smaller now :-)
1996-07-23 21:52:43 +00:00
Satoshi Asami ad63a118b2 The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.

Ok'd by:	core
Submitted by:	FreeBSD(98) development team
1996-06-14 11:02:28 +00:00
Poul-Henning Kamp 031ce85e23 Don't fiddle page tables by hand, use pmap_enter.
(copied from wd.c)
1996-05-02 22:20:52 +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
Bruce Evans 6ae323519c Fixed group of disk devices (was wheel or games, now operator).
Added scsi control devices.

Converted almost everything that I changed to use devfs_add_devswf()
and verbose id macros.

st.c:
Renamed enrst* to erst* since that's what the current name is (enrst
seems to be an old name).
1996-03-27 18:50:10 +00:00
Justin T. Gibbs 9932c050b9 Cleanse the SCSI subsystem of its internally defined types
u_int32, u_int16, u_int8, int32, int16, int8.
	Use the system defined *_t types instead.
1996-03-10 07:13:15 +00:00
Peter Wemm 4bd4912865 Add more options into the conf/options and i386/conf/options.i386 files
and the #include hooks so that 'make depend' is more useful.  This
covers most of the options I regularly use (but not all) and some other
easy ones.
1996-03-02 18:24:13 +00:00
Bruce Evans c8f2fe8db8 First attempt at creating devfs entries for sliced devices. Doesn't
quite work yet, so the heart of it is disabled.

Added bdev and cdev args to dsopen().

drivers:
Fixed device names, links, minor numbers and modes.

wd.c:
Started actually supporting devfs.

diskslice.h:
Added devfs tokens to structs (currently 576 of them per disk! :-().

subr_diskslice.c:
Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times.  DEVFS is #undefed at the start so
that this shouldn't cause problems.
1996-01-27 04:18:15 +00:00
Garrett Wollman 8890984dc9 Convert BOUNCE_BUFFERS and BOUNCEPAGES to new option scheme. 1996-01-05 20:12:53 +00:00
Bruce Evans 9bea3bb463 Declared functions as static in their definitions as well as in their
prototypes.
1995-12-14 19:38:40 +00:00
John Dyson 983d613468 Undo a change that should not have been committed with the 1Tb enhancements. 1995-12-11 05:02:52 +00:00