Recent

Author Topic: FPC: Windows 98 setup fail  (Read 937 times)

zx_gamer

  • New Member
  • *
  • Posts: 10
FPC: Windows 98 setup fail
« on: May 03, 2026, 08:03:17 pm »
I tried to install FPC 3.2.2 to Windows 98 (win32) and got an error message "Update windows". Why? FPC supports even DOS.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: FPC: Windows 98 setup fail
« Reply #1 on: May 03, 2026, 08:27:51 pm »
Win9x has been formally abandoned since FPC 2.6.0, but versions up to 3.0.0 were basically hit and miss.

3.0.0 introduced unicode and that complicated win9x support, and a call for maintainers for a separate win9x port was done. There were no respondents. See e.g. https://forum.lazarus.freepascal.org/index.php/topic,30677.msg195427.html#msg195427

ZX spectrum, Amiga, go32v2 and Msdos, while older, do have people that test, maintain etc.

Ten_Mile_Hike

  • Full Member
  • ***
  • Posts: 141
Re: FPC: Windows 98 setup fail
« Reply #2 on: May 03, 2026, 10:55:33 pm »
Code: Text  [Select][+][-]
  1. I got a setup fail when installing into Temple OS... then I tried to install on GEM...still no luck!!!
When any government, or any church for that matter, undertakes to say to its subjects, This you may not read, this you
must not see, this you are forbidden to know, the end result is tyranny and oppression no matter how holy the motives.

Robert A. Heinlein

zx_gamer

  • New Member
  • *
  • Posts: 10
Re: FPC: Windows 98 setup fail
« Reply #3 on: May 04, 2026, 05:55:12 pm »
Win9x has been formally abandoned since FPC 2.6.0, but versions up to 3.0.0 were basically hit and miss.

3.0.0 introduced unicode and that complicated win9x support, and a call for maintainers for a separate win9x port was done. There were no respondents. See e.g. https://forum.lazarus.freepascal.org/index.php/topic,30677.msg195427.html#msg195427

ZX spectrum, Amiga, go32v2 and Msdos, while older, do have people that test, maintain etc.

Okay, can I try maintain FPC for Windows 9x? What should I do?

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: FPC: Windows 98 setup fail
« Reply #4 on: May 05, 2026, 01:39:41 pm »
You should simply use an older version of FPC. Not fight donkeys.
objects are fine constructs. You can even initialize them with constructors.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: FPC: Windows 98 setup fail
« Reply #5 on: May 05, 2026, 02:29:54 pm »
Well, there is the question if it is worth the effort, but that goes for all vintage ports, so let's skip that for now. Except maybe that I hope that it is clear that it is a big job, and a long term commitment to develop a new target.  (win9x is a new target for the current compiler/codebase). This is not an one-off week work or so.

Some hints:

  • The win9x port shouldn't hinder the win32/win64 port in anyway, so mostly is a wholly separated target with duplicates of every source.  But for your tests you can use the win32 target till the port is considered viable and well enough to define a target in the compiler etc
  • Consider which versions you are going to support (from win 3.11+win32s up to ME)
  • Consider what to do with unicode (kernelex, MSLU). Keep in mind that the RTL is fully unicode nowadays 
  • Will it be native or crosscompile only?  fpmake is a threading application, and going crosscompile only means you won't have to fix fpmake for win9x. It also avoids problems in win9x with available memory.
  • There might be work in the internal linker/assembler. I don't know about EXE format differences that are win9x specific and might be removed later on
  • There is also the question where to get information from. Microsoft removed a lot of win9x info from MSDN. Probably start collecting Petzolds that apply to win9x
  • The starting point would be to get the current (trunk) win32 RTL, and a copy of the win32 RTL from when win9x was still functional, and simply start hacking the current copy while looking at the old copy till it works.
« Last Edit: May 05, 2026, 11:34:16 pm by marcov »

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: FPC: Windows 98 setup fail
« Reply #6 on: May 05, 2026, 03:03:23 pm »
I think the DOS port also basically supports any 16 bit Windows, like WIN98 so you may start there. Maybe just copy out the Windows stuff from an old release? That is because older Windows ran on top off DOS.
You may need an emulator for that, like dosbox.
« Last Edit: May 05, 2026, 03:07:41 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

zx_gamer

  • New Member
  • *
  • Posts: 10
Re: FPC: Windows 98 setup fail
« Reply #7 on: May 05, 2026, 03:49:43 pm »
I think the DOS port also basically supports any 16 bit Windows, like WIN98 so you may start there. Maybe just copy out the Windows stuff from an old release? That is because older Windows ran on top off DOS.
You may need an emulator for that, like dosbox.

