Commit Graph

77 Commits

Author SHA1 Message Date
Poul-Henning Kamp 4ac5f60572 Changes John's handling of the flags a little bit, added a new one,
(0x4000 == sleephack) to handle disks which are confused after a sleep.
Fixed a spelling error.
1995-04-24 05:12:29 +00:00
Poul-Henning Kamp 8b756b1a9a Did a s/[ \t]*$// 1995-04-24 05:09:53 +00:00
John Dyson bb48557835 Implemented the multi-sector I/O enable and the 32 bit I/O probe
through the use of the config file flags as opposed to the option
"NSECS_MULTI".  "NSECS_MULTI" has been removed from the driver.
The new capability allows boot-time modification of the config.
1995-04-24 04:32:31 +00:00
John Dyson 74d2d21c68 Change the initial delay in wdwait to a DELAY macro call. It is really
too long, but does not impact performance very much when using the
NSECS_MULTI option.  This will help solve some mysterious IDE I/O
problems.
1995-04-22 22:44:30 +00:00
Poul-Henning Kamp c112d76dd6 I commit this for Bruce, who has serious connectivity problmes pt.
This should NOT go into 2.0.5  /phk

Support disk slices.  This involves mainly replacing inline code with
function calls.  Support for ST506 drives is temporarily broken since
the `setgeom' arg to dsopen() is not implemented completely enough to
use.  The `setgeom' arg will go away and ST506 drives will be supported
in another way.  A large amount of dead code is left in wdopen() as a
reminder of the problems here.

Close the device in wdsize().  Open tracking was broken on all drives
with a swap device.

Remove support for soft write protection.  There are no ioctls to set
it.  It was used to disable writing to unlabelled disks, but we want
to support writing to foreign partitions on unlabeled disks.

Use generic dkbad routines to do about 2/3 of the work for supporting
bad144.

Improve disk statistics: estimate 4MB/sec instead of 8MB/sec for
the transfer rate (ISA max is 4MB/sec, old IDE max is 3.3MB/sec);
fix dk_xfer[] (it counted sectors, not transfers); keep the estimate
dk_seek[] = dk_xfer[] (was sectors, is now transfers); only count
words actually transferred (the count is still too high after a
failed write and after retries).  Remove wdxfer[].

Fix indentation in wdattach().  Fix resulting botched printing of the
disk size for ST506 drives.  Print the disk geometry less cryptically.
1995-04-14 22:31:58 +00:00
Garrett Wollman 6c0081e92b Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago).  For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device.  The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out.  A few bytes saved by using
%b to format the features list rather than lots of ifs.
1995-04-12 20:48:13 +00:00
David Greenman e9dd619d44 From John Dyson: Disabled multi-sector I/O. It is causing some people
problems.
1995-04-09 06:09:31 +00:00
David Greenman efea4e5256 Fixes and improvements from John Dyson:
Fixed the I/O statistics
Allow WD1007 type controllers to work
Support MULTI-BLOCK I/O
Correct delay to use port 0x84, reading the status register
	might not be a long enough delay.
Changed probe message to match SCSI type devices.
1995-03-22 05:23:01 +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
David Greenman 7c89bce067 Removed an old (commented out) call to cldisksort(). This has been
obsolete since 4.4 clustering.
1995-03-06 05:40:44 +00:00
David Greenman 9ddf48f0d2 Slight change to wdwait() to improve performance while not violating the
ATA spec.

Submitted by:	John Dyson
1995-02-27 06:42:35 +00:00
Bruce Evans 77a6e242ae Declare all the args of wdclose() and wdioctl(). Cosmetic. 1995-02-26 01:15:30 +00:00
Poul-Henning Kamp 19393bbed2 Support 32bit access to IDE disks, if it seems to work for the drive.
You will normally have to have a VLB or other 32bit IDE "controller" for
this to work.

Depending on your setup, this may gain you 20-100 % speed from your disk.

Reviewed by:	phk
Submitted by:	vak@cronyx.ru
1995-02-04 19:39:36 +00:00
Bruce Evans b5d89ca8ad Load the kernel symbol table in the boot loader and not at compile time.
(Boot with the -D flag if you want symbols.)

