Thread: Re: [Etherboot-developers] Why doesn't gas assemble start32.S
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Marty C. <md...@th...> - 2001-02-09 17:58:24
|
On 2/9/2001 12:36 PM Eno Compton Eno...@Mi... wrote:
>Tried to assemble start32.S. Was amazed to discover errors occur even on
>comment lines. Obviously, some assembler, other than gas, has been used to
>assemble the code.
>Discovered as well, gas includes only one pass, which, among other things,
>makes an assembly listing of questionable value.
>These things suggest to me, real programmers are using an assembler other
>than gas.
>Would somebody please fill me in on these questions?
>How does one assemble start32.S?
Good question. Let's see how the Makefile does it:
$ grep start32 Makefile
SRCS= floppyload.S comload.S liloprefix.S loader.S start16.S start32.S
serial.S
START32= start32.o.pre
START32= bin32/start32.o
# To make sure that this actually builds a start32.o.pre with all options
set,
precompiled: bin/rloader.bin bin/rzloader.bin bin/prloader.bin
bin/przloader.bin bin/floppyload.bin bin/comload.bin bin16/start16.o
bin32/start32.o bin/liloprefix.bin
cp -p bin32/start32.o start32.o.pre
Well, it seems to be part of the "precompiled" family. Let's see what
happens if we do that:
[mdc@rom src]$ make precompiled
gcc -E -DUSE_AS86 -DMOVEROM -DRELOC=0x98000 -o bin/rloader.s loader.S
as86 -0 -b bin/rloader.bin bin/rloader.s
gcc -E -DUSE_AS86 -DMOVEROM -DRELOC=0x98000 -DZLOADER -o bin/rzloader.s
loader.S
as86 -0 -b bin/rzloader.bin bin/rzloader.s
gcc -E -DUSE_AS86 -DMOVEROM -DRELOC=0x98000 -DPCI_PNP_HEADER -o
bin/prloader.s loader.S
as86 -0 -b bin/prloader.bin bin/prloader.s
gcc -E -DUSE_AS86 -DMOVEROM -DRELOC=0x98000 -DPCI_PNP_HEADER -DZLOADER -o
bin/przloader.s loader.S
as86 -0 -b bin/przloader.bin bin/przloader.s
gcc -E -DUSE_AS86 -o bin/floppyload.s floppyload.S
as86 -0 -b bin/floppyload.bin bin/floppyload.s
gcc -E -DUSE_AS86 -o bin/comload.s comload.S
as86 -0 -b bin/comload.bin bin/comload.s
bcc -DMOTD -DIMAGE_MENU -DBACKOFF_LIMIT=7 -DASK_BOOT=3
-DANS_DEFAULT=ANS_NETWORK -O -ansi -DVERSION=\"4.6.12\" -DRELOC=0x98000
-c -o bin16/start16.o start16.S
[here's where start32.S gets assembled]
gcc -E -DMOTD -DIMAGE_MENU -DBACKOFF_LIMIT=7 -DASK_BOOT=3
-DANS_DEFAULT=ANS_NETWORK -O2 -g -fstrength-reduce -fomit-frame-pointer
-m386 -malign-jumps=1 -malign-loops=1 -malign-functions=1 -Wall -W
-Wno-format -Wno-unused -DVERSION=\"4.6.12\" -DRELOC=0x98000 start32.S |
as -o bin32/start32.o
{standard input}: Assembler messages:
{standard input}:339: Warning: indirect ljmp without `*'
[the warnings can be safely ignored, I'm told]
gcc -E -DUSE_AS86 -o bin/liloprefix.s liloprefix.S
as86 -0 -b bin/liloprefix.bin bin/liloprefix.s
cp -p bin/rloader.bin rloader.bin.pre
cp -p bin/rzloader.bin rzloader.bin.pre
cp -p bin/prloader.bin prloader.bin.pre
cp -p bin/przloader.bin przloader.bin.pre
cp -p bin/floppyload.bin floppyload.bin.pre
cp -p bin/comload.bin comload.bin.pre
cp -p bin16/start16.o start16.o.pre
cp -p bin32/start32.o start32.o.pre
cp -p bin/liloprefix.bin liloprefix.bin.pre
OK, so it puts it in bin32/start32.o
Let's try making that:
[mdc@rom src]$ make bin32/start32.o
gcc -E -DMOTD -DIMAGE_MENU -DBACKOFF_LIMIT=7 -DASK_BOOT=3
-DANS_DEFAULT=ANS_NETWORK -O2 -g -fstrength-reduce -fomit-frame-pointer
-m386 -malign-jumps=1 -malign-loops=1 -malign-functions=1 -Wall -W
-Wno-format -Wno-unused -DVERSION=\"4.6.12\" -DRELOC=0x98000 start32.S |
as -o bin32/start32.o
{standard input}: Assembler messages:
{standard input}:339: Warning: indirect ljmp without `*'
That looks like it. I guess it needs lots of options to assemble
properly.
Hope this helps,
Marty
---
Try: http://rom-o-matic.net/ to make Etherboot images instantly.
Name: Martin D. Connor
US Mail: Entity Cyber, Inc.; P.O. Box 391827; Cambridge, MA 02139; USA
Voice: (617) 491-6935, Fax: (617) 491-7046
Email: md...@th...
Web: http://www.thinguin.org/
|
|
From: Marty C. <md...@th...> - 2001-02-10 02:12:02
|
On 2/9/2001 5:37 PM Eno Compton Eno...@Mi... wrote:
>Have done a little digging here.
>In the 4.7.17 Makefile, the precompile target copies stuff from src/bin to
>src but the rules don't say anything about compiling anything and the bin
>src/bin directory is empty. The complaint that make issues to the effect
>there is no target for bin/rloader.bin is a little specious.
Did you uncomment the AS86 define in Makefile (the first one)? If you
didn't you wouldn't recompile anything. Here is the relevant part of the
Makefile:
# If you have not made any changes to the *.S files, AS86 need not be set.
# (most people)
# If you have made changes to the *.S files and you want to rebuild
*loader.bin
# and {floppy,com}load.bin and you have as86 from the ELKS Dev86 package
(not
# the one that normally comes with Linux) (not most people)
AS86= as86
# If you have made changes to the *.S files and you want to rebuild
*loader.bin
# and {floppy,com}load.bin and you have nasm (not most people)
#AS86= nasm
if I do:
$ make clean
then
$ make bin32/start32.o
I get:
gcc -E -DMOTD -DIMAGE_MENU -DBACKOFF_LIMIT=7 -DASK_BOOT=3
-DANS_DEFAULT=ANS_NETWORK -DTAGGED_IMAGE -DELF_IMAGE -O2 -g
-fstrength-reduce -fomit-frame-pointer -m386 -malign-jumps=1
-malign-loops=1 -malign-functions=1 -Wall -W -Wno-format -Wno-unused
-DVERSION_MAJOR=4 -DVERSION_MINOR=7 -DVERSION=\"4.7.17\" -DRELOC=0x98000
start32.S | as -o bin32/start32.o
{standard input}: Assembler messages:
{standard input}:327: Warning: indirect ljmp without `*'
How about you?
$ gcc --version
egcs-2.91.66
What version of gcc are you running?
I hope this helps,
Regards,
Marty
---
Try: http://rom-o-matic.net/ to make Etherboot images instantly.
Name: Martin D. Connor
US Mail: Entity Cyber, Inc.; P.O. Box 391827; Cambridge, MA 02139; USA
Voice: (617) 491-6935, Fax: (617) 491-7046
Email: md...@th...
Web: http://www.thinguin.org/
|
|
From: Eno C. <Eno...@Mi...> - 2001-02-12 15:05:50
|
My results are the same as yours with the exception I didn't get the
assembler messages but that is ok.
I don't quite understand the implications here - too early on Monday morning
I guess. When I have digested this business, I'll post again.
Over the weekend, I did have an opportunity to look into assemblers. I am
startled to discover nasm, a product that clearly outperforms tasm and masm.
Thank you once again. I think you and Ken are doing the community a great
service.
Eno
-----Original Message-----
From: Marty Connor [mailto:md...@th...]
Sent: Friday, February 09, 2001 7:11 PM
To: Eno Compton
Cc: Etherboot Developers
Subject: RE: [Etherboot-developers] Why doesn't gas assemble
start32.S
On 2/9/2001 5:37 PM Eno Compton Eno...@Mi... wrote:
>Have done a little digging here.
>In the 4.7.17 Makefile, the precompile target copies stuff from src/bin to
>src but the rules don't say anything about compiling anything and the bin
>src/bin directory is empty. The complaint that make issues to the effect
>there is no target for bin/rloader.bin is a little specious.
Did you uncomment the AS86 define in Makefile (the first one)? If you
didn't you wouldn't recompile anything. Here is the relevant part of the
Makefile:
# If you have not made any changes to the *.S files, AS86 need not be set.
# (most people)
# If you have made changes to the *.S files and you want to rebuild
*loader.bin
# and {floppy,com}load.bin and you have as86 from the ELKS Dev86 package
(not
# the one that normally comes with Linux) (not most people)
AS86= as86
# If you have made changes to the *.S files and you want to rebuild
*loader.bin
# and {floppy,com}load.bin and you have nasm (not most people)
#AS86= nasm
if I do:
$ make clean
then
$ make bin32/start32.o
I get:
gcc -E -DMOTD -DIMAGE_MENU -DBACKOFF_LIMIT=7 -DASK_BOOT=3
-DANS_DEFAULT=ANS_NETWORK -DTAGGED_IMAGE -DELF_IMAGE -O2 -g
-fstrength-reduce -fomit-frame-pointer -m386 -malign-jumps=1
-malign-loops=1 -malign-functions=1 -Wall -W -Wno-format -Wno-unused
-DVERSION_MAJOR=4 -DVERSION_MINOR=7 -DVERSION=\"4.7.17\" -DRELOC=0x98000
start32.S | as -o bin32/start32.o
{standard input}: Assembler messages:
{standard input}:327: Warning: indirect ljmp without `*'
How about you?
$ gcc --version
egcs-2.91.66
What version of gcc are you running?
I hope this helps,
Regards,
Marty
---
Try: http://rom-o-matic.net/ to make Etherboot images instantly.
Name: Martin D. Connor
US Mail: Entity Cyber, Inc.; P.O. Box 391827; Cambridge, MA 02139; USA
Voice: (617) 491-6935, Fax: (617) 491-7046
Email: md...@th...
Web: http://www.thinguin.org/
|