Windows 98 is Win32 system only. Windows 3.x MAY work on 16-bit systems without multitasking (only focused window works, other freezes).

zx_gamer

  • New Member
  • *
  • Posts: 10
Re: FPC: Windows 98 setup fail
« Reply #8 on: May 05, 2026, 03:58:33 pm »
Well, there is the question if it is worth the effort, but that goes for all vintage ports, so let's skip that for now. Except maybe that I hope that it is clear that it is a big job, and a long term commitment to develop a new target.  (win9x is a new target for the current compiler/codebase). This is not an one-off week work or so.

Some hints:

  • The win9x port shouldn't hinder the win32/win64 port in anyway, so mostly is a wholly separated target with duplicates of every source.  But for your tests you can use the win32 target till the port is considered viable and well enough to define a target in the compiler etc
  • Consider which versions you are going to support (from win 3.11+win32s up to ME)
  • Consider what to do with unicode (kernelex, MSLU). Keep in mind that the RTL is fully unicode nowadays 
  • Will it be native or crosscompile only?  fpmake is a threading application, and going crosscompile only means you won't have to fix fpmake for win9x
  • There might be work in the internal linker/assembler. I don't know about EXE format differences that are win9x specific and might be removed later on
  • There is also the question where to get information from. Microsoft removed a lot of win9x info from MSDN. Probably start collecting Petzolds that apply to win9x
  • The starting point would be to get the current (trunk) win32 RTL, and a copy of the win32 RTL from when win9x was still functional, and simply start hacking the current copy while looking at the old copy till it works.

I guess, application, which uses only WinAPI have same EXE file with Windows XP. The diffirenece is which functions are available in WinAPI in Windows 98.

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: FPC: Windows 98 setup fail
« Reply #9 on: May 05, 2026, 04:06:59 pm »
Those are just the stubs for 16 bit support.
Marco is right, and I am right too:
You can either rewrite for the stubs (win98 is 16 bit) or use the DOS port, which already works as a cross compiler that executes in an emulator like dosbox. Performance is not an issue, if anything running under dosbox is faster....(I run win95 on Raspberry Pi's on dosbox..., since RPi 1.)

Anything else requires porting the application to 32 bit. Not the compiler.
« Last Edit: May 05, 2026, 04:09:36 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: FPC: Windows 98 setup fail
« Reply #10 on: May 05, 2026, 05:37:44 pm »
(just let Thaddy waffle. He seems to likes the sound of his own uh, writing, so much that he reacts to everything, even if he doesn't know or remember much about it. He doesn't even seem to remember what OSes are 16-bit or not. As said, even Win3.1xx can be 32-bit (win 386 extended kernel mode, available since at least Windows 3.0, and support for 32-bit win32s apps since WFW 3.11 or so, and btw Thaddy, win9x _IS_ 32-bit)

I guess, application, which uses only WinAPI have same EXE file with Windows XP. The diffirenece is which functions are available in WinAPI in Windows 98.

This is only true for non unicode. That change, from using windows -A to -W API calls was one of the reasons for the debate about what to do with Windows 9x that ultimately lead to its abandonment.

Asking Windows developers for modern versions to make win9x alternative paths for each and every call was not considered feasible, specially because of a lot of win9x knowledge disappeared from the web. So it would take more than a simple google to find the authoritative MSDN page for a call.  This is the main reason for splitting out win9x as separate target.

Note that even in the old RTL there were workarounds with special code paths for Win9x, like getting specific directories (my documents, pictures, home etc), and some unicode/codepage related workarounds. Those were a pain, even back then.
« Last Edit: May 05, 2026, 06:06:31 pm by marcov »

MarkMLl

  • Hero Member
  • *****
  • Posts: 8572
Re: FPC: Windows 98 setup fail
« Reply #11 on: May 05, 2026, 06:10:08 pm »
While I'm cautious dispensing second- or third-hand experience, I was told that the chap who implemented Win-16 for the JPI-TopSpeed compiler/IDE found it a most unpleasant experience because the API made what appeared to be random selection of which segment register to use for any parameter. In addition, when he got into the GDI he had to contend with "blitting" code being built on the stack and then executed in-situ.

I admit to being a bit of a fan of what is now called retrocomputing, but find myself wondering whether Win-16 would be best left alone.

I also find myself wondering whether a 32-bit Windows-98 compatible version of the compiler and RTL could be bootstrapped via something like Sanos. That was basically an experimental 32-bit "DOS" using standard .exe files etc., I looked briefly at the standard Win-32 FPC on it but there was already (in something like the 2.7 era) too much reliance on the Unicode API for it to be directly compatible. http://www.jbox.dk/sanos/index.htm

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: FPC: Windows 98 setup fail
« Reply #12 on: May 05, 2026, 06:24:33 pm »
While I'm cautious dispensing second- or third-hand experience, I was told that the chap who implemented Win-16 for the JPI-TopSpeed compiler/IDE found it a most unpleasant experience because the API made what appeared to be random selection of which segment register to use for any parameter. In addition, when he got into the GDI he had to contend with "blitting" code being built on the stack and then executed in-situ.

Luckily, win9x is mostly using the win32 API. The win16 port is something else.

Quote
I also find myself wondering whether a 32-bit Windows-98 compatible version of the compiler and RTL could be bootstrapped via something like Sanos

I don't see any relevance of Sanos as I try to read and get the gist of that site. So you will have to do a better job of explaining that.  :)

In practice you could crosscompile-and-bootstrap a new win9x FPC target from any supported FPC target, so I don't see why a 3rd party product would be needed in the first place. I assume you are just namedropping, s pecially since this one advocates POSIX and standard C library support, neither of which FPC uses on (any) Windows, so its prime features seem to be irrelevant.

Keep in mind that x86 (and _64) windows and dos feature the build in assembler and linker, so if you manage to create the win9x startup code in Pascal (like the current Win32 WinNT port), you don't need any external tools to crosscompile.
« Last Edit: May 05, 2026, 06:41:15 pm by marcov »

zx_gamer

  • New Member
  • *
  • Posts: 10
Re: FPC: Windows 98 setup fail
« Reply #13 on: May 05, 2026, 08:54:52 pm »
I don't get why Unicode is a problem.

Obviously, machine code for i386 platform (and EXE file format is the same).

Runtime library has many functions, which know nothing about Unicode and WinAPI (sin, cos, log, abs, ...)

Some functions are WinAPI wrappers (sockets) or use WinAPI in implementation low-level (WriteLn, ReadLn, ...)

That looks like high-portable part of RTL (just copy implementation).

About Unicode. I guess strings should support Unicode (cause UTF-8 have no same character length) and functions like Assign.

Because of Windows 98 use "local" single byte encoding (ASCII, Windows-****), I see two ways: set single byte only encoding for Windows 9x or use UTF-8 implementation, but before system call (kernel32.dll call) convert UTF-8 string into "local" single byte string.

What if try to modernize RTL (Windows 9x) epoch FPC 2.x to modern RTL API?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: FPC: Windows 98 setup fail
« Reply #14 on: May 05, 2026, 09:09:19 pm »
I don't get why Unicode is a problem.

Obviously, machine code for i386 platform (and EXE file format is the same).

The rough outline of the EXE format is the same. there are possible differences in details. Pascaldragon might know more about that than me.

Quote
Runtime library has many functions, which know nothing about Unicode and WinAPI (sin, cos, log, abs, ...)

True. But those (sin,cos,log,abs) are mostly only CPU dependent, not OS dependent, so I didn't count them as "special" anyway. 

But anything that communicates a string to an OS call is affected by unicode. Open file, findfirst, but also calls that get parameters, environment strings and special directories.

Quote
Some functions are WinAPI wrappers (sockets) or use WinAPI in implementation low-level (WriteLn, ReadLn, ...)

Sockets are a good example. Not all win9x targets support winsock2, which is the corner stone of most Windows networking. Only very late (win ME) and with all updates afaik do.

Quote
That looks like high-portable part of RTL (just copy implementation).

About Unicode. I guess strings should support Unicode (cause UTF-8 have no same character length) and functions like Assign.

In Windows versions before 2019-05 Windows 10, unicode means UTF16 and thus -W API calls that win9x doesn't have. The usual forum parrots point to the kernelex and MSLU enhancements to make such calls work on win9x, but I don't know of  no practical experiences of such avenues. It is just a gentle remind for a future win9x maintainer to research them, as they could save quite some time.

Quote
Because of Windows 98 use "local" single byte encoding (ASCII, Windows-****),

Don't forget the console uses OEM encoding.

Quote
I see two ways: set single byte only encoding for Windows 9x or use UTF-8 implementation, but before system call (kernel32.dll call) convert UTF-8 string into "local" single byte string.

What if try to modernize RTL (Windows 9x) epoch FPC 2.x to modern RTL API?

You are free to try any avenue you want. As long as you keep it separate from regular (NT5+ aka w2k+) windows. That is a hard request. No sharing, period. Copy existing (NT) code if it helps you forward, but then maintain it in isolation from the mainstream Windows port.
« Last Edit: May 05, 2026, 09:21:24 pm by marcov »

 

TinyPortal © 2005-2018