Make it easier to extend `struct bootinfo' without losing either forwards
or backwards compatibility.

ddb_aout.c:
Get the symbol table from wherever the loader put it.
Nuke db_symtab[SYMTAB_SPACE].

boot.c:
Enable loading of symbols.  Align them on a page boundary.  Add printfs
about the symbol table sizes.
Pass the memory sizes to the kernel.
Fix initialization of `unit' (it got moved out of the loop).
Fix adding the bss size (it got moved inside an ifdef).
Initialize serial port when RB_SERIAL is toggled on.
Fix comments.
Clean up formatting of recently added code.

io.c:
Clean up formatting of recently added code.

netboot/main.c, machdep.c, wd.c:
Change names of bootinfo fields.

LINT:
Nuke SYMTAB_SPACE.
Fix comment about DODUMP.

Makefile.i386:
Nuke use of dbsym.
Exclude gcc symbols from kernel unless compiling with -g.
Remove unused macro.
Fix comments and formatting.

genassym.c:
Generate defines for some new bootinfo fields.  Change names of old ones.

locore.s:
Copy only the valid part of the `struct bootinfo' passed by the loader.
Reserve space for symbol table, if any.

machdep.c:
Check the memory sizes passed by the loader, if any.  Don't use them yet.

bootinfo.h:
Add a size field so that we can resolve some mismatches between the loader
bootinfo and the kernel boot info.  The version number is not so good for
this because of historical botches and because it's harder to maintain.
Add memory size and symbol table fields.  Change the names of everything.

Hacks to save a few bytes:

asm.S, boot.c, boot2.S:
Replace `ouraddr' by `(BOOTSEG << 4)'.

