Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 1997 20:20:14 +0200
From:      j@uriah.heep.sax.de (J Wunsch)
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Cc:        un_x@anchorage.net (Steve Howe)
Subject:   Re: direct access
Message-ID:  <19970623202014.WQ44135@uriah.heep.sax.de>
In-Reply-To: <199706231157.VAA18802@genesis.atrad.adelaide.edu.au>; from Michael Smith on Jun 23, 1997 21:27:39 %2B0930
References:  <Pine.BSF.3.95q.970623002024.21409A-100000@aak.anchorage.net> <199706231157.VAA18802@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
As Michael Smith wrote:

> Joerg talked about the "ISA hole"; let's clarify a little.
...
> One of these mappings arranges pages so that kernel virtual addresses
> in the range 0xa0000-0xfffff refer to physical addresses
> 0xa0000-0xfffff, in order to make life slightly easier for ISA
> drivers.  It doesn't apply to user processes, which have their own
> mappings.

I think it's mapped to the kernel virtual addresses (KVA) 0xf00a0000
and above, not to the low addresses.  That is, right below the kernel
text (0xf0100000).

But again, this knowledge is useful inside device drivers, not user
programs.

> An LKM is just a slab of code that gets loaded into the kernel.  You
> can write device drivers; they're not rocket science.

I also always felt that it was easier to write a device driver, than a
devicer driver LKM. :)

After all, Steve, a Unix device driver is just a piece of C code,
nothing else.  It's only that it is linked into another executable,
the kernel, and normally uses a standardized set of functions to talk
to the environment.

Layering the implementation is one of the wonderful things in Unix
(and not only there).  You can usually divide your task into three
layers: the device driver, abstracting the hardware for you into
read/write/ioctl system calls.  Then comes backend layers, userland
programs to manipulate device drivers.  To pick an example device
driver i'm confident with, the CD-R driver, this is things like the
`wormcontrol' utility that allows you to manipulate some driver stuff,
and/or simple things like a `dd' command doing the basic IO.  On top
of all this, there's the user interface, something that makes every-
thing usable at all.  It can be a simple shell script glueing all the
pieces together, which gives you a quick start.  Or it could be a
fancy graphical user interface with one of the graphical toolkits.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970623202014.WQ44135>