Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

32-bit MSDOS (Announce)

posted by kerravon E-mail, Ligao, Free World North, 02.07.2021, 17:40

> We don't use msvcrt.dll anywhere, as we are not a C compiler.

You don't need to be. I followed your go32v2
link and then looked for the win32 code, and
looked at this as an example:

https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/win32/system.pp?view=markup

And saw that it called ReadProcessMemory (just
as an example). I did a search and that is a
standard Windows API.

If you can call Windows APIs (which are defined
in C, right?), then what difference does it make
whether you call CreateFile() in kernel32 or
fopen() in msvcrt?

BTW, this Pascal stuff made me realize that I
should be able to create my own cygwin1.dll
that simply calls functions in msvcrt.dll and
stubs the rest out.

> You can maybe use a mingw's LD linker, but you may lose smartlinking that
> way (and a lot of speed)

For now I don't wish to change any FP executables,
I just want to use them as-is, but I want to change
the code that is linked in to my world.exe.

Specifically I want to find out if I can make that
code call fwrite() instead of WriteFile() which I
presume it is currently calling.

Probably:

C:\devel\develop>objdump -p world.exe | grep -i write
d3c2 0 WriteFile


> > But ultimately I'd rather see just msvcrt.dll
> > showing up.
>
> I understand why you want that (since that means that the relevant C
> compiler has been turned from cygwin/mingw to use msvcrt runtime). But we
> don't use _any_ C runtime, also no own static abstraction internally.

I'm not sure I understand this. mingw produces
executables that are only dependent on msvcrt.dll,
as far as I know.

Not sure why you are referencing the C compiler
too. I'm talking about any application, not just
a C compiler that happens to be written in C.

> I don't think there is a significant technical barrier for your own port.
> For our use it is an absolute nono, since afaik msvcrt has several
> limitations (e.g. not allowing full length pathnames etc), potential
> escaping issues, requiring zero terminating (not all our strings are zero
> terminated) etc.

The Amiga etc probably doesn't have all these
things either.

> Moreover, there is zero experience with it, we always
> used the core windows api.

A "generic C90" target would target a lot more
than just msvcrt.dll.

BFN. Paul.

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 360 users online (0 registered, 360 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum