History log of /freebsd-11-stable/sys/dev/mcd/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
349629 03-Jul-2019 markj

MFC r349627:
Remove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl.

admbugs: 768
Reported by: Alex Fortune
Approved by: so
Security: CVE-2019-5602
Security: FreeBSD-SA-19:11.cd_ioctl

320921 12-Jul-2017 jhb

Add deprecation notices for various device drivers removed in 12.0.

This is a direct commit to stable/11 since these files have already
been removed in head.

Reviewed by: sbruno, gjb
Differential Revision: https://reviews.freebsd.org/D11542

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
298646 26-Apr-2016 pfg

sys/dev: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.


274676 18-Nov-2014 jhb

Add locking to mcd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. MCDINIT being clear).
- Remove critical_enter/exit when sending a PIO command.
- Use bus_*() instead of bus_space_*().

Tested by: no one


260040 29-Dec-2013 dim

In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.

MFC after: 3 days


247069 21-Feb-2013 imp

The other giant locked storage drivers have removed splbio(), for the
most part, so remove it here too. Anybody locking this driver will need
far more than locks where splbio() were, so remove these nops.


146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


143063 02-Mar-2005 joerg

netchild's mega-patch to isolate compiler dependencies into a central
place.

This moves the dependency on GCC's and other compiler's features into
the central sys/cdefs.h file, while the individual source files can
then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to
refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.

By now, GCC and ICC (the Intel compiler) have been actively tested on
IA32 platforms by netchild. Extension to other compilers is supposed
to be possible, of course.

Submitted by: netchild
Reviewed by: various developers on arch@, some time ago


141061 30-Jan-2005 maxim

o Fix a typo.

Submitted by: Niclas Zeising


141031 30-Jan-2005 sobomax

Boot away another stackgap (one of the lest ones in linuxlator/i386) by
providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that
result has to be placed into kernel space not user space. In the long run
more generic solution has to be designed WRT emulating various ioctl()s
that operate on userspace buffers, but right now there is only one such
ioctl() is emulated, so that it makes little sense.

MFC after: 2 weeks


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


137045 29-Oct-2004 phk

No point in setting si_bsize_phys anymore, nobody reads it.

Use bioq_takefirst().


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126891 12-Mar-2004 trhodes

These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
- in_cksum.[ch]:
* use a generic C version instead of the assembly version in the !gcc
case (ASM code breaks with the optimizations icc does)
-> no bad checksums with an icc compiled kernel
Help from: andre, grehan, das
Stolen from: alpha version via ppc version
The entire checksum code should IMHO be replaced with the DragonFly
version (because it isn't guaranteed future revisions of gcc will
include similar optimizations) as in:
---snip---
Revision Changes Path
1.12 +1 -0 src/sys/conf/files.i386
1.4 +142 -558 src/sys/i386/i386/in_cksum.c
1.5 +33 -69 src/sys/i386/include/in_cksum.h
1.5 +2 -0 src/sys/netinet/igmp.c
1.6 +0 -1 src/sys/netinet/in.h
1.6 +2 -0 src/sys/netinet/ip_icmp.c

1.4 +3 -4 src/contrib/ipfilter/ip_compat.h
1.3 +1 -2 src/sbin/natd/icmp.c
1.4 +0 -1 src/sbin/natd/natd.c
1.48 +1 -0 src/sys/conf/files
1.2 +0 -1 src/sys/conf/files.amd64
1.13 +0 -1 src/sys/conf/files.i386
1.5 +0 -1 src/sys/conf/files.pc98
1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c
1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h
1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c
1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c
1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c
1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c
1.6 +1 -2 src/sys/netinet/igmp.c
1.4 +158 -116 src/sys/netinet/in_cksum.c
1.6 +1 -1 src/sys/netinet/ip_gre.c
1.7 +1 -2 src/sys/netinet/ip_icmp.c
1.10 +1 -1 src/sys/netinet/ip_input.c
1.10 +1 -2 src/sys/netinet/ip_output.c
1.13 +1 -2 src/sys/netinet/tcp_input.c
1.9 +1 -2 src/sys/netinet/tcp_output.c
1.10 +1 -1 src/sys/netinet/tcp_subr.c
1.10 +1 -1 src/sys/netinet/tcp_syncache.c
1.9 +1 -2 src/sys/netinet/udp_usrreq.c

