[fpc-pascal] fpmmap problem 64 bit linux
rainerstratmann at t-online.de
Sat Nov 21 13:31:22 CET 2020
I watched the syscalls with strace and my assumption was confirmed.
function Fpmmap( start: pointer; len: size_t; prot: cint; flags: cint; fd:cint;
offst: off_t ):pointer;
My offst value for fpmmap is $100000000.
mmap(NULL, 1920000, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_32BIT, 3, 0) = -1
Here the value is 0.
It is likely that the offst value is stripped to 32 bit before passed to the
Am Samstag, 21. November 2020, 01:15:20 CET schrieb Alexander Grotewohl via
> It would seem C handles this at compile time with a define.. mapping mmap to
> mmap64. Which would almost seem to imply you'd end up with a 32 bit binary
> that would only work on 64 bit systems. I'm not really sure how this would
> work for Pascal. You could start by looking in the file listed in the
> fpmmap docs you posted. My guess is the easiest answer is "distribute both
> 32 and 64 bit versions," but that doesn't help when you need to test the 32
> bit one..
> Alexander Grotewohl
> Alexander Grotewohl
> From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> on behalf of
> Rainer Stratmann via fpc-pascal <fpc-pascal at lists.freepascal.org> Sent:
> Friday, November 20, 2020 6:33:51 PM
> To: fpc-pascal at lists.freepascal.org <fpc-pascal at lists.freepascal.org>
> Cc: Rainer Stratmann <rainerstratmann at t-online.de>
> Subject: [fpc-pascal] fpmmap problem 64 bit linux
> A 32 bit freepascal program on a 32 bit Linux Debian system is working
> properly. It uses fpmmap for getting the adress of a kms framebuffer.
> The same 32 bit program on a 64 bit Linux Debian system *** is not working.
> When it comes to the fpmmap it gives an error:
> One of the record fields Start, length or offset is invalid.
> I figured out that it likely can only be the offset value since start and
> length are always the same.
> The offset value I got from a previous DRM function.
> On the 32 bit System this offset value is $10000000 (fits in 32 bit)
> And on the 64 bit System this offset value is $100000000 (does not fit in 32
> Can it be possible that the fpmmap function strips the offset value to 32
> bit? Is there another way to call fpmmap more directly?
> What does fpmmap exactly?
> Where can I research?
> dpkg --add-architecture i386
> apt-get update
> apt-get install libc6-i386
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal