Author Topic: FPC 3.2.2 OS/2 RTL Tests  (Read 9883 times)

ghr

  • New Member
  • *
  • Posts: 16
FPC 3.2.2 OS/2 RTL Tests
« on: November 01, 2021, 07:21:41 pm »
Went over the tests under pp\source\rtl\os2\tests... Here are my findings, anyone interested ? Could fix most of them (but not everything is very useful IMHO).

basicpm.pas: insert {$APPTYPE GUI}

calc_e.pas: FAILS a.o. on "fixed" => change 1st fixed into real, 2nd one into nothing and OK.

heapsize.pas: breaks on ___SYSCAL and _A and gives warnings
remove the _ in front of A so _A > A
only syscall errors left and 2 warnings
change movl: movl: 2 times: %ax > %eax }; this removes two warnings
Finally: after finding ports.pas in rtl os2: can add syscall as follows:
procedure syscall; external name '___SYSCALL';
and in asm:
call syscall
now it runs again with different numbers as output:
327680
655360

helloos2.pas: Fix: comment out all lines with:
  • MemAvail
  • MaxAvail
  • Heaporg
  • Heapend
so uncommenting these makes the program work....

modeinfo.pas: I only need this to get started: note the T after var mode:
program modeinfo;
uses viocalls;
var mode:Tviomodeinfo;
begin
mode.cb:=sizeof(mode);
....etc...

o2rtlb1.pas: OK but don’t use unit crt!!!! If you do: program hangs on readln(number)

pmdemo1.pp: Issues; insert {$APPTYPE GUI}
pmdemo1.rc file: add: C-comment end delimiter at end
next:
rc -r pmdemo1.rc
fpc pmdemo1
Note that I had to use rc, not wrc, a bit strange.

Now with zip file attached..
« Last Edit: November 02, 2021, 09:27:50 am by ghr »

PascalDragon

  • Hero Member
  • *****
  • Posts: 6454
  • Compiler Developer
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #1 on: November 02, 2021, 01:40:46 pm »
Best to report them on GitLab with patches or a merge request.

ghr

  • New Member
  • *
  • Posts: 16
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #2 on: December 30, 2022, 09:31:25 pm »
Done too. The way they are now does not do any right to what fpc can do under OS/2. I ported Petzold's code (PM programming 1994) to fpc under OS/2 - all up & running, in spite of the messed up record sizes. Was a fun project :)

Tomas Hajny

  • Moderator
  • Jr. Member
  • *****
  • Posts: 52
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #3 on: December 31, 2022, 12:55:54 pm »
Done too. The way they are now does not do any right to what fpc can do under OS/2. I ported Petzold's code (PM programming 1994) to fpc under OS/2 - all up & running, in spite of the messed up record sizes. Was a fun project :)

Thanks for pointing out those bugs in demo programs, I'll fix them as suggested. Admittedly, these test programs haven't been checked for something like 2 decades. ;-) Obviously, basicpm.pas and pmdemo1.pp were compilable with the -WG command line option, but you're right that specifying it directly in the source code is more appropriate.

You'll be more than welcome to fix any other issues and/or help with lifting some of the existing limitations of the OS/2 port of FPC. I don't follow this forum actively, communication via the FPC mailing lists is much preferred for me.

ghr

  • New Member
  • *
  • Posts: 16
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #4 on: September 04, 2026, 12:00:49 pm »
Rechecked them using 3.4.2 rc2 source and compiler. Seems that all fixes I proposed earlier are still valid (but not in the source...).

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 13051
  • FPC developer.
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #5 on: September 04, 2026, 12:19:33 pm »
List of unmerged revisions in rtl/os2:  http://www.stack.nl/~marcov/mergelogs32/os2.html 

later: Ah, I see Tomas already answer in another thread.

Tomas Hajny

  • Moderator
  • Jr. Member
  • *****
  • Posts: 52
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #6 on: September 04, 2026, 12:58:59 pm »
Unfortunately, your suggestions for updates and fixes to the tests got buried here in the forum :-( (unlike your bug report about inconsistencies in the pmwin unit structures, which triggered a fix, although not merged to the fixes branch yet - but as mentioned in the other post, I'll make sure this is merged before the final 3.2.4). I need to have a look at the provided suggestions again and check what to do with them - sorry!

Tomas Hajny

  • Moderator
  • Jr. Member
  • *****
  • Posts: 52
Re: FPC 3.2.2 OS/2 RTL Tests
« Reply #7 on: September 05, 2026, 12:14:39 am »
I applied the relevant part of fixes from the provided zip file to the main branch now. In particular, I updated basicpm.pas and helloos2.pas. I removed heapsize.pas because it was created for the original EMX based RTL (as used for target EMX now) and was completely irelevant for the current OS2 target. The remaining files in the zip file were either not different to the current main branch sources (modeinfo.pas, pmdemo*), or there is just a cosmetic modification making no real difference (calc_e.pas). I'll try to get the changes included in 3.2.4, but it isn't really critical considering the nature of these files.

 

TinyPortal © 2005-2018