• Print

Author Topic: 'exe files produced by QB64 do work in Windows 98' is a lie!!!  (Read 608 times)

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #30 on: January 10, 2013, 12:58:03 AM »
 :)

Quote
I'm not sure if its possible to get QB64 v0.954 to work too.

I would think so. You can try hacking libstdc++-6.dll in the same way, to change the two occurrences of "msvcrt.dll" to "zsvcrt.dll". (Hack the executable as well, so that they both use the same CRT library.)
If, instead, you don't want it to use libstdc++-6.dll, you might try adding:
-static-libgcc -static-libstdc++
to makeline.txt. I'm haven't tested it on 0.954, but that is what 0.960 is doing. In that case, you would still need to hack the executable.

Quote
it seems to be draining every single CPU cycle

Mennonite said something also about the GL version using more CPU...

The SDL version, and I would guess the GL version, uses full CPU at that "Press any key to continue..." with the END statement. You might try a SLEEP followed by SYSTEM instead...

Regards,
Michael

P.S. I'm a little surprised at how easy this was. QB64 GL seems to be using only 2 functions that aren't available on 98SE, specifically GetConsoleProcessList, and GetDefaultPrinter...

I would say that if anyone is going to be serious about developing for 98SE, that we should look into that mingw spec file option, rather than using the "zsvcrt" hack...
« Last Edit: January 10, 2013, 01:06:05 AM by mcalkins »
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

mn64

  • Full Member
  • ***
  • Posts: 184
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #31 on: January 10, 2013, 01:35:07 AM »
Quote from: mcalkins on January 10, 2013, 12:58:03 AM
Mennonite said something also about the GL version using more CPU...

actually i was referring to the ide. i haven't noticed the press any key thing yet.

my theory is that since an inkey$ loop with _limit doesn't hog the cpu, even in the gl version, that the gl ide can be made to behave also (perhaps by using limit in the input loop.)

then again, i was just trying to give it a push. i'm sure they'll figure that out (or figure out the real problem) eventually.

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #32 on: January 10, 2013, 10:34:30 PM »
Quote from: mcalkins on January 10, 2013, 12:58:03 AM
:)

Quote
I'm not sure if its possible to get QB64 v0.954 to work too.

I would think so. You can try hacking libstdc++-6.dll in the same way, to change the two occurrences of "msvcrt.dll" to "zsvcrt.dll". (Hack the executable as well, so that they both use the same CRT library.)
If, instead, you don't want it to use libstdc++-6.dll, you might try adding:
-static-libgcc -static-libstdc++
to makeline.txt. I'm haven't tested it on 0.954, but that is what 0.960 is doing. In that case, you would still need to hack the executable.

Quote
it seems to be draining every single CPU cycle

Mennonite said something also about the GL version using more CPU...

The SDL version, and I would guess the GL version, uses full CPU at that "Press any key to continue..." with the END statement. You might try a SLEEP followed by SYSTEM instead...

Regards,
Michael

P.S. I'm a little surprised at how easy this was. QB64 GL seems to be using only 2 functions that aren't available on 98SE, specifically GetConsoleProcessList, and GetDefaultPrinter...

I would say that if anyone is going to be serious about developing for 98SE, that we should look into that mingw spec file option, rather than using the "zsvcrt" hack...

I've tried it and all I got is a Invalid Page fault:
Code: [Select]
UNTITLED caused an invalid page fault in
module UNTITLED.EXE at 0167:0040134d.
Registers:
EAX=00000001 CS=0167 EIP=0040134d EFLGS=00010202
EBX=00000000 SS=016f ESP=00d7fd80 EBP=00d7fe38
ECX=00000000 DS=016f ESI=bff92d08 FS=12ef
EDX=00000001 ES=016f EDI=00d7fe20 GS=0000
Bytes at CS:EIP:
a3 00 c0 47 00 8b 15 04 20 49 00 31 db 8d 04 95
Stack dump:
7c360000 0047d000 00000000 0000000a
cccccccc cccccccc cccccccc cccccccc
cccccccc cccccccc cccccccc cccccccc
00100007 000a003a 000a0244 00d7ff78

Strangely, I can replace the msvcrt.dll file with msvcr70.dll in the WINDOWS\SYSTEM directory with no problem so I don't need to hack the EXEs/DLLs anymore but I still get a similar page fault error (the page fault I posted here is the error I get when using this method).
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #33 on: January 11, 2013, 01:54:01 AM »
What exactly is that from? I presume QB64 0.954 with the upgraded mingw? Did you change anything else?

The instruction was:
A300C04700        mov [0x47c000],eax
within the ___tmainCRTStartup function.

I believe that it is trying to write to the first dword in the .data section. This obviously should not cause an access violation.

Presumably, similar startup code succeeded with your 0.960 test... I'm puzzled.

So, the modified 0.960 works, but the modified 0.954 crashes as indicated? Had you upgraded the mingw, and if so, to which version?

Quote
I can replace the msvcrt.dll file with msvcr70.dll in the WINDOWS\SYSTEM directory with no problem so I don't need to hack the EXEs/DLLs anymore

I had thought about suggesting that. It could hypothetically mess up other programs that expect version 6.

Regards,
Michael
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #34 on: January 11, 2013, 03:54:36 AM »
I upgraded minigw to build 20120525...I'm not sure about what's the proper term for that because I don't see any version numbers other than the build date.

The IPF error is taken from when I replaced msvcrt.dll with msvcr70.dll in the WINDOWS\SYSTEM directory which kinda works and I don't have to hack the EXEs/DLLs. I still get a similar error when I hack the EXEs/DLLs to use zsvcrt.dll (a renamed msvcr70.dll) instead...I'll get the IPF error with the zsvcrt.dll method tomorrow if it helps.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

