the meaning of "LDFLAGS =-m elf_i386 -Ttext 0 -e st
the meaning of "LDFLAGS =-m elf_i386 -Ttext 0 -e st
hi to all.......
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...
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...
Last edited by micro on Mon May 05, 2008 12:51 am, edited 1 time in total.
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.....
something wrong , but i do not know where and why ??:?:
i copy someone's code and fixed the above problem......
like this :
but .... i do not know its meaning.....
is there any infomation ??
two many color?? i am sorry
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.....
something wrong , but i do not know where and why ??:?:
i copy someone's code and fixed the above problem......
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.....
is there any infomation ??
two many color?? i am sorry
Last edited by micro on Mon May 05, 2008 12:52 am, edited 3 times in total.
Hi,
This line:
is incorrect. On success, LD will output nothing (so your System.map file contains nothing).
The line of code you copied:
Let's go through that bit by bit.
'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:
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
This line:
Code: Select all
$(LD) $(LDFLAGS) head.o -o system > System.map
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
Code: Select all
nm system
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)
* 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
JamesM wrote:Hi,
This line:
is incorrect. On success, LD will output nothing (so your System.map file contains nothing).Code: Select all
$(LD) $(LDFLAGS) head.o -o system > System.map
The line of code you copied:
Let's go through that bit by bit.Code: Select all
nm system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map > System.map
'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".Code: Select all
nm system
The expression, when you remove the backslashes put in there to stop the shell expanding them, reads:
Which will match:Code: Select all
(compiled)|(.o$)|( [aU] )|(..ng$)|(LASH[RL]DI)
* 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......
- Attachments
-
- linux-0.00.rar
- linux 0.00 code
- (3.2 KiB) Downloaded 156 times