Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

learning unix programming by studying unix source code ?

1 view
Skip to first unread message

Ognen Duzlevski

unread,
Mar 1, 1998, 3:00:00 AM3/1/98
to

Hi,
would it be a good way to learn unix programming to the bottom if
one would work thru source codes of some of the freely available
unixes (like linux for example) ? This assumes one knows assembler
and C.

Thanx,
OggieD.
=========================================================================
Ognen Duzlevski e-mail: ogd...@mail.usask.ca
Cmpt.Sci major - 1st year
University of Saskatchewan
Saskatoon, Canada
========================================================================

Prince of Darkness

unread,
Mar 1, 1998, 3:00:00 AM3/1/98
to

On 1 Mar 1998 06:19:03 GMT, ogd...@alf.usask.ca (Ognen Duzlevski)
wrote:

>would it be a good way to learn unix programming to the bottom if
>one would work thru source codes of some of the freely available
>unixes (like linux for example) ? This assumes one knows assembler
>and C.

------- I am sure that there are differing opinions on this, but my
view is that this is not a good idea. If you want to learn coding,
you don't look at the most convoluted, optimized and sick code
out there, written and patched up by a dozen people who never saw
each other. In kernel code (linux is a good example, as is most
gnu stuff), you will see lines that just don't make sense, and you
may even feel they are not needed, but in some module, 10 calls
later, what those lines do will affect how this module behaves, or
even if it works. This is now way to learn anything. you'll just
get frustrated.

Try looking up some simple programs if you're just beginning. But if
you want to know unix really well, then by all means check out the
kernel.

--
Mariusz Zydyk http://www.ucalgary.ca/~mszydyk/
Prince of Darkness p...@null.net
How do you make holy water? Boil the hell out of it.

Mouse Bousfield

unread,
Mar 1, 1998, 3:00:00 AM3/1/98
to

On 1 Mar 1998, Ognen Duzlevski wrote:

> Hi,


> would it be a good way to learn unix programming to the bottom if
> one would work thru source codes of some of the freely available
> unixes (like linux for example) ? This assumes one knows assembler
> and C.

Depends on what stage of learning you are currently in: if you aren't
thoroghly familiar with concepts like, say, fork, go to the Linux
Documentation Project and grab yourself a copy of the Linux Programmer's
Guide. Once you're well-informed on that stuff, go grab yourself a copy
of the Kernel Hacker's Guide and use that as your tour guide through the
source. This is, of course, if you decide to do this with Linux.
Regardless of which free *nix you pick, you'll learn a lot more if you
play as you read... just don't go messing with a machine you depend on
without backing stuff up :-) Have fun.

--------------------------------------------------------------------
Melissa "Mighty Mouse" Bousfield, Friendly YUCC System Administrator
http://www.yucc.yorku.ca/~mouse/ _--/) .--.
"On the side of the software box, it said / o `\ / \
'Requires Windows95 or Better.' -*- \ \__, |
So I installed Linux..." ` `-____/
--------------------------------------------------------------------

R!ch

unread,
Mar 2, 1998, 3:00:00 AM3/2/98
to

On Sun, 1 Mar 1998, Prince of Darkness wrote:

> Try looking up some simple programs if you're just beginning. But if
> you want to know unix really well, then by all means check out the
> kernel.

This is good advice, but the canonical reference is surely the Lions
Book. It has a complete listing of the Version 6 source, and it's
full of commentry and annotations - excellant stuff!

--
R!ch (Email is flakey at present: use rich...@keaton.uk.sun.com)

If it ain't analogue, it ain't music.
#include <disclaimer.h> \\|// - ?
(o o)
/==================================oOOo=(_)=oOOo========\
| Richard Teer richar...@uk.sun.com |
| |
| |
| WWW: www.rkdltd.demon.co.uk |
| .oooO |
| ( ) Oooo. |
\===================================\ (==( )==========/
\_) ) /
(_/


David Stes

unread,
Mar 4, 1998, 3:00:00 AM3/4/98
to

On 1 Mar 1998 06:19:03 GMT, ogd...@alf.usask.ca (Ognen Duzlevski)
wrote:
>
>would it be a good way to learn unix programming to the bottom if
>one would work thru source codes of some of the freely available
>unixes (like linux for example) ? This assumes one knows assembler
>and C.

You can learn a lot by reading source, but you have to _somehow_ know
that it's written by someone who knows what he's doing.

A delicate question is, how to know this, because it's not because
someone's famous, that he's also good. Anyhow, I've read public domain
source code from Bill Joy and Brian Kernighan, for instance. Just out
of curiosity.

Actually in the Kernighan case, it was also to compile his "nawk" on my
machine. An interesting thing was that there was a name clash between a
function called isnumber() in his program and a nonstandard ctype.h
function or macro of the same name.

I sent email to bwk and proposed to use the name "nawk_isnumber()"
instead of "isnumber()" upon which I got immediately a furious reply
("they have to fix their header, *I* am not going to change the name of
my function. isnumber() is a perfectly good identifier").

So apparently he doesn't like that you prepend prefixes to identifiers.
This sort of thing makes sense if you think of it.

But well, it's just stylistic after all. Important, yes, but I would
not like to draw too far-reaching conclusions out of this ("all
programmers that use prefixes make mistakes" or something like that,
would be wrong, right?).

David.

Venu

unread,
Mar 7, 1998, 3:00:00 AM3/7/98
to Ognen Duzlevski

you're ambitious and mastering by rummaging thru source code will tell you
something about the
core OS. UNIX is made of hundreds of other utilities, libraries which won't
be a part of kernel code.

the better way would be to first understand the OS, the usual usage of UNIX
(maurice bach's bible, the UNIX OS) , simple programs-so that once u have a
suffieciently good understanding of the
system, you can move over to the kernel code.

and my experience as a programmer tells me that reading thru source code of
1000's of lines is a bad way to learn things. that is if u learn anything at
all.


Ognen Duzlevski wrote:

> Hi,


> would it be a good way to learn unix programming to the bottom if
> one would work thru source codes of some of the freely available
> unixes (like linux for example) ? This assumes one knows assembler
> and C.
>

> Thanx,
> OggieD.
> =========================================================================
> Ognen Duzlevski e-mail: ogd...@mail.usask.ca
> Cmpt.Sci major - 1st year
> University of Saskatchewan
> Saskatoon, Canada
> ========================================================================

--

motorola israel's excellent online learning site on :
"http://libra.miel.mot.com/~mvenu/tools.html" under "online learning"


0 new messages