Re: [fpc-pascal] How to use fpGUI?

2014-07-20 Thread Holger

Hi!

 

Thank you for the informations. Next days I try to install fpGUI another time.

 

I am really writing my programs on NotePad, not Notepad++ or something like that. I do not need the colour-games, but I want to hold control about that, what I am doing. For me the NotePad ist the right thing. If you need something else, take that.

 

Bye, Holger.
(Programming experiences since 1973.)

 

 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Holger Bruns

Hello,

I am new to this list. For programming the serial ports on a linux 
system, I tried to use the "serial" unit. i don't understand the 
declaration for "buffer" in the function below, because no type is 
declared for "buffer". How can I read a character from the selected 
serial port? This is the part of the serial unit I am talking about:


 function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): 
LongInt;

   begin
   Result := fpRead(Handle, Buffer, Count);
 end;

I hope so far, you can help me out with an advice.

Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-01 Thread Holger Bruns

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". 


I believe that the type is irrelevant, you can use whatever you want. 
I think that it's just used by fpRead to buffer data. You only provide 
the space for the buffer but you don't need to read it directly. It 
seems that Count has to be the size of the buffer. But I am just 
guessing
My hope was to read more than guessing. As I pointed out, the "buffer" 
seems not to be filled with incoming data from the selected serial port. 
Hence I cannot read just this data, and serread seems to be faulty. For 
this reason I ask for an advice. I need to look on working sample code 
to use this function in a working manner. In my example, serread replies 
only, what has been written with serwrite right before. Not even 
serflush, executed right after serwrite, can solve this problem to me.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-01 Thread Holger Bruns

Martin schrieb:

Holger Bruns wrote:

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". 


I believe that the type is irrelevant, you can use whatever you 
want. I think that it's just used by fpRead to buffer data. You only 
provide the space for the buffer but you don't need to read it 
directly. It seems that Count has to be the size of the buffer. But 
I am just guessing
My hope was to read more than guessing. As I pointed out, the 
"buffer" seems not to be filled with incoming data from the selected 
serial port. Hence I cannot read just this data, and serread seems to 
be faulty. For this reason I ask for an advice. I need to look on 
working sample code to use this function in a working manner. In my 
example, serread replies only, what has been written with serwrite 
right before. Not even serflush, executed right after serwrite, can 
solve this problem to me.


var foo;
const foo;

are hidden pointer types.
That is foo would contain a pointer, but you never see this. You never 
have to get the address of something, and you never have to 
dereference it.


As for using this:

SerRead(Handle, Buffer, 0)

Buffer must be the first byte of a block of memory

you can do:
var buffer: Array of byte;

SetLength(Buffer, 1000);
SerRead(Handle, Buffer[0], 1000);



Hi Martin,

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 corrupted 
data. I also tried to use the synaser unit, which can be found on the 
internet. The demo code "sertest" crashes instantly.


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 from every use through compiled fpc 
programs. I do not understand this harsh policy. And I have no idea to 
rule this policy out. If there is any possibility to get access to all 
ports on the system without access error messages, please let me know. 
If I need to alter the compiler, is there a patch available? Or should I 
use gcc rather than fpc to match my ideas?


The real sad thing is, that one cannot produce software for Linux, based 
on the restricted free pascal compiler. I am really disappointed.


Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 idea to rule out 
corrupted data.


You have to check the result of the serread routine. Since it returns 
the result of the fpread call, "man 2 read" will tell you what those 
results mean. In short,
a) result >= 0: actual number of bytes read (the 1000 you pass is just 
a maximum)

b) result < 0: an error occurred


Thank you. I checked this out, but every incoming character is 
interpreted as zero, regardless of its real value.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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(IntToHex(ser.RecvByte(1000), 2), ' ');

reads every incoming character as zero. Simply, is does not work.

It's much easier to use then using the lower level routines yourself.

  
I try to implement a direct port access. If this also leads to access 
errors, I should give it up. Embarassing.


Holger



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 cannot yet be implemented with fpc. If this policy 
can be ruled out, let me know.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 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.



This has nothing to do with fpc. Maybe you should read the ioperm man
page and you might start to understand things.
  


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 rights management, as far as I can read on several web pages, 
which addresses my technical problem. The rights management cannot be 
ruled out by an application like I intend to write. But I can deal with 
it, I hope so far.


