www.digitalmars.com         C & C++   DMDScript  

D - OS Dependence

reply "Andrew Edwards" <aedwards spamfreeamerica.com> writes:
Does D allow direct compilation to program files with extensions other than
.exe (ex. .com in ms-dos)? If so, can someone point me to the appropriate
documentation, and/or provide a simple demonstration of how to accomplish
this?

Thanks,
Andrew
Jan 22 2003
next sibling parent reply Ilya Minkov <midiclub 8ung.at> writes:
Andrew Edwards wrote:
 Does D allow direct compilation to program files with extensions other than
 .exe (ex. .com in ms-dos)? If so, can someone point me to the appropriate
 documentation, and/or provide a simple demonstration of how to accomplish
 this?
 
 Thanks,
 Andrew
 
 
Forget about .com, any sane language is too much of a bloat to work in the TINY momory model. And then especially a GCed one. There might be a way to create Extended-DOS executables. Since DMD derives from DMC, i think you have to follow the instructions for creating DOS EXEs with DMC, available somewhere on Walter's site. Then, you'll probably need to create .OBJs with DMD, than use DMC linker. While D is not bound to Windows, i question the sanity of using it to create DOS executables. It does not suport DOS-native 16-bit modes. -i.
Jan 22 2003
parent reply "Andrew Edwards" <aedwards spamfreeamerica.com> writes:
Thanks,

