[rescue] DEC keyboards

Jochen Kunz jkunz at unixag-kl.fh-kl.de
Wed Nov 15 16:45:04 CST 2006


On Wed, 15 Nov 2006 13:58:46 -0600 (CST)
"Jonathan C. Patschke" <jp at celestrion.net> wrote:

> Most everything else: the program loader, the memory manager, bus
> management/enumeration bits, and task-switcher are all
> hardware-dependent.
NetBSD has split most of this in MI (machine independent) and MD
(machine dependent) parts. E.g. uvm(9) (memory manager) has a MI core
that interfaces to a (comparatively small) MD backend, caled pmap(9).
So most of the memory management is MI.

> Many device drivers are portable in theory (provided that you have the
> proper bus abstractions to deal with bus endianness and word-size
> differences), but there are plenty of devices that you just don't find
> on more than one platform, and, in the case that you do, they're on
> wildly different buses.  Consider the AMD "Lance" family of Ethernet
> controllers.  Variants within that family can be mated against ISA,
> PCI, sbus, TURBOchannel, VME, Zorro, and probably NuBus and MCA, too.
>
> Each one of those buses has a different way of asserting control of
> the bus, a different way of moving data on the bus, a different method
> of resource arbitration, etc.  Nevermind that if you're getting into
> DMA on those various platforms, you're not just dealing with
> bus-specific behavior, but system-specific behavior.  In this sense,
> portability grows out the barrel of an #ifdef.
NetBSD can deal with all of those differences without #ifdefs. Bus
access is abstracted through bus_space(9) and bus_dma(9). So, to take
your example of le(4), there is a MI core driver src/sys/dev/ic/lance.c
that is interfaced to different busses with a small bus speciffic
attachment. This attachment isn't MD either, it depends only on the bus.
The same PCI attachment src/sys/dev/pci/if_le_pci.c works on all
architectures that support PCI. The actual PCI backend is MD, but le(4)
doesn't notice it because all the MD bits are hiden by bus_space(9),
bus_dma(9) and pci(9). Similar for ISA src/sys/dev/isa/if_le_isa.c, MCA
src/sys/dev/mca/if_le_mca.c, ...

NetBSD does a real good job at this. Well, it has to. It suppots 54
different machine architectures and 17 different CPUs. Anything else
would be unmaintainable.
--


tsch|_,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/



More information about the rescue mailing list