FPC 3.2.2 OS/2 RTL Tests lazarus / 68-Other OS ---------------------------------------------------------------------- ghr · 2021-11-01 18:21 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: MemAvailMaxAvailHeaporgHeapendso 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.. ---------------------------------------------------------------------- PascalDragon · 2021-11-02 12:40 Best to report them on GitLab with patches or a merge request. ---------------------------------------------------------------------- ghr · 2022-12-30 20:31 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 · 2022-12-31 11:55 Quote from: ghr on December 30, 2022, 09:31:25 pmDone 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 · 2026-09-04 10:00 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 · 2026-09-04 10:19 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 · 2026-09-04 10:58 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 · 2026-09-04 22:14 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.