1.5 +1 -2 src/sys/netinet6/ipsec.c
1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c
1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c
1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c

and finally remove
sys/i386/i386 in_cksum.c
sys/i386/include in_cksum.h
---snip---
- endian.h:
* DTRT in C++ mode
- quad.h:
* we don't use gcc v1 anymore, remove support for it
Suggested by: bde (long ago)
- assym.h:
* avoid zero-length arrays (remove dependency on a gcc specific
feature)
This change changes the contents of the object file, but as it's
only used to generate some values for a header, and the generator
knows how to handle this, there's no impact in the gcc case.
Explained by: bde
Submitted by: Marius Strobl <marius@alchemy.franken.de>
- aicasm.c:
* minor change to teach it about the way icc spells "-nostdinc"
Not approved by: gibbs (no reply to my mail)
- bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by: -arch
Submitted by: netchild


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


121212 18-Oct-2003 phk

Discontinue bio_blkno, use bio_offset instead.


119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


115477 31-May-2003 phk

Fix \ alignment in macro.
Remove breaks after return.
Remove unused variable.

Found by: FlexeLint


113581 16-Apr-2003 phk

Don't include <sys/disklabel.h>


112946 01-Apr-2003 phk

Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.


111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


111731 02-Mar-2003 phk

NO_GEOM cleanup:

mcdsize() is not a cdevsw->d_psize function (any more ?) so rename it,
give it a better prototype to avoid misusing d_psize_t.


106719 10-Nov-2002 mdodd

Replace {disable,enable}_intr() with critical_{enter,exit}().


106490 06-Nov-2002 mdodd

Whitespace, style fixes.


105215 16-Oct-2002 phk

Be consistent about functions being static.

Spotted by: FlexeLint.


104547 06-Oct-2002 bde

INclude <sys/mutex.h>'s prerequisite <sys/lock.h> instead of depending on
namespace pollution 2 layers deep in <sys/eventhandler.h>.


104545 06-Oct-2002 mdodd

Make this work under GEOM.


104519 05-Oct-2002 phk

NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
Tries to update the MBR while it is being used to control
slices. GEOM does not allow this as a direct operation.

SCSI floppy drives:
Appearantly the scsi-da driver return "EBUSY" if no media
is inserted. This is wrong, it should return ENXIO.

PC98:
It is unclear if GEOM correctly recognizes all variants of
PC98 disklabels. (Help Wanted! I have neither docs nor HW)

These issues are all being worked.

Sponsored by: DARPA & NAI Labs.


104445 04-Oct-2002 mdodd

newbus & bus_space the mcd(4) driver.


104441 04-Oct-2002 mdodd

Minor style(9) changes.


104440 04-Oct-2002 mdodd

Remove duplicate calls to make_dev().


104210 30-Sep-2002 phk

If GEOM is in the kernel, take these three out. I have no way of
testing any modifications to them, they shouldn't even bother with
disklabels in the first place and they are just plain obsolete old
hardware which should be axed entirely before 5.0-R IMO.

Sponsored by: DARPA & NAI Labs.


93657 02-Apr-2002 phk

Retire the bogus ioctl DIOCGPART in toto.

Once again we can notice that badly thought out hacks ferment and infect
far more code than initially expected.

Sponsored by: DARPA and NAI Labs.


86011 04-Nov-2001 phk

Don't call cdevsw_add().


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


61011 28-May-2000 peter

Mass update of isa drivers using compatability shims to use
COMPAT_ISA_DRIVER() so that we can get rid of the evil isa_compat.h table.


60041 05-May-2000 phk

Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by: peter


59249 15-Apr-2000 phk

Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.

CCD not converted yet, casts to struct buf (still safe)

atapi-cd casts to struct buf to examine B_PHYS


58934 02-Apr-2000 phk

Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.


58345 20-Mar-2000 phk

Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd. The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue. It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users: Greg has not had time to test this yet, be careful.


56845 29-Jan-2000 peter

