1 Introduction
When I first started to learn about Linux device drivers
in 1999, I went to the Internet and tried to find information
about Linux device drivers. I found that these resources were fairly
useful, but inadequate for my needs. I also bought the "Linux
Device Drivers" book by Alessandro Rubini. I found the book to be quite
useful and detailed in content. However, all examples in the book are hardware
independent, meaning that you went through the book without ever
writing a hardware specific driver. As a device driver programmer,
you need to physically observe how the software controls your
hardware. So I decided to buy my own hardware and write a little network
driver. In this tutorial, I will show you how to write
a network driver that allows IP packets to travel over a serial
line; you will be able to use TCP/IP applications such as ftp,
telnet over serial line between two PCs with this driver.
You can download
the source code from the link at the end of this document.
I have tested the driver with Linux kernel 2.4. I assume that you are
familiar with the C-programming language using Linux and Windows platforms,
and that it is now your intention to write a Linux device driver.
We are going to write a simple network driver for the
Sealevel
serial card based on the
Zilog
SCC/ESCC chipset.
Here is what you will need for this project.
- Two PCs with ISA slots
- A null modem cable.
- 2 Sealevel ISA Serial cards. You can call Sealevel and ask
for part #: 4061 which is about $169 US.
You will also need the following documents:
- Zilog SCC/ESCC User Manual, Code: UM0109010601.
This document can be downloaded from Zilog website.
- Sealevel User Manual Part #: 4061.
I have organized the tutorial as follows: In section
2
, I will give an introduction to the Linux driver model.
In section 3
, an introduction to the loadable module is given. An introduction
to polling and interrupts are given in section
4
. In section 5
, we will go over the design of the driver. In section
6
, I will show you how to read the specification of
the Zilog SCC/ESCC from the User Manual, which is used in the
Sealevel card. In section 7
, I will provide a detailed description of the network driver. It
is recommended that you read this tutorial in conjunction with "
Linux device drivers" by Alessandro Rubini.
Previous
Index
Next