Re: Linux-asm (was A patch for linux 2.1.127)

Albert D. Cahalan (acahalan@cs.uml.edu)
Thu, 19 Nov 1998 02:19:25 -0500 (EST)


Manuel J. Galan writes:
> "Richard B. Johnson" wrote:
>> On Tue, 17 Nov 1998, Manuel J. Galan wrote:

>>> * UNIX was built on C and C was built for UNIX.
>>
>> Unix was built on a Digital PDP-11/34, using tools available
>> in the RSX-11 Digital Operation system. Most of the 'hardware stuff'
>> was done in DEC MACRO Assembly under RSX-11.
>>
>> 'C' came later.
>
> So what comes first the chicken or the egg? :)

Order of events:

PDP-7 assembler
Unics, written in PDP-7 assembly
PDP-7 assembler that ran on Unics
B compiler for the PDP-7 (not producing native code)
PDP-11 assembler
Unics ported to the PDP-11, redone in PDP-11 assembly
PDP-11 assembler that ran on PDP-11 Unics
B compiler for the PDP-11
NB compiler for the PDP-11
C compiler for the PDP-11
Unics written in C

/* "Hello World" in B for 64-bit hardware! */
hw [0] "Hello World.*n";
main(){
extrn hw;
putchar(0[hw]);
hw=+1;
putchar(0[hw]);
}

>>> * UNIX/C were devised with portability in mind.
>>
>> Unix and C are not the same thing. Once Unix was running, a
>> 'C' compiler was built (from the ideas of 'B') so that the
>> machine would not have to be rebooted to get at the DEC tools
>> to continue development.
>
> But they were devised with _portability_ in mind.

No. Unics was designed for game play. Text processing support was
added later, to get funding for a machine that could run games faster.
Portability was not an issue.

I'm not kidding.

>>> * To speed up your programs, improve your algorithms.
>>> ( i.e. see last posting by Benoit Poulot-Cazajous)

After you have done that, how else will you increase performance?
(and after that?....)

>> 'C' is a tool. That's all. There are other tools available
>> which, combined, are known as a 'programming environment'.
>
> Yes but C is portable and ASM is not!

C isn't considered very portable. Java is, but would you want the
kernel written in Java? Maybe Common LISP would be nice? ARRRGH!!!

>>> * Linus himself seems to be quite a good assembler
>>> programmer but he made Linux kernel in C, (hint, hint...)

Linus made the kernel in assembly, since he wanted to learn
about how the i386 worked.

> I am not a C fundamentalist and for sure that some asm is needed
> in specific parts... But kernel is built on 'C' (99.99%) and I like
> it as it is. I am a human being and I do NOT want to be assimilated
> to the BORG! :)

C will never run faster than assembly, since C gets converted to
assembly. When a human wants to beat the compiler, they can start
from the compiler output.

Remember that a performance advantage worth 1 year of hardware
improvement won't just disappear after a year. You still get a
1-year lead, and only lose it slowly as processors change and
compilers improve.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/