Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Brad Campbell schrieb: Why not try attaching your test code that is failing so we can help you get it working? Done. My fault was the following declaration: var inbuffer: array of char; This is a better declaration: var inbuffer: array[0..10] of char; Now I got my code working. Hidden poi

Re: [fpc-pascal] x86.pp and oldlinux.pp

2009-11-02 Thread Holger Bruns
Jonas Maebe schrieb: Holger Bruns wrote on Tue, 03 Nov 2009: I decided to copy all the necessary files for x86.pp and oldlinux.pp into one directory for compiling these two units. This compilation failed due to syntax errors. A bunch of warnings also appeared. I post only the syntax error mes

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Brad Campbell
Holger Bruns wrote: The real sad thing is, that one cannot produce software for Linux, based on the restricted free pascal compiler. I am really disappointed. That's an interesting assertion. I use serial.pp on i386 Linux, x86_64 Linux, PPC OSX & Intel OSX flawlessly. I use synaser on Win32.

Re: [fpc-pascal] x86.pp and oldlinux.pp

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Tue, 03 Nov 2009: I decided to copy all the necessary files for x86.pp and oldlinux.pp into one directory for compiling these two units. This compilation failed due to syntax errors. A bunch of warnings also appeared. I post only the syntax error messages: You appear

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Marc Santhoff schrieb: sDefaultPort: string = '/dev/cuaa0'; { this would be /dev/ttyS2 for you } fPort = sDefaultPort; { Init } fCom := SerOpen(fPort); if (fCom > -1) then begin SerSetParams(fCom, 1200, 7, NoneParity, 2, []); end else begin writeln('Metex: failed to open port'); n := Get

Re: [fpc-pascal] Something I discovered using "Hint" directives.

2009-11-02 Thread Paul Ishenin
fpcl...@silvermono.co.za wrote: Two of the four hint directives listed on page 11 of the Reference Guide for Free Pascal, version 2.2.4 don't work as described in the manual. Actually there are 5 hint directives: platform, library, unimplemented, experimental and deprecated. The "Experimenta

[fpc-pascal] x86.pp and oldlinux.pp

2009-11-02 Thread Holger Bruns
Hi, I decided to copy all the necessary files for x86.pp and oldlinux.pp into one directory for compiling these two units. This compilation failed due to syntax errors. A bunch of warnings also appeared. I post only the syntax error messages: oldlinux.pp(1696,2) Error: User defined: Cannot d

Re: [fpc-pascal] Does GetLastError in WinCE work? NO answer??