Remove a bunch of unused (NO-OP) #if NFOO > 0 type includes and some
#include "foo.h" headers.


51658 25-Sep-1999 phk

Remove five now unused fields from struct cdevsw. They should never
have been there in the first place. A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags


51468 20-Sep-1999 phk

Trying to set BAD144 handling on a CD is sufficiently "Dont Do That
then" that we don't need to give the ioctl special treatment.


51111 09-Sep-1999 julian

Changes to centralise the default blocksize behaviour.
More likely to follow.

Submitted by: phk@freebsd.org


50748 01-Sep-1999 phk

Set si_bsize_phys and si_bsize_max in all legacy CD drivers.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50254 23-Aug-1999 phk

Convert DEVFS hooks in (most) drivers to make_dev().

Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().


47640 31-May-1999 phk

Simplify cdevsw registration.

The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it. cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables. Most places they were used
bogusly. Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
72 bogus makedev() calls
26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed. Patches emailed to authors. LINT
probably broken until they catch up.


47625 30-May-1999 phk

This commit should be a extensive NO-OP:

Reformat and initialize correctly all "struct cdevsw".

Initialize the d_maj and d_bmaj fields.

The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format. Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.


46679 08-May-1999 phk

Fix some of the places where too much inside knowledge about major/minor
layout and dev_t structure is being (ab)used.


46625 07-May-1999 phk

Introduce two functions: physread() and physwrite() and use these directly
in *devsw[] rather than the 46 local copies of the same functions.

(grog will do the same for vinum when he has time)


46573 06-May-1999 peter

Missing 'int' in declaration of variables.


46571 06-May-1999 peter

Fix up a few easy 'assignment used as truth value' and 'suggest parens
around && within ||' type warnings. I'm pretty sure I have not masked
any problems here, I've committed real problem fixes seperately.


46153 28-Apr-1999 dt

s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.
(Edited automatically)


40565 22-Oct-1998 bde

Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c. Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato


37618 13-Jul-1998 bde

Fixed printf format errors (only 1 left in GENERIC now).


37389 04-Jul-1998 julian

There is no such thing any more as "struct bdevsw".

There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries. The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).

rawread()/rawwrite() went away as part of this though it's not strictly
the same patch, just that it involves all the same lines in the drivers.

cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.

Reviewed by: Eivind Eklund and Mike Smith
Changes suggested by eivind.


36735 07-Jun-1998 dfr

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.


32726 24-Jan-1998 eivind

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.


31493 02-Dec-1997 phk

In all such uses of struct buf: 's/b_un.b_addr/b_data/g'


31016 07-Nov-1997 phk

Remove a bunch of variables which were unused both in GENERIC and LINT.

Found by: -Wunused


29677 21-Sep-1997 gibbs

aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:

Update for changes in the callout interface.

apic_vector.s icu_vector.s ipl.s ipl_funcs.c:

Add CAM software/hardware interrupt support.


27555 20-Jul-1997 bde

Removed unused #includes.


26348 01-Jun-1997 peter

on second thoughts, it doesn't even need <machine/ipl.h> either.


26346 01-Jun-1997 peter

<machine/spl.h> -> <machine/ipl.h>


25657 10-May-1997 joerg

Add the D_DISK flag to the cdevsw structs of various CD-ROM drivers.


25460 04-May-1997 joerg

This mega-commit brings the following:

. It makes cd9660 root f/s working again.
. It makes CD9660 a new-style option.
. It adds support to mount an ISO9660 multi-session CD-ROM as the root
filesystem (the last session actually, but that's what is expected
behaviour).

Sigh. The CDIOREADTOCENTRYS did a copyout() of its own, and thus has
been unusable for me for this work. Too bad it didn't simply stuff
the max 100 entries into the struct ioc_read_toc_entry, but relied on
a user supplied data buffer instead. :-( I now had to reinvent the
wheel, and created a CDIOREADTOCENTRY ioctl command that can be used
in a kernel context.

While doing this, i noticed the following bogosities in existing CD-ROM
drivers:

wcd: This driver is likely to be totally bogus when someone tries
two succeeding CDIOREADTOCENTRYS (or now CDIOREADTOCENTRY)
commands with requesting MSF format, since it apparently
operates on an internal table.

scd: This driver apparently returns just a single TOC entry only for
the CDIOREADTOCENTRYS command.

I have only been able to test the CDIOREADTOCENTRY command with the
cd(4) driver. I hereby request the respective maintainers of the
other CD-ROM drivers to verify my code for their driver. When it
comes to merging this CD-ROM multisession stuff into RELENG_2_2 i will
only consider drivers where i've got a confirmation that it actually
works.


25056 20-Apr-1997 bde

Fixed the type of timeout functions and removed casts that hid the
type mismatches. mcd and scd were/are particularly bogus. They
used a general purpose function taking 2 args for the timeout
function and fudged varargs stuff to supply the second arg for the
timeout case. This broke `cc -mrtd'. Bounce through a timeout
function instead. The timeout arg still gets bogusly cast from
int to `void *' and back.


24203 24-Mar-1997 bde

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.


24131 23-Mar-1997 bde

Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.
Fixed everything that depended on getting fcntl.h stuff from the wrong
place. Most things don't depend on file.h stuff at all.


22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


21673 14-Jan-1997 jkh

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.


18084 06-Sep-1996 phk

Remove devconf, it never grew up to be of any use.


17264 23-Jul-1996 phk

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 :-)


16471 18-Jun-1996 bde

Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn'). isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).


16322 12-Jun-1996 gpalmer

Clean up -Wunused warnings.

Reviewed by: bde


16210 08-Jun-1996 bde

Fixed group and permissions for devfs devices (group operator was games;
permissions 0640 was 0600).


15577 03-May-1996 phk

Forget that TAILQ's must be init'ed.


15574 03-May-1996 phk

Move from the old buf.b_actf to the new TAILQ(buf.b_act).


15116 07-Apr-1996 bde

Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.


14873 28-Mar-1996 scrappy

Switched from using devfs_add_sw() to using devfs_add_swf()

Reviewed by: julian@freebsd.org


14654 17-Mar-1996 ache

Fix/cleanup raw partition open/close code


14286 27-Feb-1996 ache

Fix re-sense code
Remove unused part of close code


14285 27-Feb-1996 ache

rmcd0c: now several ioctls (eject/close/debug/reset/etc.) works
even not CD sensed. Open of this device without CD sensed allowed too.
Other ioctls re-sense CD for this device.


14074 13-Feb-1996 ache

Implement CDIOCSTART


13886 03-Feb-1996 ache

Implement CD_MEDIA_CATALOG request for read_subchannel
Obtained from: NetBSD


13874 03-Feb-1996 ache

Detect yet one kind of device (taken from NetBSD)
Use more accurate TOC size calculation


13866 02-Feb-1996 ache

Implement PREVENT & CLOSE ioctls


13864 02-Feb-1996 ache

Remove close tray on open - works very bad with xcdplayer


13862 02-Feb-1996 ache

Calculate TOC size to match what scsi cd says.
Exchange control<->addr_type fields


13833 01-Feb-1996 ache

Implement PLAYBLOCKS ioctl, add argument checking to other PLAY* ioctls
Obtained from: NetBSD (partially)


13824 01-Feb-1996 ache

Return to #pragma pack(4) after header is done
Obtained from: NetBSD


13822 01-Feb-1996 ache

Fix TOC size calculation: old code assing volume size here


13770 30-Jan-1996 ache

Audio part: various improvements from NetBSD driver
Convert LBA to network order now


13743 30-Jan-1996 ache

READTOCENTRYS: protect against stack overflow when incorrect data
stored in CD's TOC


13738 30-Jan-1996 ache

Don't generate EINVAL for data_len too big in READTOCENTRYS, it
reduces automatically to reasonable value in the code below


13732 30-Jan-1996 ache

Fix audio part, especially READTOCENTRYS inspired by NetBSD driver
and my own ideas


13598 23-Jan-1996 joerg

