Skip to contentSkip to conversation

What are .s files in arch/i386/boot

DISCUSSION Lars Unin 7 participants 7 messages Jun 7, 2003 – Jun 9, 2003

lore
Share & tools
lore

Lars Unin

author
#0 lore raw
Quoted 12 lines
Quoted 2 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Try running gcc on a c file with the -S option it will generate the same then you can tweak the assembler produced to make it faster.

James

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

Signature · 5 lines
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
#1 lore raw
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Quoted 6 lines
Quoted 4 lines

Try running gcc on a c file with the -S option it will generate the same then you can tweak the assembler produced to make it faster.

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

Why do all .c files have to be generated from a spec sheet ?

#2 lore raw
Quoted 10 lines · James Stevenson
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Try running gcc on a c file with the -S option it will generate the same then you can tweak the assembler produced to make it faster.

Quoted 6 lines
Quoted 2 lines

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

If there were ever C files to begin with. It's not unheard-of for people to write assembler code from scratch.

#3 lore raw
Followup to:  <[email protected]>
By author:    Sean Neakums <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 16 lines
Quoted 13 lines · James Stevenson
Quoted 12 lines
Quoted 10 lines
Quoted 2 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Try running gcc on a c file with the -S option it will generate the same then you can tweak the assembler produced to make it faster.

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

Quoted 7 lines
Quoted 3 lines

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

If there were ever C files to begin with. It's not unheard-of for people to write assembler code from scratch.

The ones in the Linux kernel were all written from scratch.

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
#4 lore raw
Quoted 15 lines · H. Peter Anvin
Followup to:  <[email protected]>
By author:    Sean Neakums <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 11 lines
Quoted 10 lines · James Stevenson
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

If there were ever C files to begin with. It's not unheard-of for people to write assembler code from scratch.

The ones in the Linux kernel were all written from scratch.

And for a very good reason. A few things really need asm, for example getting a CPU in protected mode, setting up the MMU and stuff. Once they are set up, you can use C, though sometimes you must be really sure what your compiler will make from the C.

So, why assembly ? Cause it is needed. Why in arch/i386/boot ? for if it is well done there, it isn't needed at many other locations. A few things will still require asm though, therefore you'll find more .s files in arch/i386.

Jos

#5 lore raw

Not that it's a bad thing or anything, but holy crap! I didn't think there was this level of hand-holding on this list.

It's nice to see folks willing to tutor, but really, don't get burned out. This list is probably better suited to handling deeper questions.

Quoted 40 lines · Jos Hulzink
Quoted 15 lines · H. Peter Anvin
Followup to:  <[email protected]>
By author:    Sean Neakums <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 11 lines
Quoted 10 lines · James Stevenson
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

There are not c files.
They are assembler files

Where can I find the .c files they were made from, and the spec sheets the .c files were made from?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

If there were ever C files to begin with. It's not unheard-of for people to write assembler code from scratch.

The ones in the Linux kernel were all written from scratch.

And for a very good reason. A few things really need asm, for example getting a CPU in protected mode, setting up the MMU and stuff. Once they are set up, you can use C, though sometimes you must be really sure what your compiler will make from the C.

So, why assembly ? Cause it is needed. Why in arch/i386/boot ? for if it is well done there, it isn't needed at many other locations. A few things will still require asm though, therefore you'll find more .s files in arch/i386.

Jos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#6 lore raw
In reply to James Stevenson
Quoted 4 lines · Lars Unin
Quoted 3 lines · James Stevenson
Quoted 3 lines
Quoted 2 lines

What are .s files in arch/i386/boot, are they c sources of some sort? Where can I find the specifications documents they were made from?

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

There are not c files.
They are assembler files

Try running gcc on a c file with the -S option it will generate the same then you can tweak the assembler produced to make it faster.

Where can I find the .c files they were made from,

Those files are smallish routines that can't be sanely written in C, or (in the case of the bootstrap stuff) are for running on the 8086 your latest CPU thinks it is when booting. No support for that from gcc.

Quoted 1 line
Quoted 1 line

and the spec sheets the .c files were made from?

If they where around once, they have been long plastered over by patches that make them useless now.

Quoted 3 lines

You would have to find the original author of the person who tweaks the assembler in the .s file chances are the .c file is long gone though.

Probably never was. Only way out is as they say: "Use the source, Luke".

You'd better get a book on ia32 (caution, the intel sytax almost all are written for is truly bletcherous, and does things just different enough from the AT&T sytax gcc/the kernel uses to make your head spin when trying to map back and forth). There was an HOWTO on assembly language programming under Linux, haven't looked at it in a long time.

Quoted 1 line

Why do all .c files have to be generated from a spec sheet ?

Now that is a good question... never used one in my life :-)

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513