Jobert14

  • Full Member
  • ***
  • Posts: 232
  • BAHHH!!!
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #35 on: January 12, 2013, 12:31:43 AM »
The stop message I get when I hack the EXEs\DLLs to use msvcr70.dll is exactly the same as msvcr70.dll as msvcrt.dll in the WINDOWS\SYSTEM directory method...I'm not really sure what to do next with this.

Code: [Select]
UNTITLED caused an invalid page fault in
module UNTITLED.EXE at 0167:0040134d.
Registers:
EAX=00000001 CS=0167 EIP=0040134d EFLGS=00010202
EBX=00000000 SS=016f ESP=00d7fd80 EBP=00d7fe38
ECX=00000000 DS=016f ESI=bff92d08 FS=2fc7
EDX=00000001 ES=016f EDI=00d7fe20 GS=0000
Bytes at CS:EIP:
a3 00 c0 47 00 8b 15 04 20 49 00 31 db 8d 04 95
Stack dump:
78000000 0047d000 00000000 00000012
cccccccc cccccccc cccccccc cccccccc
cccccccc cccccccc cccccccc cccccccc
00110007 00120034 001201b8 00d7ff78
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

Klangaroo

  • Full Member
  • ***
  • Posts: 202
  • Video Game Dad
    • ManFightDragon Indie Dev Blog
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #36 on: January 12, 2013, 03:13:01 AM »
Why would you need QB64 for '98? You can just use PDS or QuickBASIC.
I make video games over at Man Fight Dragon and I have Twitter so do whatever really.

HACKER

  • Limited Member
  • Hero Member
  • *
  • Posts: 761
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #37 on: January 12, 2013, 04:40:54 AM »
Because He Want's QB64 for '98?


H.

Klangaroo

  • Full Member
  • ***
  • Posts: 202
  • Video Game Dad
    • ManFightDragon Indie Dev Blog
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #38 on: January 12, 2013, 04:48:07 AM »
That's not how you spell "wants", and I was asking out of curiosity, not to get a random 3rd party smart-arse response.
I make video games over at Man Fight Dragon and I have Twitter so do whatever really.

HACKER

  • Limited Member
  • Hero Member
  • *
  • Posts: 761
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #39 on: January 12, 2013, 04:58:04 AM »
You Just Have!!


H.

mcalkins

  • Hero Member
  • *****
  • Posts: 1269
    • qbasicmichael.com
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #40 on: January 12, 2013, 07:48:55 PM »
If you're up for another experiment, you might try it with QB64 0.954, but without the upgraded mingw... (You'll still need to comment out GetConsoleProcessList and GetDefaultPrinter, but ____lc_codepage_func and _fstat64 should be taken care of by using the numbered msvcr##.dll.)

I believe that the mingw that you upgraded to is the same version used by 0.960. It puzzles me that the CRT startup code crashes for the 0.954 program, but the identical (except for memory addresses) CRT startup code for 0.960 does not crash.

It should not crash. It is accessing the start of the .data section. I would be very interested if anyone could explain why it is crashing.  ???

This makes me wonder if there is some incompatibility or something that is preventing the Windows image loader from loading the .data section to the correct location. The .EXE should not contain relocation information. It should not be possible to rebase any of the sections in the .EXE. If the image loader couldn't load it properly, I would think that it should say so, rather than executing a wrongly loaded program.

Note that the .text section for a 0.954 program is smaller than for the same program under 0.960, so the .data section starts at a lower address.

Perhaps something in the CRT code is decommitting or changing the protection of the .data section? I would consider it highly unlikely.

Can you execute gdb.exe (from internal\c\bin)? (I can't on my Pentium MMX, because of illegal instructions.)
If so, try starting it with:

gdb hello.exe

and then, try:

break *0x40134d
run
x 0x47c000

It should show the memory at 0x47c000. It should show:
0x47c000 <untitled!SDL_Delay+3816>:     0x0000000a
It should not show: "Cannot access memory at address"

If it does show 0xa at that address, then the .data section was loaded properly, but there must be something wrong with the page protection.

One possibility might be to use some other compiler. Perhaps different versions of mingw, perhaps plain mingw (not the mingw-w32 fork), perhaps the old version that came with Dev-C++. Visual C++ Express 2005 RTM should work for targetting 98, but Microsoft doesn't seem to have it available for download anymore. I wonder if old versions of the Platform SDK come with a 32 bit compiler? ( http://en.wikipedia.org/wiki/Microsoft_Windows_SDK#Versions - the two that are linked to on the msdn forum posts should work for 98, but I don't know if they come with a 32 bit compiler, and I'm not in the mood for downloading them to check.) I'm not sure what kind of problems you will run into in getting it to use the header files and libraries.

Regards,
Michael
« Last Edit: January 12, 2013, 11:04:29 PM by mcalkins »
The QBASIC Forum Community: http://www.network54.com/index/10167 Includes off-topic subforums.
QB64 Off-topic subforum: http://qb64offtopic.freeforums.org/

Omega

  • Sr. Member
  • ****
  • Posts: 377
    • Recall site..
    • Email
Re: 'exe files produced by QB64 do work in Windows 98' is a lie!!!
« Reply #41 on: January 12, 2013, 10:56:08 PM »
Hey guys... one question.


Who in their right mind would run win98???

Unless they have a pc from 20 years ago


I really don't see the need for win 98 compatability.

  • Print