Hide the probe warnings behind `bootverbose'.


13438 15-Jan-1996 phk

Make bin2bcd and bcd2bin global macroes instead of having local
implementations all over the place.


12966 22-Dec-1995 phk

Typo in my last commit.


12960 22-Dec-1995 phk

Remove crufty "pg" function.


12736 10-Dec-1995 bde

Replaced nxdump by nodump (if the dump function gets called, then the
device must be configured, so ENXIO is a bogus errno).

Replaced zerosize by nopsize. zerosize was a temporary alias.


12724 10-Dec-1995 phk

Staticize and cleanup.


12678 08-Dec-1995 phk

Julian forgot to make the *devsw structures static.


12675 08-Dec-1995 julian

Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)


12521 29-Nov-1995 julian

If you're going to mechanically replicate something in 50 files
it's best to not have a (compiles cleanly) typo in it! (sigh)


12517 29-Nov-1995 julian

OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c..
my next trick will be to define cdevsw[] and bdevsw[]
as empty arrays and remove all those DAMNED defines as well..

Each of these drivers has a SYSINIT linker set entry
that comes in very early.. and asks teh driver to add it's own
entry to the two devsw[] tables.

some slight reworking of the commits from yesterday (added the SYSINIT
stuff and some usually wrong but token DEVFS entries to all these
devices.

BTW does anyone know where the 'ata' entries in conf.c actually reside?
seems we don't actually have a 'ataopen() etc...

If you want to add a new device in conf.c
please make sure I know
so I can keep it up to date too..

as before, this is all dependent on #if defined(JREMOD)
(and #ifdef DEVFS in parts)


12502 28-Nov-1995 julian

the second set of changes in a move towards getting devices to be
totally dynamic.

this is only the devices in i386/isa
I'll do more tomorrow.
they're completely masked by #ifdef JREMOD at this stage...
the eventual aim is that every driver will do a SYSINIT
at startup BEFORE the probes, which will effectively
link it into the devsw tables etc.

If I'd thought about it more I'd have put that in in this set (damn)
The ioconf lines generated by config will also end up in the
device's own scope as well, so ioconf.c will eventually be gutted
the SYSINIT call to the driver will include a phase where the
driver links it's ioconf line into a chain of such. when this phase is done
then the user can modify them with the boot: -c
config menu if he wants, just like now..
config will put the config lines out in the .h file
(e.g. in aha.h will be the addresses for the aha driver to look.)
as I said this is a very small first step..
the aim of THIS set of edits is to not have to edit conf.c at all when
adding a new device.. the tabe will be a simple skeleton..

when this is done, it will allow other changes to be made,
all teh time still having a fully working kernel tree,
but the logical outcome is the complete REMOVAL of the devsw tables.

By the end of this, linked in drivers will be exactly the same as
run-time loaded drivers, except they JUST HAPPEN to already be linked
and present at startup..
the SYSINIT calls will be the equivalent of the "init" call
made to a newly loaded driver in every respect.

For this edit,
each of the files has the following code inserted into it:

obviously, tailored to suit..
----------------------somewhere at the top:
#ifdef JREMOD
#include <sys/conf.h>
#define CDEV_MAJOR 13
#define BDEV_MAJOR 4
static void sd_devsw_install();
#endif /*JREMOD */
---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT
#ifdef JREMOD
sd_devsw_install();
#endif /*JREMOD*/
-----------------------at the bottom:
#ifdef JREMOD
struct bdevsw sd_bdevsw =
{ sdopen, sdclose, sdstrategy, sdioctl, /*4*/
sddump, sdsize, 0 };

struct cdevsw sd_cdevsw =
{ sdopen, sdclose, rawread, rawwrite, /*13*/
sdioctl, nostop, nullreset, nodevtotty,/* sd */
seltrue, nommap, sdstrategy };

static sd_devsw_installed = 0;

static void sd_devsw_install()
{
dev_t descript;
if( ! sd_devsw_installed ) {
descript = makedev(CDEV_MAJOR,0);
cdevsw_add(&descript,&sd_cdevsw,NULL);
#if defined(BDEV_MAJOR)
descript = makedev(BDEV_MAJOR,0);
bdevsw_add(&descript,&sd_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
sd_devsw_installed = 1;
}
}
#endif /* JREMOD */


12071 04-Nov-1995 bde

Moved prototypes for devswitch functions from conf.c and driver sources
to <machine/conf.h>. conf.h was mechanically generated by
`grep ^d_ conf.c >conf.h'. This accounts for part of its ugliness. The
prototypes should be moved back to the driver sources when the functions
are staticalized.


