Page 1 of 1

the meaning of "LDFLAGS =-m elf_i386 -Ttext 0 -e st

Posted: Sun May 04, 2008 5:55 pm
by micro
hi to all....... :D
what's mean of LDFLAGS =-m elf_i386 -Ttext 0 -e startup_32

i think it is the parameter or option of the GUN( ld)

but i do not know what it uesd for....?

thanks ..... any answers...

Posted: Sun May 04, 2008 6:13 pm
by Alboin
"-m elf_i386": Output 32-bit code for the i386 in elf format.
"-Ttext 0": Code should be loaded\aligned at 0.
"-e startup_32": startup_32 is the entry point.

Posted: Sun May 04, 2008 6:19 pm
by micro
Alboin wrote:"-m elf_i386": Output 32-bit code for the i386 in elf format.
"-Ttext 0": Code should be loaded\aligned at 0.
"-e startup_32": startup_32 is the entry point.

thanks..... very very very ... much

Posted: Sun May 04, 2008 8:07 pm
by micro
hi.
i ... again.... :(

LDFLAGS =-m elf_i386 -Ttext 0 -e startup_32

Image: boot system
dd bs=32 if=boot of=Image skip=1
dd bs=512 if=system of=Image skip=2 seek=1
sync

disk: Image
dd bs=8192 if=Image of=12.img
sync;sync;sync

head.o: head.s
system:head.o
$(LD) $(LDFLAGS) head.o -o system > System.map


i try to write a makefile , above is the code....

and debug it in the bochs... but it can not jmp to the head.s

so i check it ...

System.map is empty..... :cry: :cry:

something wrong , but i do not know where and why ??:?: :?:

i copy someone's code and fixed the above problem...... :D

like this :
nm system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map > System.map[/b
]
but .... i do not know its meaning..... :oops: :oops: :oops:
is there any infomation ?? :oops:


two many color?? i am sorry

Posted: Mon May 05, 2008 12:43 am
by Combuster
I can't read what you posted. Too many colours.

Posted: Mon May 05, 2008 12:53 am
by micro
Combuster wrote:I can't read what you posted. Too many colours.

i am sorry for that.....

it is all dark.... :roll: :roll:

Posted: Mon May 05, 2008 6:28 am
by JamesM
Hi,

This line:

Code: Select all

$(LD) $(LDFLAGS) head.o -o system > System.map 
is incorrect. On success, LD will output nothing (so your System.map file contains nothing).

The line of code you copied:

Code: Select all

nm system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map > System.map
Let's go through that bit by bit.

Code: Select all

nm system
'nm' is a binutils command that dumps out a list of symbols from an ELF file. The output from this is then piped into 'grep', which is a regular expression pattern matcher. It's called with a regular expression, and the '-v' flag which means "print all lines that do NOT match the given regular expression".

The expression, when you remove the backslashes put in there to stop the shell expanding them, reads:

Code: Select all

(compiled)|(.o$)|( [aU] )|(..ng$)|(LASH[RL]DI)
Which will match:
* The word 'compiled', anywhere in the output.
* any line ending in any character followed by an 'o'.
* any line where the pattern 'SPACE a SPACE' or 'SPACE U SPACE' is found.
* any line which ends with two of any character followed by 'ng'.
* any line which contains the text 'LASHRDI' or 'LASHLDI'.

Those rules seem fairly strange to me, with the exception of the first three, but I assume they make sense for the binary you're compiling.

So the output of the grep stage will contain every line of the output of 'nm' that does NOT match the above rules.

The output of grep is then piped into 'sort', which takes its input and sorts it alphanumerically. This is then put into the file "System.map". (There's an extraneous '> System.map' in there - typo?)

That is its meaning.

Cheers,

James

Posted: Mon May 05, 2008 8:32 am
by micro
JamesM wrote:Hi,

This line:

Code: Select all

$(LD) $(LDFLAGS) head.o -o system > System.map 
is incorrect. On success, LD will output nothing (so your System.map file contains nothing).

The line of code you copied:

Code: Select all

nm system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map > System.map
Let's go through that bit by bit.

Code: Select all

nm system
'nm' is a binutils command that dumps out a list of symbols from an ELF file. The output from this is then piped into 'grep', which is a regular expression pattern matcher. It's called with a regular expression, and the '-v' flag which means "print all lines that do NOT match the given regular expression".

The expression, when you remove the backslashes put in there to stop the shell expanding them, reads:

Code: Select all

(compiled)|(.o$)|( [aU] )|(..ng$)|(LASH[RL]DI)
Which will match:
* The word 'compiled', anywhere in the output.
* any line ending in any character followed by an 'o'.
* any line where the pattern 'SPACE a SPACE' or 'SPACE U SPACE' is found.
* any line which ends with two of any character followed by 'ng'.
* any line which contains the text 'LASHRDI' or 'LASHLDI'.

Those rules seem fairly strange to me, with the exception of the first three, but I assume they make sense for the binary you're compiling.

So the output of the grep stage will contain every line of the output of 'nm' that does NOT match the above rules.

The output of grep is then piped into 'sort', which takes its input and sorts it alphanumerically. This is then put into the file "System.map". (There's an extraneous '> System.map' in there - typo?)

That is its meaning.

Cheers,

James

thank you ... very much


but i have another problem.
i download programming called "linux 0.00"
so i write the MAKEFILE to compile it
it seems works well

but it can not jump from boot to the head

i have uploaded it

system is : FC8 AND bochs 2.1.1

if there is any mistake , please let me know.....
thanks......

Posted: Mon May 05, 2008 10:39 am
by JamesM
I suggest you put your debugging head on, and get debugging.

PROTIP: Linux 0.00 is unlikely to be stable!

Posted: Mon May 05, 2008 5:31 pm
by micro
JamesM wrote:I suggest you put your debugging head on, and get debugging.

PROTIP: Linux 0.00 is unlikely to be stable!
thanks JamesM

i am so fool
that i do not undertand clearly . about your suggest

could you say it more clearly...?

desire it .....

Posted: Mon May 05, 2008 5:45 pm
by pcmattman
micro wrote:i am so fool
that i do not undertand clearly . about your suggest
:roll:

Read the announcement at the top of this subforum.

If you don't know what debugging or stability is, then you're not ready to make an OS. It's that simple.

Posted: Mon May 05, 2008 6:12 pm
by micro
pcmattman wrote:
micro wrote:i am so fool
that i do not undertand clearly . about your suggest
:roll:

Read the announcement at the top of this subforum.

If you don't know what debugging or stability is, then you're not ready to make an OS. It's that simple.
thanks