Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-02

Object Pascal & arm-linux

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

Hi,
I successfully ran some MSE-gui test-programs on my arm-board. To do this I used a patched fpc 2.2.0-fixes.
The patch involved backporting a fix from fpc-2.3.1 for TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I needed 2.2.1 because 2.3.1 breaks MSE-gui.
I still have problems concerning floating points. When I put a real-value in a component at design-time , it's not displayed OK, e.g. 1.0 is displayed as 5.29980882362664E-0315. When I put some real into it at run-time it's fine. Also 0 is displayed fine if also think that this problem breaks another component I would like to use. I would like to make certain that patch works, any suggestions how to do this ?
Enclosed a diff to show what I did to rtl/objpas/classes/reader.inc. Remember that this is on arm-linux, i386-linux is fine.

Regards,
Koenraad Lelong.

Florian Klaempfl
to Koenraad Lelong
Show quoted text 5 lines
Hi, I successfully ran some MSE-gui test-programs on my arm-board. To do this I used a patched fpc 2.2.0-fixes. The patch involved backporting a fix from fpc-2.3.1 for TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I

Which revision is this?

Show quoted text 8 lines
needed 2.2.1 because 2.3.1 breaks MSE-gui. I still have problems concerning floating points. When I put a real-value in a component at design-time , it's not displayed OK, e.g. 1.0 is displayed as 5.29980882362664E-0315. When I put some real into it at run-time it's fine. Also 0 is displayed fine if entered at design-time. I also think that this problem breaks another component I would like to use. I would like to make certain that patch works, any suggestions how to do this ?

Only default arm-linux, doubles are mixed little/big endian: the two dwords are ordered itself little endian but the relation between them is like on a big endian system, resulting in
byte 4
byte 5
byte 6
byte 7
byte 0
byte 1
byte 2
byte 3

The reader/writer stuff has to take care of this. It applies if the fpu type is fpa,fpa10 or fp11. You can simply use the define FPC_DOUBLE_HILO_SWAPPED to detect this. The reason for this is that the fpa* fpu was invented when arm was big endian only. So the fpu tells the main core to load two dword. The main core loads the two dword from memory as little endian though.

Koenraad Lelong
to Florian Klaempfl
Florian Klaempfl wrote 9 lines
Koenraad Lelong schrieb: > Hi, > I successfully ran some MSE-gui test-programs on my arm-board. To do > this I used a patched fpc 2.2.0-fixes. > The patch involved backporting a fix from fpc-2.3.1 for > TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I Which revision is this?

If you mean 2.2.1 : readme.rev says 8445 for fpc/branches/fixes_2_2 If you mean 2.3.1 : svn info fpc says Revision : 9843

> needed 2.2.1 because 2.3.1 breaks MSE-gui.

....

The reader/writer stuff has to take care of this. It applies if the fpu type is fpa,fpa10 or fp11. You can simply use the define FPC_DOUBLE_HILO_SWAPPED to detect this. The reason for this is that the

How would I do that ? I tried, see enclosed diff, with no solution. Regards,
Koenraad lelong.

Florian Klaempfl
to Koenraad Lelong
Show quoted text 18 lines
Florian Klaempfl schreef: > Koenraad Lelong schrieb: >> Hi, >> I successfully ran some MSE-gui test-programs on my arm-board. To do >> this I used a patched fpc 2.2.0-fixes. >> The patch involved backporting a fix from fpc-2.3.1 for >> TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I > Which revision is this? > If you mean 2.2.1 : readme.rev says 8445 for fpc/branches/fixes_2_2 If you mean 2.3.1 : svn info fpc says Revision : 9843 >> needed 2.2.1 because 2.3.1 breaks MSE-gui. .... > The reader/writer stuff has to take care of this. It applies if the fpu > type is fpa,fpa10 or fp11. You can simply use the define > FPC_DOUBLE_HILO_SWAPPED to detect this. The reason for this is that the How would I do that ? I tried, see enclosed diff, with no solution.

You've to check for this define and handle double appropriate when loading them.

Koenraad Lelong
to Florian Klaempfl
Florian Klaempfl wrote 22 lines
Koenraad Lelong schrieb: > Florian Klaempfl schreef: >> Koenraad Lelong schrieb: >>> Hi, >>> I successfully ran some MSE-gui test-programs on my arm-board. To do >>> this I used a patched fpc 2.2.0-fixes. >>> The patch involved backporting a fix from fpc-2.3.1 for >>> TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I >> Which revision is this? >> > If you mean 2.2.1 : readme.rev says 8445 for fpc/branches/fixes_2_2 > If you mean 2.3.1 : svn info fpc says Revision : 9843 > >>> needed 2.2.1 because 2.3.1 breaks MSE-gui. > .... >> The reader/writer stuff has to take care of this. It applies if the fpu >> type is fpa,fpa10 or fp11. You can simply use the define >> FPC_DOUBLE_HILO_SWAPPED to detect this. The reason for this is that the > How would I do that ? I tried, see enclosed diff, with no solution. You've to check for this define and handle double appropriate when loading them.

Hi,
At last I found some time to look into this problem. Martin Schreiber suggested a solution which I implemented and tested (only the reader part of it).
Enclosed is a patch for reader.inc and writer.inc. This is for fpc-2.2.2.rc2.
Hope it will be included in the final release.
Regards,
Koenraad Lelong.

Florian Klaempfl
to Koenraad Lelong
Show quoted text 27 lines
Florian Klaempfl schreef: > Koenraad Lelong schrieb: >> Florian Klaempfl schreef: >>> Koenraad Lelong schrieb: >>>> Hi, >>>> I successfully ran some MSE-gui test-programs on my arm-board. To do >>>> this I used a patched fpc 2.2.0-fixes. >>>> The patch involved backporting a fix from fpc-2.3.1 for >>>> TBinaryObjectReader : the arm processor has no (AFAIK) extended type. I >>> Which revision is this? >>> >> If you mean 2.2.1 : readme.rev says 8445 for fpc/branches/fixes_2_2 >> If you mean 2.3.1 : svn info fpc says Revision : 9843 >> >>>> needed 2.2.1 because 2.3.1 breaks MSE-gui. >> .... >>> The reader/writer stuff has to take care of this. It applies if the fpu >>> type is fpa,fpa10 or fp11. You can simply use the define >>> FPC_DOUBLE_HILO_SWAPPED to detect this. The reason for this is that the >> How would I do that ? I tried, see enclosed diff, with no solution. > You've to check for this define and handle double appropriate when > loading them. Hi, At last I found some time to look into this problem. Martin Schreiber suggested a solution which I implemented and tested (only the reader part of it).

Applied, thx.