11872 28-Oct-1995 phk

Remove unused functions and variables, make things static, and other cleanups.


10624 08-Sep-1995 bde

Fix benign type mismatches in devsw functions. 82 out of 299 devsw
functions were wrong.


10069 15-Aug-1995 joerg

Increase the DELAY_GETREPLY to 5000000. Not dangerous, this is
actually a timeout only. The existing behaviour caused a

mcd0: timeout getreply

at halt/reboot time.

Submitted by: graichen@sirius.physik.fu-berlin.de (Thomas Graichen)


8876 30-May-1995 rgrimes

Remove trailing whitespace.


8456 11-May-1995 rgrimes

Fix -Wformat warnings from LINT kernel.


8375 09-May-1995 rgrimes

Rewrite the MCD_TRACE macro to be a varargs macro so that the extraneous
arguments to printf could be fixed.

Correct all but 1 -Wformat warning. Some would have caused garbage to
be printed due to missing args!


7780 12-Apr-1995 wollman

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.


7430 28-Mar-1995 bde

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.


6665 23-Feb-1995 ache

READSUBCHANNEL:
complete implementation of CD_MSF_FORMAT
implement CD_LBA_FORMAT
Issue STOP before reading toc entries


6612 22-Feb-1995 ache

Increase retry count while reading toc, old one
isn't enough for spin up


6604 22-Feb-1995 ache

Implement tray closing and tray locking
Fix first open fails bug


6028 30-Jan-1995 ache

Use double speed read for FX001D, now this drive
becomes two times faster than in old variant.
Get rid of false "media changed" errors during large disk transfers


5226 24-Dec-1994 ache

Merge several probe diagnostics into one.
Adjust for newer model for all non-LUxxx too.
FLAGS status register names cleanup


5178 21-Dec-1994 ache

Remove get status from probe, confuse LU002
Add check stbytes[1] != stbytes[2] for presence real Mitsumi
controller


5177 21-Dec-1994 ache

stbytes miss by one for new model


4481 14-Nov-1994 ache

Remove unused variable from previous commit


4480 14-Nov-1994 ache

Add model autodetection code, idea from burgess@s069.infonet.net
This change affects probe printout, disklabel, devconf stuff


4398 12-Nov-1994 ache

Implement CDIOCALLOW as dummy function (for xcdplayer)


4390 12-Nov-1994 ache

Changes from bugress@s069.infonet.net NOT installed (expect one
cosmetique) because we already have right things there or his changes
are incorrect.
Fix mcd_subchan to return position, inspired by idea from
bugress@s069.infonet.net, but different implementation.


4389 12-Nov-1994 ache

Add and reorganize new MCD commands from bugress@s069.infonet.net
No functionality changes yet, will be next step


3940 27-Oct-1994 jkh

Julian Elischer's disklabel fixes.


3816 23-Oct-1994 wollman

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).


2762 14-Sep-1994 ache

Increase transfer speed by waiting much less than 10ms after request
Submitted by: stark@sbstark.cs.sunysb.edu & slightly modifyed by me


2526 06-Sep-1994 se

Reviewed by: Stefan Esser <se>
Submitted by:
Changed "bp->av_forw" into "bp->b_actf" to make it compile ...


2477 03-Sep-1994 ache

Newly implemented ioctls list:
DIOCGDINFO, DIOCGPART, DIOCWDINFO, DIOCSDINFO, CDIOCPLAYMSF, CDIOCRESET,
CDIOCEJECT.

CDIOCPLAYBLOCKS removed (old implementation completely wrong and I don't
know how to implement it correctly).

All routines now detects media change correctly.

DELAY_GETREPLAY increased for long time access from first track
to last.

mcd_waitrdy() now use MIN_DELAY=15 as minimal delay which independs
of machine speed.

mcd_doread() now uses real status (old code uses obsoleted soft copy of it).

clear XBSY on error in mcd_doread()

mcd_statrt(): add missing splx(s), cause dead hang with unmatched slpbio()