My posts to this list are not written against any person. My problem is 
not an interpersonal problem, but a technical question, and I try to 
find a good answer to it.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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, successful serial port 
access on higher addresses cannot yet be implemented with fpc. If 
this policy can be ruled out, let me know.


so you must use a very special serial hardware which is located on io 
address higher than $3ff. Seems unlikely to me. In your former post, 
you tried to access io address 1000 (decimal) this is $3e8 
(hexadecimal) and should be an ordinary COM3. May be you are mixing up 
decimal vs. hexadecimal notation.


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 
job:


function readport (portaddress: word): byte;
begin
asm
 mov %dx, portaddress
  inb %al,%dx
 mov readport, %al
end
end;

As long as the pascal syntax and the assembler syntax (instruction 
destination source) are both correct for fpc, this function should 
return the value of the selected port. This is all, what I try to do.



Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[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. Once the include file has been added to the desired 
directory, another file is missed instead, it reminds me to a chain 
reaction. How can I get the missed units compiled? Should I copy every 
delivered source file in one directory, or is there a more convenient 
way to deal with this problem? I tried to use make, but make also 
replies with error messages.


Regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[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 decide which processor 
you have ! define cpui386 or m68k
oldlinux.pp(3831,29) Error: Incompatible type for arg no. 1: Got 
"Constant String", expected "LongInt"
oldlinux.pp(3834,32) Error: Incompatible type for arg no. 1: Got 
"Constant String", expected "LongInt"
oldlinux.pp(5902,1) Fatal: Syntax error, "ASM" expected but 
"INITIALIZATION" found


x86.pp(192,23) Error: Asm: 16 or 32 Bit references not supported
x86.pp(207,23) Error: Asm: 16 or 32 Bit references not supported
x86.pp(222,24) Error: Asm: 16 or 32 Bit references not supported

Some nice warnings nevertheless:

x86.pp(237,6) Warning: Register list is ignored for pure assembler routines
x86.pp(247,6) Warning: Register list is ignored for pure assembler routines
x86.pp(256,6) Warning: Register list is ignored for pure assembler routines

And now? It seems to be hard to get this working. Debugging source code, 
which produces long lists of errors and warnings while compiling is a 
time consuming piece of work. Is there an alternative out there?


Regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 := GetLastOSError;
end

{ Reading }
var
  inbuf: array[0..14] of char;
begin
  fillchar(inbuf, sizeof(inbuf), #0);
  res := SerRead(fCom, inbuf[0], 14); { last figure would be 1000 for you, 
bytes to read }
  if (res < 0) then
{ signal error }
...

That way I use serial ports successfully on FreeBSD and Windows.

  


This helps a lot. Thank you. This was the example I was looking for. My 
fault was the declaration of inbuffer: array of char, and I guess, I did 
not understand how to deal with hidden pointers. Now I've got this idea 
from you and hope so far, I can move on.


Best regards, Holger


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 messages:


You appear to be compiling for x86_64 (please mention your full build 
configuration in the future, until now I thought your were working on 
i386). The reason that we do not ship a compiled version of the 
oldlinux unit for x86_64 is that it simply does not work on 64 bit 
platforms. Hence all the errors you are getting when trying to compile 
it anyway.


Yes, I tried to compiling missed units for x86_64.

The next release of FPC will include a version of the x86 unit for 
Linux/x86_64. In general, if a unit is not available in a precompiled 
version for your platform, the reason is that it does not work. Unless 
you intend to fix/rewrite that unit for your platform, trying to force 
the compiler to compile it anyway will not help you.
This means, you deliver these units for documentation purposes only, I 
guess. Now I am waiting für your next release, and I am really curious 
to look at your new code for x86 on x86_64 platforms.


Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 pointers are new to me. Therefore I 
felt in trouble with it. Secondly, it appears to be necessary to use the 
fpc compiler as "root", not simply as a user, I guess.


Best regards, Holger


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-03 Thread Holger Bruns

Jonas Maebe schrieb:


And regarding your later remark about FPC only being usable as root: 
it's the Linux kernel that only allows direct port access by root. 
Please stop blaming every single one of your problems on the compiler 
or the RTL.
Under the bottom line, the result is just the same. You need to become a 
superuser on a linux system, if you want to compile source code for 
accessing ports directly, regardless of the compiler or any other tool. 
This is not blaming your software as faulty, it's just a remark on a 
linux restriction. Secondly, having problems with a programming language 
is not a sign for a bad compiler. One can misunderstand some 
expressions, can produce errors, needs to learn more about programming. 
I do not blame your work, I appreciate it instead, and I am using fpc. I 
am pretty sure, the longer I work with it, the more I shall become 
familiar with it. Todays pascal is far more advanced than turbo pascal 
from Borland or UCSD pascal on the old Apple II, and now I have to learn 
pascal just as a programming language, which I would see the first time 
in my life.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-04 Thread Holger Bruns

Gustavo Enrique Jimenez schrieb:


Accessing serial ports in linux could be as simple as to write/read
to/from /dev/ttySx . You don't need io ports. For a multiplatform
solution, use synapsis/synaser.
  
Sometimes it is useful to get more information about device drivers. 
Searching the internet for that information is pretty difficult, because 
there is no detailed description available, as far as I see. The first 
hit on google points to a website for "device detectives". If I intend 
to use device drivers, I need to know how to access the ports of a 
device, which means in my case to a serial port based on the 16550D 
Universal Asynchronous Receiver/Transmiter with FIFOs. I need to read 
and write every register of that UART as explained in the National 
Semiconductor databook, register by register, address by address. No 
information on that topic seems to be available, but a whole bunch of 
useless idle talk and advertisement.


Hence I cannot use /dev/ttySx for accessing serial devices.

The only way to use serial ports successfully to me, is to use the unit 
serial on fpc, if I choose fpc to deal with serial ports. Another 
problem results from misleading comments on the implemented procedures 
and functions. As explained, seropen would return a zero, if a device 
cannot be found. For real, seropen returns a zero, if this device is 
found, and -1, if not.


Under the bottom line, it is embarrassing time consuming for a newbie 
like me, to work successfully with serial ports on linux.



ps: Excuse my english. Helping you is very hard: you don't listen.
  


On a mailing list, I can only read and write. ;-)

Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-04 Thread Holger Bruns

Paul Breneman schrieb:


Here is a very simple serial example using FPC and SynaSer:
  http://www.turbocontrol.com/simpleserial.htm

Hope that is of some help.
Thank you. I have already solved the problem to access serial ports, but 
I am rather clueless while dealing with device drivers like /dev/ttyS0 
on linux. My question is, what do I grab while reading from a device 
driver file like /dev/ttyS0? How can I deal with it?


Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-04 Thread Holger Bruns

Jeff Wormsley schrieb:


If you really need to go that route, with full access to 100% of the 
UART, perhaps this book would help (chapter 6 is on serial device 
drivers).


*http://tinyurl.com/yjk4c9j*


I'll follow your link.



Just know that you will have to do that part of your application in C 
as a device driver, not with FPC.  FPC does not, and cannot, override 
the base operating system restrictions regarding port access.  
Expecting it to do so just because TP under DOS would let you do that 
won't make it happen, either.


I don't understand a programming language as a tool to override an 
operating system. This is not my goal. I ask for some clues to deal with 
ports and UART devices already connected to a computer.


And insulting comments like "Under the bottom line, it is embarrassing 
time consuming for a newbie like me, to work successfully with serial 
ports on linux." directed to the FPC list won't change that either.


I don't understand this quote as insulting. A newbie on programming 
languages must learn how to write working code. This is always time 
consuming even on computers with less restrictions. Thanks to Marc 
Santhoff, I have got working sample code to use the serial unit 
successfully. But I need to mention, the comments on procedures in this 
unit are not error free. Despite to these comments the procedure 
"seropen" returns -1, if a serial port cannot be found, and not zero.


My small selfwritten functions on serial ports are working now.

Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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

2009-11-04 Thread Holger Bruns

Vinzent Höfler schrieb:


I doubt it. You sure sound write-only...

  
I am aware, that I raise problably anger while asking on mailing lists 
for information, because every question can be interpreted as an insult. 
I do not post for interpersonal relationships, but for answers to 
technical questions.


I am also aware, that I get bunches of useless ads while searching the 
internet with google or yahoo.


My code is working now, thanks again to Marc Santhoff. Please stop 
writing flames because of your personal emotions. I cannot deal with it. 
I cannot either follow your assertion, that I do not need to know how to 
write data in registers of an UART or any other peripheral device 
attached to a computer, because I could write zeros to a device file 
instead of it. I cannot follow your assertion, the fpc has nothing to do 
with serial devices. There is a unit serial out there, and I use it 
successfuily. If you feel bothered because I want to write data into 
registers of peripheral devices on my personal computer at home, I 
cannot find an answer to it. I need to accept your personal point of 
view as it is. There is nothing more, which I can do for you.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Debugger for the fpc available?

2009-11-07 Thread Holger Bruns

Hi,

while writing some Pascal code, I am still looking for a debugger, which 
works like the turbo debugger, in a similar way. I would love it to get 
a clue.


Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] const records passed incorrectly

2009-11-16 Thread Holger Bruns

Michael Van Canneyt schrieb:


In reality it's always the FPC team that is f*d when an 
incompatibility arises.


I refuse to use Borland again. I have their Delphi and the manuals as 
well on my cupboard, but since I saw Lazarus und fpc the first time, I 
decided to move on.


Holger


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] IOPL - how to use it?