Can I ask a favor of you? I recently started a message board on Programmer's
Heaven in hopes of generating more interest  in D.  I'm incapable of running
the board adequately, because I have next to no programming experience.
Though I monitor the D newsgroups, I seldom am able to participate in or
contribute to any of the discussions because I have no idea what you guys
are talking about. I am hoping for an Intro to programming tutorial to be
written for D so I continue to hang around. I am however,  actively trying
to promote the language with post on various newsgroups and message boards
(such as the recent message posted on Slashdot). I would appreciate if you
could drop by at Programmer's Heaven
(http://www.programmersheaven.com/c/msgboard/boardinfo.asp?BoardID=579) and
repost this response to the original question asked by Dr.Mobius. I don't
feel uncomfortable pretending that I know something I do not.

Andrew

"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:b0n387$1mk0$1 digitaldaemon.com...
 Andrew Edwards wrote:
 Does D allow direct compilation to program files with extensions other
than
 .exe (ex. .com in ms-dos)? If so, can someone point me to the
appropriate
 documentation, and/or provide a simple demonstration of how to
accomplish
 this?

 Thanks,
 Andrew
Forget about .com, any sane language is too much of a bloat to work in the TINY momory model. And then especially a GCed one. There might be a way to create Extended-DOS executables. Since DMD derives from DMC, i think you have to follow the instructions for creating DOS EXEs with DMC, available somewhere on Walter's site. Then, you'll probably need to create .OBJs with DMD, than use DMC linker. While D is not bound to Windows, i question the sanity of using it to create DOS executables. It does not suport DOS-native 16-bit modes. -i.
Jan 22 2003
next sibling parent "Andrew Edwards" <aedwards spamfreeamerica.com> writes:
 repost this response to the original question asked by Dr.Mobius. I don't
 feel uncomfortable pretending that I know something I do not.
Sorry, that's I don't feel comfortable...
Jan 22 2003
prev sibling parent reply "Christopher J. Sequeira" <csequeir __mit.edu> writes:
Glad that you posted again... I had emailed you with the same idea 
(tutorials and such on Programmers' Heaven), but the message bounced 
back (fake email address, I presume)?  I do have programming experience, 
but I don't have much time due to school.  However, I do think that 
people in general could benefit from tutorials at various skill levels, 
and I am interested in at least looking into this posibility, as well as 
exploring current GUI API's in development.  What do you think?  (Do 
email me if you wish.)


Andrew Edwards wrote:
 Thanks,
 
 Can I ask a favor of you? I recently started a message board on Programmer's
 Heaven in hopes of generating more interest  in D.  I'm incapable of running
 the board adequately, because I have next to no programming experience.
-- Christopher J. Sequeira '05 csequeir __mit.edu (remove hyphens for email)
Jan 22 2003
next sibling parent "Andrew Edwards" <aedwards spamfreeamerica.com> writes:
 (tutorials and such on Programmers' Heaven), but the message bounced
 back (fake email address, I presume)?  I do have programming experience,
sorry, SPAM deterrent.
Jan 22 2003
prev sibling parent "Andrew Edwards" <aedwards spamfreeamerica.com> writes:
"Christopher J. Sequeira" <csequeir __mit.edu> wrote in message
news:b0ngb7$1tid$1 digitaldaemon.com...
 Glad that you posted again... I had emailed you with the same idea
 (tutorials and such on Programmers' Heaven), but the message bounced
 back (fake email address, I presume)?  I do have programming experience,
 but I don't have much time due to school.  However, I do think that
 people in general could benefit from tutorials at various skill levels,
 and I am interested in at least looking into this posibility, as well as
 exploring current GUI API's in development.  What do you think?  (Do
 email me if you wish.)
Splendid idea. I have been hoping that others would begin to look towards creating a few tutorial. Of course, I am personally interested tutorials for Beginners, but all tutorials are appreciated. I am trying to attract users of all skill levels at Programmer's Heaven. I'm hoping that others in the group share your interest in creating tutorial for the language. Regards, Andrew
Jan 22 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Andrew Edwards" <aedwards spamfreeamerica.com> wrote in message
news:b0mtju$1j6r$1 digitaldaemon.com...
 Does D allow direct compilation to program files with extensions other
than
 .exe (ex. .com in ms-dos)? If so, can someone point me to the appropriate
 documentation, and/or provide a simple demonstration of how to accomplish
 this?
D does not support 16 bit memory models, and .com files are 16 bit. Currently, D only supports win32 exe and dll executable files. It does not support 16 bit windows nor 32 bit DOS extenders.
Jan 22 2003
parent reply "Jeroen van Bemmel" <anonymous somewhere.com> writes:
 D does not support 16 bit memory models, and .com files are 16 bit.
 Currently, D only supports win32 exe and dll executable files. It does not
 support 16 bit windows nor 32 bit DOS extenders.
I've been playing around with D for a couple of hours now and managed to compile it into a freestanding kernel image. I am thinking of porting my OS to D, and although it's not trivial I believe it can be done. What I had to do, was to convert D-generated OMF .obj files to COFF using Microsoft's EDITBIN.exe (which comes freely with MASM). Then I use Mingw32's port of ld to link those files into an .elf file, and from there into a binary kernel image. Now I've got it printing 'hello,world!' in a floppy image under bochs (PC emulator)
Jan 25 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Jeroen van Bemmel" <anonymous somewhere.com> wrote in message
news:b0ugnq$2j4s$1 digitaldaemon.com...
 I've been playing around with D for a couple of hours now and managed to
 compile it into a freestanding kernel image. I am thinking of porting my
OS
 to D, and although it's not trivial I believe it can be done.

 What I had to do, was to convert D-generated OMF .obj files to COFF using
 Microsoft's EDITBIN.exe (which comes freely with MASM). Then I use
Mingw32's
 port of ld to link those files into an .elf file, and from there into a
 binary kernel image. Now I've got it printing 'hello,world!' in a floppy
 image under bochs (PC emulator)
Wow!
Jan 25 2003
parent reply "Jeroen van Bemmel" <anonymous somewhere.com> writes:
 Wow!
Ditto for D, what I've seen so far :) While I'm working on this, I do notice that the current D implementation is somewhat biased towards a Windows platform. It would be nice if the runtime system was more or less independent of the OS, or at least cleanly separated. I understand this is a first prototype and to get results fast you have to make some dirty choices sometimes, but "idealistically" it would be better. The same goes for dependence on C library calls, IMO A particular issue I ran into, is the Windows-specific code generation conventions in linker symbols. 'dmd' generates __d_throw 4 as a symbol for 'throw', and expects to find a __stdcall C function (implemented in deh.c). This meant that I had to specifically use '-mn' for compiling the C code using 'dmc'. Just as an example So, on my wishlist for 'dmd' features so far I have: - support for memory models other than '-mn' (Win32), or at least a model that is not so win32 specific. A gcc frontend may solve this - some control over segment names of symbols: I have some code that is only used during system initialization, so in my current gcc implementation I put it in a separate segment and discard it after startup
Jan 25 2003
parent "Walter" <walter digitalmars.com> writes:
"Jeroen van Bemmel" <anonymous somewhere.com> wrote in message
news:b0ustc$2p9u$1 digitaldaemon.com...
 Ditto for D, what I've seen so far :)
Thanks!
 While I'm working on this, I do notice that the current D implementation
is
 somewhat biased towards a Windows platform. It would be nice if the
runtime
 system was more or less independent of the OS, or at least cleanly
 separated. I understand this is a first prototype and to get results fast
 you have to make some dirty choices sometimes, but "idealistically" it
would
 be better. The same goes for dependence on C library calls, IMO
This will get better.
 A particular issue I ran into, is the Windows-specific code generation
 conventions in linker symbols. 'dmd' generates __d_throw 4 as a symbol for
 'throw', and expects to find a __stdcall C function (implemented in
deh.c).
 This meant that I had to specifically use '-mn' for compiling the C code
 using 'dmc'. Just as an example
deh.c is so heavilly dependent on windows structured exception handling anyway, I didn't think that was a problem!
 So, on my wishlist for 'dmd' features so far I have:
 - support for memory models other than '-mn' (Win32), or at least a model
 that is not so win32 specific. A gcc frontend may solve this
 - some control over segment names of symbols: I have some code that is
only
 used during system initialization, so in my current gcc implementation I
put
 it in a separate segment and discard it after startup
There are a lot of great reasons to graft the D front end onto gcc.
Jan 25 2003