*BSD News Article 19748


Return to BSD News archive

Xref: sserve comp.os.linux.misc:330 comp.os.386bsd.misc:712
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!uunet!pipex!sunic!news.funet.fi!klaava!klaava!not-for-mail
From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Newsgroups: comp.os.linux.misc,comp.os.386bsd.misc
Subject: Re: Why would I want LINUX?
Date: 20 Aug 1993 00:48:11 +0300
Organization: University of Helsinki
Lines: 55
Message-ID: <250ser$rc5@klaava.Helsinki.FI>
References: <55270001@hplvec.LVLD.HP.COM> <24rbb5$t51@hrd769.brooks.af.mil> <24vd7h$frk@horus.mch.sni.de> <MIKE.93Aug19115915@pdx800.jf.intel.com>
NNTP-Posting-Host: klaava.helsinki.fi

In article <MIKE.93Aug19115915@pdx800.jf.intel.com> mike@ichips (Mike Haertel) writes:
>
>This has, alas, been fixed in recent versions of Linux, which seems to
>have come down with a very serious case of The Bloat.  I remember a
>time (early 1992) when the Linux kernel was under 25K lines of
>code.  The 0.99.12 kernel, at 118K lines, is nearly five times
>the size.  It does not offer five times the functionality.

No, it doesn't offer 5 times the functionality, but looking at the
kernel, most of the "bloat" is in fact device drivers (and the addition
of networking code since the early versions).  The current kernel has
about 95k-lines of C code (and almost 15k+ lines of headers and 5k lines
of assembly), but the breakdown is rather interesting:

kernel proper:			 4600 lines
memory management:		 2300 lines
virtual filesystem layer:	 6200 lines

That's the "essential" services, but you don't get far with just those:

each filesystem at about:	 2500 lines (ranging from 1700 to 4000 lines)

character device drivers:	12000 lines
FPU emulator:			 7200 lines (+4000 of the 5000 lines of asm)
block drivers:			18600 lines (12000 of which is SCSI supprot)

networking:			21000 lines

+ various other sources, some of them used for the build process, rather
than for the kernel proper. 

As can be seen, the real kernel isn't really very big, and has actually
not gotten *that* much larger since the early days.  The device drivers
amount for about one third of the kernel (FPU-emulator counting as a
"device driver"), and they have indeed grown a lot (but that's not
bloat: it's mostly just the diversity of PC hardware which makes for a
lot of problems). 

The filesystems are about 20000 lines of C code total: about a fifth of
the kernel.  The individual filesystems haven't bloated very much, but
there are more of them (minix, ext, ext2, msdos, xiafs, nfs, isofs and
proc-fs).  Most of the code bears more than a passing resemblance to the
minix-fs code, so the "new" code is to a large part an adaptation of the
minix-fs code. 

Networking is similarly about 20000 lines of C code (this is including
the driver code which is not yet separate as the rest of the drivers). 

Back in early 1992 (version 0.12), there was no networking code, only
one filesystem (minix), no scsi devices or CDROM drivers, a much smaller
math-emulator (the one still in use by 386bsd right now?), no mouse
drivers etc.  Totally new code since then: at least 60klines of C code
(of 95klines!), mostly drivers. 

			Linus