2009-11-18 Thread Holger Bruns

Hi,

I am currently running the fpc in version 2.2.2-8, and I have some 
problems to get iopl and fpiopl working. It seems, the units oldlinux 
and x86 are not available to this version. How can I solve this problem?


Cheers, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] One experience with the unit serial

2009-11-18 Thread Holger Bruns

Hi,

one more question regarding the unit serial. I use the following 
function to get one single byte form a serial port, which has been open 
before with seropen:


function getdata(inhandle: tserialhandle; var recdata: char): longint;
begin
fillchar(inbuffer, sizeof(inbuffer), #0);
getdata := serread(inhandle, inbuffer[0], 1);
recdata := inbuffer[0]
end;

I repeat this function as long as I need to read data from a serial 
port, byte by byte. One interesting error occurs at the 52478th byte: 
serread returns 0 instead of 1. How can I get it work properly?


Best regards, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Holger Bruns

Brad Campbell schrieb:

Holger Bruns wrote:

Hi,

one more question regarding the unit serial. I use the following 
function to get one single byte form a serial port, which has been 
open before with seropen:


function getdata(inhandle: tserialhandle; var recdata: char): longint;
begin
fillchar(inbuffer, sizeof(inbuffer), #0);
getdata := serread(inhandle, inbuffer[0], 1);
recdata := inbuffer[0]
end;

I repeat this function as long as I need to read data from a serial 
port, byte by byte. One interesting error occurs at the 52478th byte: 
serread returns 0 instead of 1. How can I get it work properly?


The answer to that probably depends on a bit more information that you 
have provided in your question.


Thank you for your answer. I played with different baud rates. The 
sender delivers a stream of bytes. The faster a transmission rate is, 
the less amount of data can be received. This leds me to two 
conclusions: At first, there must be a queue for incoming data despite I 
ruled out a queue with an inbuffer with the length 1. Secondly, a 
timeout error appeared, the sender gave up. For now, I try to solve this 
problem with slower baud rates. Since iopl is still not available to fpc 
in its 64-bit-version, I should move to c for future port programming.


For that matter it could be interesting to know two more things: How can 
I call external executable code like "setserial /dev/ttySx none" and 
secondly, how can I use c functions like pascal functions?




Are you sure you have data waiting for you?

Yes.

Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Holger Bruns

Gustavo Enrique Jimenez schrieb:

Thank you for your answer. I played with different baud rates. The sender
delivers a stream of bytes. The faster a transmission rate is, the less
amount of data can be received. This leds me to two conclusions: At first,
there must be a queue for incoming data despite I ruled out a queue with an
inbuffer with the length 1. Secondly, a timeout error appeared, the sender
gave up. For now, I try to solve this problem with slower baud rates. Since
iopl is still not available to fpc in its 64-bit-version, I should move to c
for future port programming.



Despite queues an baud rates, you must expect data loss.  You will
loss data in the physical layer. You have to implement some handshake
to prevent it. (using google translator, excuse my english).


Gustavo

  


Which can be done through a direct port access and some lines of code in 
assembler language. The second idea I have is the use of the device 
files /dev/ttySx, but how can these files be used to get access to all 
of the registers of an uart?


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] One experience with the unit serial

2009-11-20 Thread Holger Bruns

Jonas Maebe schrieb:


On 19 Nov 2009, at 14:30, Holger Bruns wrote:

Since iopl is still not available to fpc in its 64-bit-version, I 
should move to c for future port programming.


$ man iopl
...
  This call is mostly for the i386 architecture.  On many other 
architec-

  tures it does not exist or will always return an error.

Switching to C will not cause this function to magically appear in the 
Linux kernel on non-i386 systems.


Hi Jonas,

this seems to work on a 64-bit-system:

#include 
int
main(int argc, char *argv[])
{
unsigned char b;

   if (iopl(3) == -1)
   perror("iopl");
   b = inb(0xec00);
   printf("b=%#x\n", b);
}

It is c, but now I simply need to know how to call c functions in pascal 
programs. I am using a linux kernel in version 2.6.28, and for this 
kernel version your quotation of "man iopl" seems not to be valid.


Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] readonly variables

