Recent

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

ghr

  • New member
  • *
  • Posts: 9
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: 5446
  • 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: 9
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
  • New Member
  • *****
  • Posts: 45
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.

 

TinyPortal © 2005-2018