DDE

DDE is a universal interface for drivers that makes it easy for systems without many native drivers (such as the hurd) to use drivers from systems with many native drivers (like Linux 2.6). These drivers can run in userspace, which has some interesting implications.

Contents

Overview

Porting DDE to the Hurd was originally the work of Zheng Da. His work is currently in the incubator git repository of the hurd. See GNU's DDE page for a more in-depth dicussion.

From a User Perspective

For the user, this means that, once we have completed the implementation of DDE, Hurd will support a wider variety of hardware, using Linux 2.6's drivers. You need to do only three things to get DDE running:

  • Download a modified Gnumach
  • Download the DDE drivers
  • Start the translators!

Gnumach

The normal gnumach that is distributed with Arch Hurd cannot use DDE's user level drivers. A build of gnumach from the master-userleveldrivers git branch is in [extra], however, so run
pacman -S gnumach-userleveldrivers
!Warning! This kernel overwrites the normal gnumach, and has forfeited some kernel-side drivers for DDE ones, such as the pcnet32 driver required to access the internet from Qemu. Thus, either back up your gnumach package (see /var/cache/pacman/pkg/) or make sure you install your ethernet drivers at the same time, otherwise, if something goes very wrong, your system may not be able to connect to the internet.

Drivers

Drivers that use DDE are available in [extra]. To get them, run
pacman -S dde
. The e1000, ne2k and pcnet32 drivers have been tested to have internet connection within qemu!

Using

These commands have been tested to use the driver dde_pcnet32, dde_e1000, and dde_ne2k with gnumach-userleveldrivers under QEMU

Gnumach

While you are still using gnumach from [core], install the packages you will need

pacman -S gnumach-userleveldrivers dde
QEMU

Out of the box, QEMU uses an emulated pcnet32 driver. The dde_pcnet32 driver has been tested to work as of Nov. 6, 2011, so no modification to your qemu launch parameters is necessary. If you would like to use the NE2K driver instead, add this to the end of your QEMU launch command (and remove other -net commands)

 -net nic,vlan=1,model=ne2k_pci -net user,vlan=1

IIf you would like to use the E1000 driver, use

 -net nic,vlan=1,model=e1000 -net user,vlan=1
Arch Hurd

Boot your qemu image, then login as root. It is necessary to run as root, even though these drivers run in user space. The following script is useful:

#!/bin/bash                                                                   
# net-setup

settrans -fg /servers/socket/2
settrans -fg /dev/eth0

nic=pcnet32

case $1 in
  e1000|e)
    nic=e1000
    ;;
  ne2k|ne2k_pci|n)
    nic=ne2k_pci
    ;;
  pcnet32|p)
    nic=pcnet32
    ;;
esac

br=$(mktemp /tmp/dde-driver-${nic}-XXXXX)
echo "Intermittant translator at '${br}'"

settrans -cfgap ${br} /hurd/dde/dde_${nic}
settrans -cfgap /dev/eth0 /hurd/dde/devnode eth0 -M ${br}
settrans -cfgap /servers/socket/2 /hurd/dde/pfinet \
  -i /dev/eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
Store somewhere in your PATH as, for example, net-setup, then run with
net-setup [e1000|pcnet32|ne2k]

As you run these commands, you should see status messages informing you that a device is being detected. If all goes well, you should be able to run 'ifconfig' and be informed that eth0 is UP BROADCAST RUNNING MULTICAST

Congratulations! You are now running a network driver compiled from linux source in your Hurd's userspace!