2009-12-02 Thread Holger Bruns

Anthony Walter schrieb:

This first time concerning  the topic "const records passed
incorrectly" you said, "It is nowhere written in the Delphi specs that
const parameters are passed by reference. It is often so, but is by no
means guaranteed"
  
I checked this out. Both Turbo Pascal and fpc reported the same error 
massage: Variable identifier expected. You simply cannot pass constant 
values by reference.


HTH, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] [OT] which editor - emacs?

2010-01-10 Thread Holger Bruns

Marco van de Voort schrieb:

In our previous episode, Hans-Peter Suter said:
  

Is Emacs a good choice? Does it work well with FPC?



Maybe, but what would you use as editor? :_)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

  

Gedit, also geany. Works fine with fpc.


HTH, Holger

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]1. Mandrake & 2. FPC with WINE and crosscompiling

2003-01-24 Thread Holger Peterrs
Hi,

1. At home I'm working with FreePascal for Windows. But in extra curricular
lessons, I work with Linux (Mandrake). I tried to install FreePascal for
Linux on this comuter, but it didn't work. For example there is no IDE and if I
start fpc in the console, there is no output. Is it because I am not logged in
as a root user? How can I solve this?

2. If there is no solution, can I run the windows version of FreePascal with
WINE and compile the programs for Linux (crosscompiling)? If yes, how can I
do this? 