boot.c:
Don't statically initialize `loadflags' to 0.  Disable the "REDUNDANT"
code that skips the BIOS variables.  Eliminate `total'.  Combine some
more printfs.

boot.h, disk.c, io.c, table.c:
Move all statically initialzed data to table.c.

io.c:
Don't put the A20 gate bits in a variable.
1995-01-25 21:40:47 +00:00
Bruce Evans 11fa0751bc Fix the "wd" count stat. The seek and xfer stats are still very bogus
for wd (they both count the number of sectors).  The wpms stat is still
moderately bogus for all drivers.  Even the count stat could be handled
better (partial blocks should be counted as full blocks; should errors
and retries be counted?).
1994-12-24 09:43:12 +00:00
Guido van Rooij a7e6a0941a lsdev paniced the machine when 2 (or more) ide controllers are installed.
Beware for cut and paste!

Reviewed by:
Submitted by:
Obtained from:
1994-12-13 18:20:08 +00:00
Poul-Henning Kamp e0985944c1 Improve the case for ST506 disks a bit: Pick up Bios-geometry.
That was the good news.  The bad news is that bad144 is a proper mess,
and I don't have time to fix it now, so you will probably not be able to
use it anyway.
Sorry guys, go out and buy a 100Mb IDE drive and a paddleboard :-(
If somebody wants to pick up on this:  bad144 needs to learn how to
stay inside our slice of the disk.  That's the trick.
1994-11-18 11:27:41 +00:00
Poul-Henning Kamp 5ffd7168ce Last commit was bogus. Changed b_bsize to b_bcount. 1994-11-04 05:21:17 +00:00
Joerg Wunsch f73af18476 |Both, the wd and the sd driver do not reject invalid request of odd
|sizes. They simply pass them to the disks, which usually causes
|fatal errors then.
1994-11-03 18:20:15 +00:00
Jordan K. Hubbard 54c7241bd3 Julian Elischer's disklabel fixes. 1994-10-27 20:45:13 +00:00
Poul-Henning Kamp c5bd56befa Extra intr's have nothing to do with LAPTOP.
Made five-strikes-we-shut-up for timeouts.
Inspired by:  bde in 1.1.5.1-patch011
1994-10-27 05:39:12 +00:00
Garrett Wollman 2f86936a07 Finished device configuration database work for all ISA devices (except `ze')
and all SCSI devices (except that it's not done quite the way I want).  New
information added includes:

-	A text description of the device
-	A ``state''---unknown, unconfigured, idle, or busy
-	A generic parent device (with support in the m.i. code)
-	An interrupt mask type field (which will hopefully go away) so that
.	  ``doconfig'' can be written

This requires a new version of the `lsdev' program as well (next commit).
1994-10-23 21:28:03 +00:00
Poul-Henning Kamp d2f7959c5a The wdprobe was too picky. 1994-10-22 01:57:12 +00:00
Poul-Henning Kamp 953ca71d9d Peter Dufaults comconsole changes.
Submitted by:	Peter Dufault
1994-10-20 00:08:31 +00:00
Garrett Wollman 922006325b isa.c isa_device.h: declare & define {e,}isa_{in,ex}ternalize().
fd.c: register devices and implement disk stats.
wd.c: fix disk stats and call isa_externalize() as appropriate.
1994-10-19 00:08:07 +00:00
Garrett Wollman d9581afbd9 MDDT_WDC -> MDDT_DISK
(NB: this is still not done yet.)
1994-10-17 23:34:21 +00:00
Garrett Wollman 3b97fdf905 Add semi-bogus initialization of dk_wpms so that systat and friends actually
do something useful with the disk stats.  (This needs to be determined
dynamically, but I don't want to screw with this driver.)
1994-10-16 05:02:37 +00:00
Garrett Wollman e78014a8dc Add interface to new device configuration table. Also implement
transfer statistics for iostat, vmstat, and systat.
1994-10-16 03:50:36 +00:00
Poul-Henning Kamp db9c7160f8 Reviewed by: phk
Submitted by:	 Thomas David Rivers <rivers%ponds@ncren.net>

WARNING: might hide some bug below!  I commit this to improve the stability
of 2.0.

Thomas wrote:
-------------
 I have been running a kernel with this change since October 4th; barring
unrelated network router troubles, the pitiful little machine has
completed several builds without any interaction from me, and continues
to chug along.

 I re-read wd.c, and added appropriate printfs() to look for references
to dk_badsect[].  My changes should have printed something when dk_badsect[]
was referenced.

 I got no output :-(

 Thus, I'm forced to concluded that something else is examining some
spurious memory... which happened to be in dk_badsect[] of the disk structure
in wd.c.  I can find no other explanation of why this unnecessary
initialization causes things to operate correctly.

 On the premise that such an initialization isn't going to hurt anything,
I'm going to suggest it go into 2.0.

 I'd like to thank everyone for there assistance, particularly David,
John and Bruce.
1994-10-07 21:17:41 +00:00
Poul-Henning Kamp 51b713ac2b Ripped out APM-hooks. Not ready for prime time yet. 1994-10-02 17:41:44 +00:00
David Greenman 22414e535a Laptop Advanced Power Management support by HOSOKAWA Tatsumi.
Submitted by:	HOSOKAWA Tatsumi
1994-10-01 02:56:21 +00:00
David Greenman c1bb2f57d0 Brought over two fixes from 1.1.5; this now makes this driver "up to date"
with 1.1.5:

  revision 1.40
  date: 1994/06/17 16:57:03;  author: pst;  state: Exp;  lines: +4 -2
  From: Gill Kloepfer Jr. <gil@limbic.ssdl.com>
  Verified by: pst

  > The DIOCSBAD ioctl sets a bad block table (is almost suredly called by
  > the bad144 utility) and changes the memory-resident bad block table.  The
  > problem is that bad144intern() is not called after the "disk" structure has
  > been changed, so that the internal bad144 table will become out-of-sync with
  > the one in the disk structure.
  ----------------------------
  revision 1.39
  date: 1994/06/07 01:36:39;  author: phk;  state: Exp;  lines: +3 -2
  another place option !defined(DISKLABEL_UNPROTECTED) was needed.
1994-09-10 03:19:49 +00:00
Andrey A. Chernov b7a8860d88 Change WDRAW back to 3, too early step right now, disklabels needs more
work
Change hardcoded 'd' in printfs to 'a' + WDPART
1994-08-30 14:26:13 +00:00
Andrey A. Chernov 8a1d40881d Now WDRAW=2 1994-08-29 21:35:16 +00:00
Paul Richards d091793974 Ran ft.c through ident.
Added a missing #ifdef INET wrapper in lpt.c

Main change:
	Removed the timeout_func_t casts from timeout calls and
	correctly defined the timeout routines to conform to
	the new format.
lpt.c doesn't have this change.

Reviewed by:
Submitted by:
1994-08-23 07:52:29 +00:00
Garrett Wollman f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
David Greenman e80859e4d6 Last commit for this file should have read:
Reduced maximum transfer size by one to allow for catching a too large
condition correctly. Do single block I/O if the size is too large.

Submitted by:	Bruce Evans
1994-08-08 13:56:46 +00:00
David Greenman 7d7bb69d41 Detect the "EOF" condition. Specifically, end of partition.
Submitted by:	Bruce Evans
1994-08-08 13:53:55 +00:00
Rodney W. Grimes 26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
David Greenman 0e195446b7 Bug fixes and performance improvements from John Dyson and myself:
1) check va before clearing the page clean flag. Not doing so was
	causing the vnode pager error 5 messages when paging from
	NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
	it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
	now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
	(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
	how well 4MB machines work now.
1994-04-20 07:06:57 +00:00
Geoff Rehmet 5bc9752a71 Modify wdprobe() to correctly recognise some 2 drive systems,
on which it was failing.  Modifications follow ATA, but also
allow some weird setups which seem to contradict ATA (aaarrrrgghhh!!)
1994-04-10 11:17:13 +00:00
Jordan K. Hubbard 068a409099 Beginning of change set for making more friendly laptop configurations.
Changes _only_ take effect if `options LAPTOP' is set.

Note:  This one is distinctly dodgy. When my IDE drive spins back up from sleep
mode, it generates this `extra interrupt' condition by spinning back up and
generating an intr, though without any particular action required.  This
message coming out every time is rather annoying, and thus disabled.
However, what I'm not at all sure of is whether or not all IDE drives will
behave in the same way, or if perhaps it needs to be done in a more complicated
fashion by detecting this more involved "I've spun up and am just saying hi"
condition.  This is a simple change and easy to back out/ammend if anybody has
any better ideas.
1994-03-06 03:10:58 +00:00
Andrey A. Chernov 3b2acd20e0 1) My previous fix does nothing, now Rod's fix rewrited to implement
my previous fix too (using wdp_heads controller value) and check
0 heads case too.

Other fixes from Bruce:
2) Fix dk_timeout from 2 to about 4 seconds.
3) wdcontrol not retried on internal error.
4) wdwait return check changed ( "!=0" to "<0" into wdsetctlr,
"<0" to "!=0" into wdgetctlr).
1994-03-04 16:43:07 +00:00
Andrey A. Chernov 3932675839 Better fix for >16 heads problem, right value from
controller restored.
1994-02-25 23:17:40 +00:00
Rodney W. Grimes 5086a82862 Fix off by one error 1994-02-23 11:14:26 +00:00
Rodney W. Grimes 97687d1b3d More clean up of the drive Id string, trancate trailing spaces. 1994-02-22 22:13:37 +00:00
Rodney W. Grimes 1004b0634c The model string can be 40 bytes long with no terminating null, so
convert all nulls to spaces and then print it with a %40s.
1994-02-22 18:51:27 +00:00
Rodney W. Grimes 84a161c5f1 Clean up dmesg output so that it matches the scsi stuff.
Small hack, if heads > 16, output a warning and then set the head
count to 16.  This stops the infinite loop on this error and allows
people to later fix the DOS parameter table later with fdisk.
1994-02-21 12:32:33 +00:00
Nate Williams b21df1d16c Added third parameter to wdwait which contains the amount of time to
'wait' based on suggestion by Rod in -hackers.

No functional change as all the TIMEOUTS are identical currently, but
this will probably change.
1994-02-11 12:02:35 +00:00
Andrey A. Chernov 2803eb968a Add "wdx: not found" diagnostic missed in previous commits 1994-02-07 15:40:38 +00:00