2009-11-02 Thread epergola
Is this the wrong forum? Can anybody help with my question? If I should send it to another forum, please tell me which one. Thanks epergola wrote: > > Hello > I get strange results form GetLasError in WinCe; > something like 1449435930, for example; > > I use this: > {$include d:\lazarus\fpc\

Re: [fpc-pascal] Re: cross compiling x64_64 to i386 linux

2009-11-02 Thread Marco van de Voort
In our previous episode, Seth Grover said: > Okay, in further investigation I am now manually forcing fpc to use > i386-linux-ld for linking by using the "-Pi386 -XPi386-linux-" > compiler flags (-P for the target and -XP for the binutils prefix). I > assume there's something wrong in my fpc.cfg or

[fpc-pascal] Re: cross compiling x64_64 to i386 linux

2009-11-02 Thread Seth Grover
Okay, in further investigation I am now manually forcing fpc to use i386-linux-ld for linking by using the "-Pi386 -XPi386-linux-" compiler flags (-P for the target and -XP for the binutils prefix). I assume there's something wrong in my fpc.cfg or it would do this manually, but I don't know what i

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Vinzent Höfler
Holger Bruns : > Accessing ports is limited to ports < 03ffh, more ports cannot be > released with fpioperm. This means to me, successful serial port access > on higher addresses cannot yet be implemented with fpc. Or any other compiler, for that matter, because this is a system restriction. P

[fpc-pascal] cross compiling x64_64 to i386 linux

2009-11-02 Thread Seth Grover
I'm trying to cross-compile on Ubuntu 9.10 x86_64 for i386. Here's what I've done so far: I got FPC from the fixes_2_4 branch in SVN and did make/make install. I used samplecfg to generate /etc/fpc/fpc.cfg. I followed the wiki (http://wiki.lazarus.freepascal.org/Cross_compiling#To_Linux) and did

[fpc-pascal] using softfloat on i386

2009-11-02 Thread Marc Santhoff
Hi, after finding the floating point calculations implementation for fpc[1] I'm asking myself if it is possible to force fpc to use it although the CPU does actually have a FPU built in. How can this be done? [1] /usr/home/marc/fpc-2.2.2/share/src/fpc-2.2.2/rtl/inc/softfpu.pp -- Marc Santhoff

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Marc Santhoff
Am Montag, den 02.11.2009, 15:20 +0100 schrieb Holger Bruns: > I am new to linux and wrote only small things for MS-DOS before. As far > as I could read on the internet, fpc uses ioperm and iopl, and I will > try to use iopl to get access to the ports I want to use. The problem is > indeed the

[fpc-pascal] Some more units

2009-11-02 Thread Holger Bruns
Hi, I decided to use iopl and portread to address my idea on accessing ports on addresses above 0x3ff. Sadly, these units are not compiled yet, but the sourcecode is available. I still have no luck at all. Pointing fpc to x86.pp leads to an error message. The compiler misses an include file.

[fpc-pascal] Something I discovered using "Hint" directives.

2009-11-02 Thread fpclist
Hi, FPC 2.2.4 refers. Two of the four hint directives listed on page 11 of the Reference Guide for Free Pascal, version 2.2.4 don't work as described in the manual. The "Experimental" directive causes the compiler to stop with a syntax error. The example program listed on page 11 doesn't compil

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Gustavo Enrique Jimenez
> No, the "1000" means the size of a buffer, not a part address. The port > address I try to use is 0xEC00, which is the base address for an UART on a > PCI card. Linux sees this UART as /dev/ttyS2. Accessing the registers > direcly should be easy, because 3 lines of assembler code should do this >

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Bernd Mueller schrieb: Holger Bruns wrote: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successfu

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Bernd Mueller
Holger Bruns wrote: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Florian Klaempfl schrieb: Holger Bruns schrieb: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This me

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Mon, 02 Nov 2009: Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on higher addresses cannot yet be implemented with fpc. If this policy can be ruled out, let me know. fpioperm

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Florian Klaempfl
Holger Bruns schrieb: > Holger Bruns schrieb: >> I try to implement a direct port access. If this also leads to access >> errors, I should give it up. Embarassing. > Accessing ports is limited to ports < 03ffh, more ports cannot be > released with fpioperm. This means to me, successful serial port

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on higher addresses can

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Mon, 02 Nov 2009: Felipe Monteiro de Carvalho schrieb: It may be useful to know that there is a serial communication example using Synaser here: http://wiki.lazarus.freepascal.org/Hardware_Access#Serial_Communication Yes, thank you. I checked this out. The procedure recc

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Felipe Monteiro de Carvalho schrieb: It may be useful to know that there is a serial communication example using Synaser here: http://wiki.lazarus.freepascal.org/Hardware_Access#Serial_Communication Yes, thank you. I checked this out. The procedure reccvbyte, as used in this manner: Write(

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Jonas Maebe schrieb: Holger Bruns wrote on Mon, 02 Nov 2009: Martin schrieb: you can do: var buffer: Array of byte; SetLength(Buffer, 1000); SerRead(Handle, Buffer[0], 1000); I checked this out. It works not reliable. Sometimes I get real data, sometimes the data are corrupted. I have no i

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Frank Peelo
Jürgen Hestermann schrieb: function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is declared for "buffer". Untyped para

Re: [fpc-pascal] memory mapped file

2009-11-02 Thread Henry Vermaak
2009/11/2 Alexey Voytsehovich : > Hello Micha, > > Saturday, October 31, 2009, 2:39:19 PM, you wrote: > >> Alexey Voytsehovich wrote: >>> All the good days. >>>     You can not tell what I need to read and/or study for solving >>> cross-platform (linux/windows) implementation of the memory mapped f

Re: [fpc-pascal] mail-slot

2009-11-02 Thread Graeme Geldenhuys
On 02/11/2009, Alexey Voytsehovich wrote: > All the good days. Does free pascal implementation of the mail-slot > (http://en.wikipedia.org/wiki/MailSlot) ? I couldn't find any reference to MailSlot in the git commit logs, so I guess it doesn't have a MailSlot implementation. You can use Pipe

[fpc-pascal] mail-slot

2009-11-02 Thread Alexey Voytsehovich
All the good days. Does free pascal implementation of the mail-slot (http://en.wikipedia.org/wiki/MailSlot) ? If yes, then if it works under windows and linux? Thanks in advance and sorry if the question too stupid:) ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Mon, 02 Nov 2009: Martin schrieb: you can do: var buffer: Array of byte; SetLength(Buffer, 1000); SerRead(Handle, Buffer[0], 1000); I checked this out. It works not reliable. Sometimes I get real data, sometimes the data are corrupted. I have no idea to rule out cor

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Roberto Padovani
There's nothing limited within the compiler! If you have the same knowledge and expertise of Pascal and C, IMHO with gcc you will only be complicating your life. About serial port, low level routine need some practice, but you can go quickly to the point with this component for lazarus: http://s

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Marco van de Voort
In our previous episode, Holger Bruns said: > > The only way to get rid of this problem is a direct port access. But > direct port access is only possible for the first 200 port addresses. A > "port" array is not yet implemented, and the required higher port > addresses are strictly ruled out f