 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Roddy Pratt Guest
|
Posted: Thu May 13, 2004 10:04 pm Post subject: What's an Emulator? |
|
|
See: http://www.google.co.uk/search?hl=en&lr=&oi=defmore&q=define:emulator
I can't see anything there that fits my understanding of gcc under win32...
The key aspect for me is that gcc is specifically compiled and linked to a
win32 .exe. There are certain to be some software "shims" converting
idionsyncracies of the win32 api functions used into the (different)
idiosyncracies expected by a *nix application, but this is just the normal
metaphor of separating interface from implementation...
[FWIW, I once wrote a 68K/6502 emulator. That's emulating a 68000 on a
Commodore C64, NOT vice-versa!]
- Roddy
|
|
| Back to top |
|
 |
Ed Mulroy [TeamB] Guest
|
Posted: Thu May 13, 2004 10:28 pm Post subject: Re: What's an Emulator? |
|
|
So you have concluded that emulating Linux under Windows is not
emulating? The page whose link you provided does not agree with that.
.. Ed
| Quote: | Roddy Pratt wrote in message
news:40a3f0f8 (AT) newsgroups (DOT) borland.com...
See:
http://www.google.co.uk/search?hl=en&lr=&oi=defmore&q=define:emulator
I can't see anything there that fits my understanding of gcc under
win32...
The key aspect for me is that gcc is specifically compiled and
linked to a
win32 .exe. There are certain to be some software "shims" converting
idionsyncracies of the win32 api functions used into the (different)
idiosyncracies expected by a *nix application, but this is just the
normal
metaphor of separating interface from implementation...
[FWIW, I once wrote a 68K/6502 emulator. That's emulating a 68000 on
a
Commodore C64, NOT vice-versa!]
|
|
|
| Back to top |
|
 |
Roddy Pratt Guest
|
Posted: Thu May 13, 2004 11:00 pm Post subject: Re: What's an Emulator? |
|
|
"Ed Mulroy [TeamB]" <dont_email_me (AT) bitbuc (DOT) ket> wrote
| Quote: | So you have concluded that emulating Linux under Windows is not
emulating? The page whose link you provided does not agree with that.
|
Ed,
It's certainly possible to consider software "shims" like that to be
'emulators', but it's just not common practice.
The standard c rtl is pretty much the native unix programming api - that's
where it comes from. Does that mean that if I use the c rtl instead of
'native' win32 calls, I'm using an emulation?
The term "emulator" often implies slow, probably interpreted, and somewhat
"kludged". It's often used in a negative or derogatory way. That's why a
number of people are taking issue with you on this. FYI, I do use gcc for
cross-development, but I'd rather boil my head than use gcc for windows gui
programming.
Regards,
Roddy
int add_a_to_b(int a, int b) { return a+b;}
int emulate_addition_of_a_to_b(int a, int b) { return a+b;}
|
|
| Back to top |
|
 |
Ed Mulroy [TeamB] Guest
|
Posted: Thu May 13, 2004 11:21 pm Post subject: Re: What's an Emulator? |
|
|
| Quote: | The term "emulator" often implies slow, probably
interpreted, and somewhat "kludged". It's often
used in a negative or derogatory way. ...
|
Maybe that is so, but that is not how I meant it. I meant emulator as
in the normal term where it emulates either or both of operating
system functionality or hardware, like the Windows emulator used with
Borland's extended DOS programs or the 386 emulator in VM386.
| Quote: | ...FYI, I do use gcc for cross-development, but I'd
rather boil my head than use gcc for windows gui
|
That may be another issue. If that is an IDE comment, I routinely
develop for Windows from the command line using a text editor and make
files.
| Quote: | The standard c rtl is pretty much the native unix
programming api ...
|
Well, almost. Unix was written in C so the standard library
inherently had what was in Unix. However things change so functions
such as fread and fwrite which were not provided by Unix were provided
and read and write which were provided by Unix were also in it. Later
Unix split with some versions having fread and fwrite and others
having both sets so it's kind of a historical museum of Unix.
(Thankfully they did away with 'ps' when someone thought of naming it
'puts')
However that is the 'programming api', the compiler supplied functions
to deal with the OS. If the OS used any of function calls or
MSDOS-like interrupts, IBM-style startio and testio calls or dedicated
memory locations the compiler supplied functions remain the same. The
interface to the OS is one issue. The OS supplies another layer which
is what is needed to deal with its underlying schemes of doing things.
If the interface supplied is for a different OS then the task of
supplying is that of an emulator.
.. Ed
| Quote: | Roddy Pratt wrote in message
news:40a3fe20 (AT) newsgroups (DOT) borland.com...
|
|
|
| Back to top |
|
 |