Thanks for your awnsers. 

Holger 

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]1. FPC and Mandrake 2. Crosscompiling

2003-01-24 Thread Holger Peters
Hi,
1. At home I'm working with FreePascal for Windows. But in extra 
curricular lessons, I work with Linux (Mandrake). I tried to install 
FreePascal for Linux on this comuter, but it didn't work. For example 
there is no IDE and if I start fpc in the console, there is no output.
Is it because I am not logged in as a root user? How can I solve this?

2. If there is no solution, can I run the windows version of FreePascal 
with WINE and compile the programs for Linux (crosscompiling)? If yes, 
how can I do this?

Thanks for your awnsers.

Holger


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]Unit Graph with Linux (Knoppix) or alternative unit

2003-02-01 Thread Holger Peterrs
Hi,
I've got a question again :)

I get the mistake, which is described in the FAQ under my Knoppix 
Distribution:

>Why can't the linker find "vga"?

>This error typically looks like this:

>Free Pascal Compiler version 1.0.x [/yy/zz] for i386
>Copyright (c) 1993-2000 by Florian Klaempfl
>Target OS: Linux for i386
>Compiling test.pp
>Assembling test
>Linking test
>/usr/bin/ld: cannot find -lvga
>test.pp(6,4) Warning: Error while linking Closing script ppas.sh 5 Lines
>compiled, 0.2 sec
>
>
>This error is not an error in the installation of FPC or FPC itself, but 
a missing >Svgalib library in your unix install. Please install the 
required library using your >favourite package manager tool

For Knoppix boots from CD, I don't think it is not possible to install 
such a package in this path. How can I get this working? (or is there any 
other Unit that allows the use of a PutPixel function in an easy way?
A special GTK Graphic Widget was good, too.)

Thanks,
Holger

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]Unit Graph with Linux (Knoppix) or alternative unit

2003-02-06 Thread Holger Peters
Hi,
are there any alternatives?
I think of a simple Graphic Unit, or a Widget for GTK with some simple
drawing functions. I'm satisfied with a simple PutPixel procedure.

Holger


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal]Unit Graph with Linux (Knoppix) or alternative unit

2003-02-07 Thread Holger Peters
Hi,

> You may want to have a look at the 4th or 5th GTK article on the website.
> There I explain how you could set up such a thing. (It's the one with the
> breakout game)

