2003-06-07 18:21:54

by Lars Unin

[permalink] [raw]
Subject: What are .s files in arch/i386/boot

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?

Lars unin
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze


2003-06-07 18:33:44

by James Stevenson

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

On Sun, 8 Jun 2003, Lars Unin wrote:

> 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

2003-06-07 18:39:30

by Lars Unin

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

> > 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?
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

2003-06-07 18:48:36

by James Stevenson

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot


> > > 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?

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 ?



2003-06-07 19:18:58

by Sean Neakums

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

James Stevenson <[email protected]> writes:

>> > > 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?
>
> 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.

2003-06-07 21:14:05

by H. Peter Anvin

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

Followup to: <[email protected]>
By author: Sean Neakums <[email protected]>
In newsgroup: linux.dev.kernel
>
> James Stevenson <[email protected]> writes:
>
> >> > > 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?
> >
> > 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
--
<[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

2003-06-08 19:50:41

by Jos Hulzink

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

On Saturday 07 Jun 2003 23:27, H. Peter Anvin wrote:
> Followup to: <[email protected]>
> By author: Sean Neakums <[email protected]>
> In newsgroup: linux.dev.kernel
>
> > James Stevenson <[email protected]> writes:
> > >> > > 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?
> > >
> > > 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

2003-06-08 21:28:13

by Shawn

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

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.

On Sun, 2003-06-08 at 15:04, Jos Hulzink wrote:
> On Saturday 07 Jun 2003 23:27, H. Peter Anvin wrote:
> > Followup to: <[email protected]>
> > By author: Sean Neakums <[email protected]>
> > In newsgroup: linux.dev.kernel
> >
> > > James Stevenson <[email protected]> writes:
> > > >> > > 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?
> > > >
> > > > 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/

2003-06-09 01:25:05

by Horst H. von Brand

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

Lars Unin <[email protected]> said:
> James Stevenson <[email protected]> said:
> > > > 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,

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.

> > 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.

> 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.

> 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 :-)
--
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

2003-06-09 15:16:07

by Lars Unin

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

From: Mark Hahn <[email protected]>
> > > What are .s files in arch/i386/boot, are they c sources of some sort?
>
> no. is there some reason you can't just look at them?
>
> > > > Where can I find the specifications documents they were made from?
> > >
> > > There are not c files.
> > > They are assembler files
>
> .s files are versions of .S files that have been run through cpp (gcc -E).
> you can know this simply by looking at the makefiles or watching a build,
> or by looking at the .s file and noticing the #line directives.
>
> > > 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.
>
> that's useful advice, but irrelevant in this case.
>
> > Where can I find the .c files they were made from,
>
> they aren't.
>
> > and the spec sheets the .c files were made from?
>
> what the heck is a "spec sheet"?

I mean where can I find the information from which

"* It then loads 'setup' directly after itself (0x90200), and the system
* at 0x10000, using BIOS interrupts. "
-- bootsect.S

The ability to know how to get the BIOS to do that comes from, e.g. a
book that can tell me how to do that without taking another degree...
Where the information can be found, that says what BIOS memory
area 0x90200 is for etc.
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

2003-06-09 15:22:55

by Lars Unin

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot


>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.

Whats sytax? ;-)
Do ya not mean syntax?
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

2003-06-09 20:52:24

by Steve Brueggeman

[permalink] [raw]
Subject: Re: What are .s files in arch/i386/boot

Not sure, but I think this is what you want.

http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Linux-Init-HOWTO.html

Steve Brueggeman


On Mon, 09 Jun 2003 23:30:38 +0800, you wrote:

>From: Mark Hahn <[email protected]>
> > > > What are .s files in arch/i386/boot, are they c sources of some sort?
>>
>> no. is there some reason you can't just look at them?
>>
>> > > > Where can I find the specifications documents they were made from?
>> > >
>> > > There are not c files.
>> > > They are assembler files
>>
>> .s files are versions of .S files that have been run through cpp (gcc -E).
>> you can know this simply by looking at the makefiles or watching a build,
>> or by looking at the .s file and noticing the #line directives.
>>
>> > > 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.
>>
>> that's useful advice, but irrelevant in this case.
>>
>> > Where can I find the .c files they were made from,
>>
>> they aren't.
>>
>> > and the spec sheets the .c files were made from?
>>
>> what the heck is a "spec sheet"?
>
>I mean where can I find the information from which
>
>"* It then loads 'setup' directly after itself (0x90200), and the system
> * at 0x10000, using BIOS interrupts. "
>-- bootsect.S
>
>The ability to know how to get the BIOS to do that comes from, e.g. a
>book that can tell me how to do that without taking another degree...
>Where the information can be found, that says what BIOS memory
>area 0x90200 is for etc.