*BSD News Article 33929


Return to BSD News archive

Xref: sserve comp.os.386bsd.misc:3065 comp.os.linux.misc:21230
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!newsfeed.ksu.ksu.edu!moe.ksu.ksu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!gatech!udel!news.sprintlink.net!agphx.agcs.com!not-for-mail
From: robertsw@agcs.com (Wallace Roberts)
Newsgroups: comp.os.386bsd.misc,comp.os.linux.misc
Subject: Re: source of TCP/IP (was I hope this wont ignite a major flame ...)
Date: 3 Aug 1994 17:21:09 -0700
Organization: agcs
Lines: 36
Message-ID: <31pc9l$ctp@oscar.agcs.com>
References: <31od8d$15l@fw.novatel.ca>
NNTP-Posting-Host: oscar.agcs.com

hpeyerl@sidney.novatel.ca (Herb Peyerl) writes:

	[ ...snip happens... ]

>I've tried reading Linux networking code. At least some of the device 
>drivers and each of the ones I looked at gave me a brain hemorrage...
>
>This is an example of some of the Linux device-drivers I've seen:
>
>        short error = rx_status & 0x3C00;
>        outw(inw(ioaddr + 0x0A) | 0x00C0, ioaddr + 0x0A);
>
>As far as I can tell; Linux Ethernet device-drivers were written in
>Write-Only-C.  There are no comments in the surrounding code that in any
>way indicates exactly what "0x3c00", "0x0a", "0x00c0" actually mean. To
>people without docs (usually these are the people who are trying to fix
>the code) the above is completely meaningless.

if you're writing (or fixing) a device driver, you are expected to have
the h/w manuals handy.  comments are unnecessary if you have the device
manual & understand the h/w.  this is the expected level of competence
for a programmer writing or fixing a device driver.

"if you can't run with the big dogs, stay on the porch..."

>Thank you; I'll stick to working on code that I can actually read.

you're welcome.  now run along and play...

gears,
ye wilde ryder
--
robertsw@agcs.com | 86 cr250 "dirt devil"    83 v65 magna "animal"
"E Pluribus Unix" | 79 it250 "mr. reliable"  84 650 nighthawk ">> for sale <<"
"Criminals (especially tyrants) prefer unarmed victims."
"Ignorance can be cured; stupidity, on the other hand, is hereditary."