freebasic on win32s

DOS specific questions.
Mysoft
Posts: 778
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: freebasic on win32s

Postby Mysoft » Oct 13, 2019 21:08

srvaldez wrote:@Mysoft
looks really nice, what screen resolution are you using on DOSBox?


1024x768... i also made a "mouse program" to have a seamless mouse on win3.11, and the win3.11 on dosbox have winsock using Trumpet TCP, because the drivers for native MS Network or MS Lanman does not work on dosbox, and so Trumpet TCP can use the regular packet driver to implement TCP on windows, so its great (despite probabily less efficient)
jj2007
Posts: 1523
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: freebasic on win32s

Postby jj2007 » Oct 13, 2019 21:46

Hi MySoft, that's a great project! I am still running a big 16-bit application that uses lots of 32-bit stuff through thunking, it runs fine in XP but I doubt it would run in a Win 3.1 plus Win32s environment. May I ask what is your motivation to do this? Even finding the hardware must be non-trivial...
Mysoft
Posts: 778
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: freebasic on win32s

Postby Mysoft » Oct 13, 2019 22:13

jj2007 wrote:Hi MySoft, that's a great project! I am still running a big 16-bit application that uses lots of 32-bit stuff through thunking, it runs fine in XP but I doubt it would run in a Win 3.1 plus Win32s environment. May I ask what is your motivation to do this? Even finding the hardware must be non-trivial...


heh most likely it was design for win95/98 but using 16bit stuff because it was what was there already... but since its 16bit... it could work fine on win3.11 beause even on win95 the preemptive of 16bit is the same.. so it will all depend on the 32bit thunk :), but really win32s is more complete than one can think because win32s is not based on win95/98 but on NT!, so even some of the W api is there!
Mysoft
Posts: 778
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: freebasic on win32s

Postby Mysoft » Oct 13, 2019 22:23

and talking about win32s compatibility... its somewhat "harder" to write for it with modern tools, because theres no debuggers that can debug properly... so the only way to debug would be use MSVC 4? that support win32s and then it can be REMOTELY debugged to a NT 3.52 machine... and it would be huge setback have to use that instead of waaay faster mingw...

so for that reason i made a crash handler using SEH, that reads STABS (later i may make it understand DWARF as well), accompanied from the disasm that i made (I could had used other libs... but they were bigger so i decided that was better to make my own), and now not only i solved pretty much the debugging problem as well i got a nice crash handler that works fine even on modern coding (the first screenshot is the current state of it... altough there will be some improvements)

but theres one slight problem with win32s is that theres many of functions there, that are not implement... but they EXIST as dummy... for example theres no threads but theres CreateThread (that always return NULL) but most programs dont actually do thread checks... so they end just not running a thread... and sometimes not even crash... other programs are buggy on win32 but the bugs are hidden either with exception handlers or by coincidence but so... on win32s a 32bit program is running on the same level as the 16bit supervisor... so it can acess EVERYTHING and likewise it can corrupt everything that is not CODE :P

and third win16/32 when a bad parameter/flag is called on a function it exposes that automatically to trough OutputDebugMessage(), so i found "bugs" on my win32 program because of that... (on the style of double free of winapi resources, or using window that was already destroyed), those would just silently fail on win32 unless you check the return (which i dont for those 'obvious' stuff), so such debugging worked very nice!

but unfortunately when a function is not implemented they forgot to put the messages on OutputDebugMessage() i have to manually check the code (when for example compiling a win32 library to work on win32s)

but overall it have been a very pleasant surprise how much win32s is helping me as a programmer :)
marcov
Posts: 2971
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: freebasic on win32s

Postby marcov » Oct 14, 2019 11:53

Mysoft wrote:
marcov wrote:The point is that you can't do things like you normally do, and what internet recommends. This complicates things for people mostly working on newer windows. Just like any Windows code after 2000-2005 will probably call -W functions a lot.
Things like that are basically behind the advise to not add to the win32 target, but rather split it in (multiple?) old and new.


good... because you shouldnt simple do what internet recommends without reasoning first... the last thing you want is to code like a genius for no good reason...


Exactly my sentiment. Why do a lot of navigating to keep win32s .. win10 in one target? Just separate them into separate targets, and retro and more forward developers are not constantly at loggerheads and /or calling each other names like "capitalist slave" (or "caveman" :-)

And no, doing manual hacks simply are not an option. Retro options should NOT dictate mainstream Windows devels how to code.

This is also absolutely not anti-retro, it is simply about managing retro within a not-retro-only project, giving it a proper place. FPC nowadays supports 16-bit dos, 32-bit dos, win16, win32, win64, nativent and wince (IOW every MS target but win32s :-)

And even retro non-dos targets like various Amiga targets as well as embedded 8-bitters like Arduino.
Last edited by marcov on Oct 18, 2019 19:37, edited 1 time in total.
Mysoft
Posts: 778
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: freebasic on win32s

Postby Mysoft » Oct 14, 2019 14:56

ok then :) well my point was that win32s programs works fine even on win10, theres no attempt to unite anything... and i was point out some factors that make win32s superior in terms of teaching good practices even to win32 programmers, and that most of the commercial programs are easily doable even with win32s without little to no effort (as long the person is not from a lazy background :P)

and after all i implemented win32s a suffix, so yeah its a different target specially because libraries need to be recompiled, because msvcrt.dll does not exist and even static crt would fail to initialize there... so i have to use -ffreestanding because the mingw with crtdll (they exist) but they are very old... so i wanted to avoid that as i wanted to avoid having to use an old compiler

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 0 guests