Roddy Pratt Guest
|
Posted: Fri May 14, 2004 12:04 am Post subject: Re: What's an Emulator? |
|
|
| Quote: | I'd rather boil my head than use gcc for windows gui
|
It's a RAD issue, more than an IDE one. And life's too short to build your
own toolchains. That's why I use BCB.
| Quote: | However that is the 'programming api', the compiler supplied functions
to deal with the OS. If the OS used any of function calls or
MSDOS-like interrupts, IBM-style startio and testio calls or dedicated
memory locations the compiler supplied functions remain the same.
|
"compiler-supplied"? - not sure I get this. The rtl functions are normally
supplied from a library/dll at link/run time. While the c rtl is part of the
language spec, it's rarely something compilers have much knowledge of,
except for memcpy-style optimizations.
| Quote: | The interface to the OS is one issue. The OS supplies another layer which
is what is needed to deal with its underlying schemes of doing things.
If the interface supplied is for a different OS then the task of
supplying is that of an emulator.
Ah! (light dawns) You're saying that the c++ rt library should be considered |
part of the OS, not part of the toolchain/application/whatever??, and that
by effectively 'replacing' it with a different rtl with a different
published interface, you're now emulating the os that 'defined' that
interface?
If I've got that right, then I'd disagree - I consider the c rtl part of
the application rather than part of the OS. It all runs in my address space,
and is accessed by nothing smarter than function calls. The OS boundary is
normally trap-dispatched or similar. And by changing between two rtls, IMO
you're just changing between two different abstraction layers. No hooking of
traps or other trickery involved.
- Roddy
|
|
| Back to top |
|
 |
Chris Uzdavinis (TeamB) Guest
|
Posted: Fri May 14, 2004 1:35 am Post subject: Re: What's an Emulator? |
|
|
"Ed Mulroy [TeamB]" <dont_email_me (AT) bitbuc (DOT) ket> writes:
| Quote: | So you have concluded that emulating Linux under Windows is not
emulating? The page whose link you provided does not agree with that.
|
If you can run _native_ linux binaries--that is, programs compiled
with the intent to be run directly inside linux--under windows,
unmodified, then it's emulation.
Emulation is a run-time feature, not a compile time feature. If you
have software library that emulates an interface, it's just software,
and when it compiles it is now a 100% native application for the
environment for which it was compiled.
--
Chris (TeamB);
|
|
| Back to top |
|
 |
Chris Uzdavinis (TeamB) Guest
|
Posted: Fri May 14, 2004 1:37 am Post subject: Re: What's an Emulator? |
|
|
"Roddy Pratt" <roddy at rascular dot com> writes:
| Quote: | If I've got that right, then I'd disagree - I consider the c rtl part of
the application rather than part of the OS. It all runs in my address space,
and is accessed by nothing smarter than function calls. The OS boundary is
normally trap-dispatched or similar. And by changing between two rtls, IMO
you're just changing between two different abstraction layers. No hooking of
traps or other trickery involved.
|
Exactly!
--
Chris (TeamB);
|
|
| Back to top |
|
 |
Boian Mitov Guest
|
Posted: Fri May 14, 2004 2:09 am Post subject: Re: What's an Emulator? |
|
|
Ohhh boy ohhh boy.... Here we go again ;-)
Ed Mulroy [TeamB] wrote:
| Quote: | So you have concluded that emulating Linux under Windows is not
emulating? The page whose link you provided does not agree with that.
. Ed
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|