I've already read this article, and I tried to write a Widget, that does
this, but it does not work right (I'm searching still the mistake).

I think I've found now a Unit which is good enough, SDL4FreePascal.

Thanks for your help,
Holger


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]Understanding the compiler sources

2003-02-10 Thread Holger Peters
Hi,
I want to understand how a compiler works. So I thought I could search a
little open source Compiler (FreePascal is very big and I think I had a
better overview with a smaller one).
So I decided to understand FreePascal. I found „Free Pascal 1.0.x
Internal documentation version 1.0“ on freepascal.org.

Should I work through it from the beginning to the end?
Or are there any other suggestions?

Ciao,
Holger


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



[fpc-pascal]Bug? Error when compiling a folder

2003-02-23 Thread Holger Peters
Hi,
it is not a great important bug, but it could be solved. In Linux, I
discovered that FPC did not remark when I passed a folder as a source
file, it halted with an error.

Holger

PS: Excuse my bad English, but the day was long *g*


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]SDL with FPC - possible?

2003-06-19 Thread Holger Peters
Hi,

I have used SDL4FreePascal for some time. Simplysearch it with google. 
It worked fine with FPC 1.0.6 under Windows, I have not used it under 
Linux, but I guess it is about the same.

Please notice that libsdl is not ported completely.

Holger

Marco van de Voort schrieb:

Are there any libsdl units for FPC available? Sorry if
it's too trivial, or discussed in the near future, but
i can't find it between the packages in the CVS, and
i have no time to dig myself into the problem right 
now...  
   

I do know that there are Jedi SDL bindings, and did you check
contributed units?


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]Printing

2003-06-27 Thread Holger Peters
hi,

I'm writing an GTK+ Programm with FPC, and I'd like to print a GdkPixmap 
out (on paper, not on screen). Since GTK+ does not provide a printing 
interface I'd like to know if there is a plattformindependend (Windows 
and Linux) interface available in FPC.

Holger

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]XChat plugins using FPC

2003-07-25 Thread Holger Peters
Hi,

if you are successful, I would be glad to receive the ported Header 
files and a small example.

Holger

James Mills schrieb:

Hi,

I can successully compile and test the plugin source listed at
http://xchat.org/docs/plugin20.html written in C.
However I don't like C much and am wondering if it's possible to do the
same thing in pascal... ? I know it has to be possible, but I need
someone to start me off in the right direction...
cheers
James
 



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]Error 216 with SDL

2003-08-04 Thread Holger Peters
Hi,

I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked 
fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and SDL4FreePascal 
doesn't work.
When I compile the demos, I get the runtime error 216 at the first 
SDLcommand.

Is there a solution?

Holger



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Error 216 with SDL

2003-08-12 Thread Holger Peters
Holger Peters schrieb:

Hi,

I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it 
worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and 
SDL4FreePascal doesn't work.
When I compile the demos, I get the runtime error 216 at the first 
SDLcommand.

Is there a solution?

Holger 


I tried to debug it via gdb, the first SDL function SDL_Init let's the 
program crash.

Now I tried to write a little include file with some functions, types 
and constants. I want to extend it, with the SDL Functions I need until 
it is complete.

But with this simple instructions, it doesn't work, to.

