Re: Why the call instruction points 2 bytes before to the real start sub-routine ?



Diego Cueva <dcueva@xxxxxxxxx> wrote:

> com file not are my final objective. My Objective is creating a small
> operating system to educational purposes, and I need compile C programs
> with GCC that can execute in booting time.

In that case, .com files are not just not your final goal, they're not
even likely to be particularly useful as a stepping stone getting there.

Code compiled by the DJGPP version of GCC strictly assumes a DPMI-like
environment. You'ld have to recreate basically all of a DPMI server,
and large parts of DOS, before this code will run reliably. To get an
idea of what that means, have a good look at the CWSDPMI sources.

It might end up being easier to embed FreeDOS, CWSDPMI and your
program into a single binary image, instead.

> To this moment I have a IPL program with a group small routines in
> assemble compiled/linked with "as/ld". This is working fine.

Working fine in what kind of environment? Called from DOS?

> But link that with C compiled code is the WALL to climb now.

Exactly. Wherein "WALL" is not just some bedroom wall or something
--- it's more like the Eiger North side.

--
Hans-Bernhard Broeker (broeker@xxxxxxxxxxxxxxxxxxxxx)
Even if all the snow were burnt, ashes would remain.
.



Relevant Pages

  • Re: GdMs DOS 3d engine in Ada
    ... compile on. ... anybody can get the latest DOS 3D engine here: ... low level things like keyboard & sound drivers, data streaming, ... Linux to DJGPP cross-compiler and run into trouble with Ada. ...
    (comp.os.msdos.djgpp)
  • Re: need to be able to know basic MASM ONLY
    ... The reason Dirk's code looks "different" may be that it's for dos. ... START: mov ax, DATEN ... trying to compile his first program, after that I abandoned it all. ... VS with Nasm (hmmm, ...
    (comp.lang.asm.x86)
  • Re: Compiling under cygwin: win/tty/termcap.c
    ... You're obviously doing a dos compile ... The dos version used DJGPP ... I'm pretty sure Cygwin is ... only used for the gui of nethack. ...
    (rec.games.roguelike.nethack)
  • Re: What would it take to port Mozilla to DOS?
    ... To get glibc to compile, ... environment with POSIX is needed. ... you think you see anything non-DOS if you were compiling and running Linux ... Remember the mid-90's GNU-ish DOS? ...
    (comp.os.msdos.programmer)
  • Re: Finally upgrading to Clipper 5.3 from S87
    ... I compile and link from a dos window. ... that I wrote a long time ago, pre windows, that I still use today. ... As to the patches, I have downloaded patches 5.3A and 5.3B. ...
    (comp.lang.clipper)