optimize mcd_doread(), don't set CD mode each time, keep soft copy of mode.

call getdisklabel() _after_ mcdsize() for proper sizes

mcdopen(): old code forget to set MCDREADRAW in flags when open RAW
partition, doread check it for setting RAW CD mode.

Do nothing on stray interrupt (which sometimes occurse, because driver
read data block too slow, DOS driver use 'insb' here). Old stray code
cause timeouts.

Read toc entries code rewritten to return many requested entries
(as supposed) instead of one entry with incorrect structure.

CMDREAD2 requests covered with disable_intr()/enable_intr()
(from DOS driver)

Read junk code added after read block code in doread (from DOS driver)

mcd_read_toc() code fixed to read all needed entries, old code cause
some audio tracks is not played.

mcd_playtracks() code fixed to proper check valid track range.

New binary read modes implemented (from DOS driver).


2395 29-Aug-1994 ache

Raw partition is 2 now


2377 28-Aug-1994 ache

Bruce was right, stupid device returns non-busy state too early,
add only one DELAY(10) after inb(non_busy) now


2314 27-Aug-1994 ache

Continue previous fix:
Add MIN_DELAY definition instead of hard-coded 10


2310 27-Aug-1994 ache

1) Raw partition number was incorrectly 0, changed to 3
2) DELAY(1) does nothing, it affects audio playing f.e:
driver can't play second half of disk, changed to DELAY(10)
3) Debugging messages #ifdef DEBUGed


2056 13-Aug-1994 wollman

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


1549 25-May-1994 rgrimes

The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman


1437 30-Apr-1994 gclarkii

Change old alias b_cylin to b_resid


1379 20-Apr-1994 dg

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.


1294 21-Mar-1994 ats

Changed the raw partition number from 3 to 0. This change lets us use
/dev/mcd0a instead of /dev/mcd0d. This is more conforming to the /dev/cd0a
for the SCSI cdrom drives. It breaks the convention d the whole drive.
But the question is, do we really need partitions on cdrom drives ?


1241 06-Mar-1994 jkh

Used definable status codes (some may be sharable, esp the door open codes, but
it still looks a little suspicious that so many of the status codes are missing
so I'm not going to adopt all of the existing ones yet. Try to be more
descriptive in the use of hex constants.


1239 05-Mar-1994 ats

Added more status bytes for the mitsumi drive. This is only an ugly
hack in the moment for testing purposes and to get the drive going
again.
0x20 means empty drive.
0x30 means closed drive with CDROM inserted.
0x80 means drive pulled out, but door closed.
0xa0 means drive pulled out and door open.
Luckily none of these values are the same as that reported for Ethernet
cards ( 0 for WD8003E, 0x40 for WD8013EPC, 0x60 for NE2000).
The bad part is, the probe code gets the WD8003E so hosed, that it is
no longer usable after it. No problem with the WD8013EPC.


1237 05-Mar-1994 jkh

This should stop the false probes in their slimey little tracks.


1197 22-Feb-1994 rgrimes

This is Jordans probe code fixes. Tested on LU002, FX001D. Then I went
in and cleaned the spaces vs tabs up, and made the code a little closer
to KNF.


1120 07-Feb-1994 dg

Fixed bug in probe that was causing it to always probe true.


1097 06-Feb-1994 rgrimes

Update for new format of cd_toc_entry that was changed in sys/cdio.h.


1000 22-Jan-1994 ats

Added the correct typecast's to the untimeout calls. Added a missing
return statement in the probe. This should have fixed all compiler warnings.


982 18-Jan-1994 nate

Reduced the delay amounts per patch submitted by gclarkii@netport.neosoft.com


978 16-Jan-1994 jkh

From Gary Clark II:

1. Fixed probe to work with FX mitsumi's.

2. Added some defines in prep for adding interupts and dma


879 19-Dec-1993 wollman

Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.


798 25-Nov-1993 wollman

Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.


619 16-Oct-1993 rgrimes

Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup. Added $Id$ to files that did not have any version info, etc


578 12-Oct-1993 rgrimes

Mitsumi cd rom driver from Holger Viet as fixed up by Gary Clark II.

Still a little rought, but it seems to be working.