{$ifdef Linux}
{$LINKLIB pthread}
{$ENDIF}
{General}
const
   SDL_INIT_TIMER  = $0001;
   SDL_INIT_AUDIO  = $0010;
   SDL_INIT_VIDEO :Cardinal= $0032;
   SDL_INIT_CDROM  = $0100;
   SDL_INIT_JOYSTICK   = $0200;
   SDL_INIT_NOPARACHUTE= $0010; {Don't catch fatal signals}
   SDL_INIT_EVENTTHREAD= $0100; {Not supported on all Os's}
   SDL_INIT_EVERYTHING = $;
type
   Uint32 = Cardinal;
function SDL_Init(Flags : Uint32) : Integer; cdecl; external 'SDL';
procedure SDL_Quit; cdecl; external 'SDL';
{Video}
{Sound}
{Events}
I've got this constants from the SDL.h on my PC.
It fails with the same error if you use this constants (except 
SDL_INIT_TIMER). But It works fine with values like 1,2,3,4...
The function returns 0, that means that it was succesful 
(SDL-Documentation: Returns -1 on an error or 0 on success.)

I can't undestand the sense.

Holger

PS:

To test this Includefile, I used this program
program testsdl;
{$MODE OBJFPC}
{$MACRO ON}
{$INCLUDE sdlinc.inc}
begin
   WriteLn(SDL_Init(SDL_INIT_VIDEO));
   SDL_Quit;
end.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]what Programming Environment : Editor & Debugger

2003-08-14 Thread Holger Peters
Stefan Becker schrieb:

dear Pascal'ers,

I've just searched the net and freepascal.org in the hope of finding some
info on what and how to set up a working environment with linux.
So far I've done all my editing and debuging on a DOS machine with
Borland 7.0 - and "just" recompiling my applications with freepascal
for linux. 

I want to go to a pure linux environment - so now the question.

What editor or program should I use and work my way into?
It would be nice to have a debugger also.  Is there any
"finished" packages that I could use?
The FreePascal website talks about a "fp IDE" and I remember
seeing it for DOS.  Does this exist for linux?  

many thanks,

Stefan Becker

Hi,

I use vim for editing files, because it is very fast, and you don't need 
to change between mouse and keyboard.

But I have to warn you, when you only worked with intuitive systems, it 
is a bit work to get familiar with it.

Gdb is a console-based debugger.

Holger

(If you've got troubles with vim, mail me)

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]What does this mean?

2004-01-20 Thread Holger Peters
Hi,

I tried to compile this program:

{$MODE OBJFPC}
program
   DomTest3;
uses
   DOM,
   xmlread,
   Classes;
var
   MyXMLStructure  : TXMLDocument;
   MyFile  : TFileStream;


begin
MyFile.Create('test.xml',fmopenread);
MyXMLStructure := TXMLDocument.Create;
try
   ReadXMLFile(MyXMLStructure,MyFile);
except
   On EXMLReadError do WriteLn('Did not work out well');
end;
MyFile.Destroy;
end.
I executed it, and it did not work (EAccess violation) so I tried to
compile it with -gd to use it with a debugger. But unfortunately it gave
the following error:
Free Pascal Compiler version 1.9.2 [2004/01/07] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling main3.pp
Panic : Internal compiler error, exiting.
main3.pp(22) Fatal: Internal error 
PS: Line 22 is the last line of the file.

Is this a bug or is the mistake on my side?

cu,
Holger


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]What does this mean?

2004-01-20 Thread Holger Peters
Hi,

I tried to compile this program:

{$MODE OBJFPC}
program
   DomTest3;
uses
   DOM,
   xmlread,
   Classes;
var
   MyXMLStructure  : TXMLDocument;
   MyFile  : TFileStream;
   

begin
MyFile.Create('test.xml',fmopenread);
MyXMLStructure := TXMLDocument.Create;
try
   ReadXMLFile(MyXMLStructure,MyFile);
except
   On EXMLReadError do WriteLn('Did not work out well');
end;
MyFile.Destroy;
end.
I executed it, and it did not work (EAccess violation) so I tried to 
compile it with -gd to use it with a debugger. But unfortunately it gave 
the following error:

Free Pascal Compiler version 1.9.2 [2004/01/07] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling main3.pp
Panic : Internal compiler error, exiting.
main3.pp(22) Fatal: Internal error 
PS: Line 22 is the last line of the file.

Is this a bug or is the mistake on my side?

cu,
Holger
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]What does this mean?

2004-01-20 Thread Holger Peters
Hi,

thank you, a really stupid mistake from me, but it is still not working 
when I compile it with fpc main3.pp -gd .

Holger
Michael Van Canneyt schrieb:
On Tue, 20 Jan 2004, Holger Peters wrote:

 

Hi,

I tried to compile this program:

{$MODE OBJFPC}
program
   DomTest3;
uses
   DOM,
   xmlread,
   Classes;
var
   MyXMLStructure  : TXMLDocument;
   MyFile  : TFileStream;


begin
MyFile.Create('test.xml',fmopenread);
   

This is wrong. It should be

 MyFile:=TfileStream..Create('test.xml',fmopenread);

It explains the access violation.

Michael.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]ptop.cfg

2004-02-09 Thread Holger Peters
Hi,

is there any ptop.cfg sample file which uses a more delphi like style 
than the one which comes with FPC?

Holger

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] How to use fpGUI?

2014-07-19 Thread Holger Aschmann

Hi.

 

I write my programs in Free Pascal on NotePad, and I don't like to use Lazarus. Is there any possibility to use fpGUI, or doesn't it work without Lazarus?

 

Holger.

 

 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal