www.digitalmars.com         C & C++   DMDScript  

c++ - DMC & Assembler

reply "Robert M. Münch" <robert.muench robertmuench.de> writes:
Hi, I'm playing around with some boot-sector code. All the stuff I found so
far use NASM and some tools from a guy named John Fine to get the correct
binary. I'm sure this can be done with DMC as well. Here are some questions:

1. DMC calls MASM when seeing inline assembler. Can this be switched to
NASM? As the assembler formats of MASM and NASM don't seem to be compatible.

2. How can I create a simple binary file with a start address of 0x7c00. I
tried to use: link /binary:0x7c00 bootf.obj but got this error message. Note
the obj-file was created with NASM.

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

OPTLINK : Warning 134: No Start Address
bootf.obj(bootf)
 Warning 47: Below 100H Cannot Be Initialized

I would like to use the DMC tools for bootstrapping an own bootsector and a
mini console. Thanks.
--
Robert M. Münch
IT & Management Freelancer
Mobile: +49 (0)177 2452 802
Fax   : +49 (0)721 8408 9112
Web   : http://www.robertmuench.de
Jul 10 2002
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:aghkfh$1fhp$1 digitaldaemon.com...
 Hi, I'm playing around with some boot-sector code. All the stuff I found
so
 far use NASM and some tools from a guy named John Fine to get the correct
 binary. I'm sure this can be done with DMC as well. Here are some
questions:
 1. DMC calls MASM when seeing inline assembler. Can this be switched to
 NASM? As the assembler formats of MASM and NASM don't seem to be
compatible. Just run NASM separately. No need to run it via the DMC shell.
 2. How can I create a simple binary file with a start address of 0x7c00. I
 tried to use: link /binary:0x7c00 bootf.obj but got this error message.
Note
 the obj-file was created with NASM.
The only way this could work is to create a COM file. (-mt memory model)
Jul 10 2002
parent reply "Robert M. Münch" <robert.muench robertmuench.de> writes:
"Walter" <walter digitalmars.com> schrieb im Newsbeitrag
news:aghpm8$1kt7$1 digitaldaemon.com...

 Just run NASM separately. No need to run it via the DMC shell.
Ok. BTW: How about adding NASM support? This assembler seems to be the defacto standard in most projects... and
 The only way this could work is to create a COM file. (-mt memory model)
I tried this but no success either. As said the bootf.obj file was generated with NASM. link /tiny /binary:0x7c00 bootf.obj OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved OPTLINK : Warning 134: No Start Address bootf.obj(bootf) Warning 47: Below 100H Cannot Be Initialized OPTLINK : Error 46: Start Address Must Be 100H Robert
Jul 11 2002
parent "Walter" <walter digitalmars.com> writes:
I'm afraid that the linker probably isn't going to work for your project. It
is designed to create dos/windows executables, not rom images.

"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:agjgb0$bpr$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> schrieb im Newsbeitrag
 news:aghpm8$1kt7$1 digitaldaemon.com...

 Just run NASM separately. No need to run it via the DMC shell.
Ok. BTW: How about adding NASM support? This assembler seems to be the defacto standard in most projects... and
 The only way this could work is to create a COM file. (-mt memory model)
I tried this but no success either. As said the bootf.obj file was
generated
 with NASM.

 link /tiny /binary:0x7c00 bootf.obj

 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 OPTLINK : Warning 134: No Start Address
 bootf.obj(bootf)
  Warning 47: Below 100H Cannot Be Initialized
 OPTLINK : Error 46: Start Address Must Be 100H

 Robert
Jul 11 2002
prev sibling parent reply "V. Krishnakumar" <lvimala eth.net> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:aghkfh$1fhp$1 digitaldaemon.com...
 Hi, I'm playing around with some boot-sector code. All the stuff I found
so
 far use NASM and some tools from a guy named John Fine to get the correct
 binary. I'm sure this can be done with DMC as well. Here are some
questions:

You must be using his JLoc linker/loader. The intended purpose of this tool
is to produce bootsectors. Its a very flexible linker that requires you
write a script for every new link.

-Krish
Jul 10 2002
parent "Robert M. Münch" <robert.muench robertmuench.de> writes:
"V. Krishnakumar" <lvimala eth.net> schrieb im Newsbeitrag
news:agio41$2icq$1 digitaldaemon.com...

 You must be using his JLoc linker/loader.
That's right. But I didn't found any documentation for it. Do you have link for docs?
 The intended purpose of this tool is to produce bootsectors.
Hmmm... is this task so special for other linkers?
 Its a very flexible linker that requires you
 write a script for every new link.
Yep, just a simple config file. It works but I would like to use DMC for the complete task: 1. Write Bootsector code with inline ASM 2. Use C for the "kernel" part. -- Robert M. Münch IT & Management Freelancer Mobile: +49 (0)177 2452 802 Fax : +49 (0)721 8408 9112 Web : http://www.robertmuench.de
Jul 11 2002