Linux-Development-Sys Digest #345, Volume #8 Wed, 13 Dec 00 10:13:14 EST
Contents:
Q: Linux serial line programming, open() hangs (Christoph)
Re: kernel questions (Emmanuel CECCHET)
connect 2 sockets (Clemens Hermann)
Re: Compiling C++ programs with GCC --> no GPL license implications (jbs)
pcnet32 problem: using TX instead of FX (AT-2700FTX) (Thomas Steffen)
Re: connect 2 sockets ("Z")
Re: connect 2 sockets (Clemens Hermann)
Re: looking for SCSI Domex DMX 1391D driver ([EMAIL PROTECTED])
Re: Compiling C++ programs with GCC --> no GPL license implications (Pete Becker)
Re: Compiling C++ programs with GCC --> no GPL license implications (Pete Becker)
Re: How do I . . . ? (Aldo Pignotti)
Re: connect 2 sockets ("Z")
----------------------------------------------------------------------------
From: Christoph <[EMAIL PROTECTED]>
Crossposted-To: comp.terminals
Subject: Q: Linux serial line programming, open() hangs
Date: Wed, 13 Dec 2000 09:29:21 +0100
This is a multi-part message in MIME format.
==============6433F36DC86D115D4982BC98
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
if i start my program the second time, it hangs infinitly at the open()
system call. The first time everthing worked fine.
Do you know why this is and how to avoid it ?
Would be nice, if you could have a quick look at the serial connection
part of the sources attached.
Thanks in advance,
Christoph Hagedorn
==============6433F36DC86D115D4982BC98
Content-Type: text/plain; charset=us-ascii;
name="linux-dev.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="linux-dev.c"
/**************************************************************************************************
program :6811Monitor
description :monitor program for motorola 68HC11 MCU on Miniboard
last modified :$Date: 2000/12/02 13:23:36 $
compiler :gcc version 2.7.2.1
operating system :Linux
author :Christoph Hagedorn
email :[EMAIL PROTECTED]
files :Makefile, 6811mon.c/h, linux-dev.c/h, messages.c/h,
mon-cmds.c/h, README.txt
**************************************************************************************************/
#include <sys/types.h>
#include <fcntl.h>
#include <termios.h> /* serial interface: man termios */
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include "6811mon.h"
#include "linux-dev.h"
#include "messages.h"
#include <string.h>
/*
global static variables (only in this source file known)
***************************************************************/
static fd_set rfd,wfd,efd; /* read,write,exception file descriptors, resist until prg
terminates */
static struct termios OldTermios; /* save old device settings, resists until prg
terminates */
static struct termios NewTermios; /* set new device settings, resists until prg
terminates */
/*
serial i/o
*********************************************************/
int init_device( const char *pDevice )
{
/*
returns file deskriptor or NULL on error
see info- or manpages for help:
info termios
man termios
*/
int tty_fd; /* tty file descriptor */
assert( pDevice );
FD_ZERO( &rfd );
FD_ZERO( &wfd );
FD_ZERO( &efd );
memset( &NewTermios, 0, sizeof(OldTermios) ); /* clear structure */
memset( &NewTermios, 0, sizeof(NewTermios) ); /* clear structure */
tty_fd = open( pDevice, O_RDWR | O_NOCTTY ); /* open read/write and not controlling
*/
if( tty_fd < 0 )
{
perror(pDevice);
return false;
}
FD_SET( tty_fd, &rfd );
FD_SET( tty_fd, &wfd );
FD_SET( tty_fd, &efd );
if( tcgetattr(tty_fd, &OldTermios) < 0 ) /* save current settings */
{
perror(pDevice);
return false;
}
cfmakeraw( &NewTermios ); /* set to raw i/o */
cfsetospeed( &NewTermios, B1200 ); /* and 1200 baud */
if( tcflush(tty_fd, TCIFLUSH) < 0 ) /* clean line */
{
perror(pDevice);
return false;
}
if( tcsetattr(tty_fd,TCSANOW, &NewTermios) < 0 ) /* and activate the port settings
*/
{
perror(pDevice);
return false;
}
return true;
}
bool close_device( int device )
{
if( tcflush(device, TCIFLUSH) < 0 ) /* clean line */
{
perror("close_device");
return false;
}
if( tcsetattr(device, TCSANOW, &OldTermios) < 0 ) /* and activate the saved port
settings */
{
perror("close_device");
return false;
}
close( device );
return true;
}
bool set_baud( const int device, const int bps )
{
if( bps == 1200 )
cfsetospeed( &NewTermios, B1200 );
else if( bps == 9600 )
cfsetospeed( &NewTermios, B9600 );
else
{
warn("invalid baudrate specified ! using 9600\n" );
return false;
}
if( tcflush(device, TCIFLUSH) < 0 ) /* clean line */
{
perror("set_baud()");
return false;
}
if( tcsetattr(device,TCSANOW, &NewTermios) < 0 ) /* and activate the port settings
*/
{
perror("set_baud()");
return false;
}
return true;
}
const char receive_byte( const int device, struct timeval timeout )
{
char rbyte;
int data_available; /* return value of select */
int r_count; /* count of received bytes */
memset( &rbyte, 0, sizeof(char) );
data_available = select( device+1, &rfd, NULL, &efd, &timeout );
if( ! data_available )
warn( "device timed out while waiting for available data" );
else if( data_available < 0 )
{
perror( "receive byte()" );
exit(EXIT_FAILURE);
}
else if( 1 == data_available )
{
r_count = read( device, &rbyte, 1 ); /* read 1 byte */
if( r_count < 0 )
{
perror( "receive_byte()" );
memset( &rbyte, 0, 1 );
}
}
else
warn("Exception while receiving");
return rbyte;
}
const char send_byte( const int device, struct timeval timeout, const char sbyte, bool
echo )
{
size_t count = 0;
char rbyte = sbyte;
int ready; /* return value of select */
ready = select( 1, NULL, &wfd, NULL, &timeout );
if( ready )
{
fprintf( stderr," write sbyte: %c \n", sbyte );
count = write( device, &sbyte, 1 ); /* try to send 1 byte */
if( count < 0 )
{
perror( "send_byte()" );
memset( &rbyte, 0, sizeof(char) );
}
if( echo )
{
rbyte = receive_byte( device, timeout );
fprintf( stderr," received rbyte: %c \n", rbyte );
}
}
else
{
warn( "device timed out while waiting to get ready" );
memset( &rbyte, 0,sizeof(char) );
}
return rbyte;
}
==============6433F36DC86D115D4982BC98==
------------------------------
From: Emmanuel CECCHET <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup,linux.dev.kernel
Subject: Re: kernel questions
Date: Wed, 13 Dec 2000 10:26:01 +0100
This is a multi-part message in MIME format.
==============9E6C37E604A5B2A89C254628
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
[EMAIL PROTECTED] wrote:
> I have a couple of questions.
>
> What is a backport?
When new features are added in 2.4 kernels for example,
some of them are desirable to be backported to 2.2 kernels. A
backport is a port from a newer kernel version to a prior one.
> What patch goes with what kernel? i.e. Does patch-2.2.18 update kernel
> 2.2.17 or 2.2.18?
2.2.17
Emmanuel
==============9E6C37E604A5B2A89C254628
Content-Type: text/x-vcard; charset=us-ascii;
name="Emmanuel.Cecchet.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Emmanuel CECCHET
Content-Disposition: attachment;
filename="Emmanuel.Cecchet.vcf"
begin:vcard
n:CECCHET;Emmanuel
tel;fax:04.76.61.52.52
tel;work:04.76.61.52.63
x-mozilla-html:FALSE
url:http://sirac.inrialpes.fr/~cecchet
org:INRIA Rh�ne-Alpes;Is�re (38)
adr:;;655, Avenue de l'Europe;Montbonnot St Martin;;38330;FRANCE
version:2.1
email;internet:[EMAIL PROTECTED]
title:Ph.D Student/Doctorant
x-mozilla-cpt:;-1
fn:Emmanuel CECCHET
end:vcard
==============9E6C37E604A5B2A89C254628==
------------------------------
From: Clemens Hermann <[EMAIL PROTECTED]>
Subject: connect 2 sockets
Date: Wed, 13 Dec 2000 11:29:40 +0100
Hi,
How can I connect two sockets? I have something like a small proxy and I
just want to pass things through. Therefor I want to connect the client
connected to me to the server I am connected to (like piping).
Thanks for any hints
Clemens
------------------------------
From: jbs <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Wed, 13 Dec 2000 03:51:22 -0800
Peter Seebach wrote:
> In article <[EMAIL PROTECTED]>, jbs <[EMAIL PROTECTED]> wrote:
> >There you go again. The logic is not necessarily (or even in this case,
> >at all) shaky just because it happens to be posted on the Internet.
>
> True. However, it's not exactly well-supported.
Huh? The original poster said that every file in the library, except
one, had a "special exception" that permitted linking with an executable
without requiring that executable to be covered by GPL.
There is nothing "shaky" about that -- it is purely factual.
The original poster then said that he talked to the developers of the
library, as well as the holders of the copyright of the library to ask
whether the omission was an inadverant and unintentional error (as would
appear overwhelmingly likely anyway). They said yes.
He then asked if the omission will be corrected in future releases.
They said yes.
What's "shaky" about any this?
If you are uncomfortable relying on their representations in email, then
just wait for the next release. Or grab a developer snapshot which might
well have incorporated the licensing correction already (or wait for one
that does).
> If you want to claim that some logic *isn't* shaky, why not have an actual
> lawyer come in and give legal advice? :)
No lawyer is going to give "legal advice" in a newsgroup. Anyone who
wants to consult a lawyer to get individual legal advice is of course
free to do so.
I don't personally see using GPL software as requiring any more legal
advice than using any other licensed software. Probably less, given
that GPL is at least standardized and relatively well understood by the
community as a practical matter, while commercial licenses tend to all
be different. But that's just my personal opinion, formed over nearly
20 years of being involved with free software, and 10 years as a
businessperson and consultant advising businesses on the use of free
softare. Form your own opinion.
> Note that merely being logical is not much of a defense in a court system...
What matters in the court system does not necessarily matter very much
to what happens in the real world. While it would be foolish to ignore
legal considerations, it is also foolish to unnecessarily elevate legal
maters to the level where they routinely drive business decisions.
Any good business lawyer will tell you that legal considerations are
just that and that business decisions need to be made considering legal
concerns, but almost never made *by* legal concerns.
------------------------------
From: Thomas Steffen <[EMAIL PROTECTED]>
Subject: pcnet32 problem: using TX instead of FX (AT-2700FTX)
Date: 13 Dec 2000 13:22:22 +0100
Hi,
I have just received a brand new 100baseTX and 100baseFX NIC from
allied telesyn, the AT-2700FTX, based on the amd 79c972 and the
level one lxt971a mii.
I did not find a way to use the 100baseTX connector on that card. It
doesn't support autodetection, at least not in the hardware. I tried
mii-tool, mii-diag, pcnet-diag and using the options-option for the
pcnet32 module. I even tried the lance-module as an alternative
driver, to no avail.
However, during testing several mii-settings, the card/driver hang up
several times. An mii-reset did help sometimes, as did removing the
modules. On other times the module was "busy", and I had to reboot,
and even worse the system did hang up a few times.
Any ideas? Is the 79c972 not supported? (it should be...) Is there
anything else I could try? I do have the documentation of the lxt971a,
and that meantions that the pin SD/TP determines, whether TX or FX is
used. But I have no idea how to set that pin to anything...
Thomas
------------------------------
From: "Z" <[EMAIL PROTECTED]>
Subject: Re: connect 2 sockets
Date: Wed, 13 Dec 2000 13:58:16 +0100
Once upon a while "Clemens Hermann" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How can I connect two sockets? I have something like a small proxy and I
> just want to pass things through. Therefor I want to connect the client
> connected to me to the server I am connected to (like piping).
>
> Thanks for any hints
>
> Clemens
>
read client, send to server.
read server send to client.
That's all.
--
Z ([EMAIL PROTECTED])
"LISP is worth learning for the profound enlightenment experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days." -- Eric S. Raymond
------------------------------
From: Clemens Hermann <[EMAIL PROTECTED]>
Subject: Re: connect 2 sockets
Date: Wed, 13 Dec 2000 14:56:54 +0100
Hi Zoran,
thanks for your help.
> > How can I connect two sockets? I have something like a small proxy and I
> > just want to pass things through. Therefor I want to connect the client
> > connected to me to the server I am connected to (like piping).
>
> read client, send to server.
> read server send to client.
That is what I did. I read it into a buffer from the server and then wrote
the buffer to the client.
My problem: I do not know how big the sent Data (-> the buffer) will be (it
could be some Megs). So how can I connect the server and the client directly?
Could you show me a snippet?
Thanks
Clemens
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.hardware
Subject: Re: looking for SCSI Domex DMX 1391D driver
Date: Wed, 13 Dec 2000 14:36:28 GMT
On Tue, 12 Dec 2000 22:10:57 +0200, "Alk" <[EMAIL PROTECTED]>
wrote:
>I've got drivers here (AdvanSys.com)
>http://www.connectcom.net/downloads/software/os/linux.html
>And they work with DMX _3191D_ which came with Mustek Scanner
>
>AG
><[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]...
>> The Mustek SCSI scanner I use comes with a SCSI device called "Domex
>> DMX 1391D" which has a chip denoted as "DOMEX 536", sublined "9827".
>>
>> I had a look at the scsi low level drivers in the kernel 2.2.17
>> xconfig app, some denoted with "53" at the beginning but non which
>> would really shout out -" take me"! I didn't expect to find
>> "DOMEX_xxx" but some chip should be compatible to the one on the Domex
>> controler - assuming it would be to expensive to design one from the
>> ground up.
Thanks a lot for your help, Alk!
How did you encode Domex-> AvanSys?
Just had a glimpse in the 2.2.17 kernel_konfig, AvanSys is supported
by 2.2.17 and can be compiled into the kernel.
Greetings
Robert
------------------------------
From: Pete Becker <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Wed, 13 Dec 2000 09:45:47 -0800
jbs wrote:
>
> Pete Becker wrote:
> > > I suggest that people get sound legal advice before using your
> > > products. Given your propensity to distort the content and meaning of
> > > the GNU licenses, as well as the intent of the licensor, I would be
> > > concerned about what you might imagine your own license means, after I
> > > invested millions of dollars in my own product that depended on it (not
> > > that I would).
> >
> > I have said nothing at all about the content and meaning of the GNU
> > licenses, nor have I said anything about the intent of the licensor.
>
> Wrong. In response to a reply to (misguided) comments by Tisdale, you
> said:
>
> "He happens to be right."
>
> In doing so, you adopted his innuendos and misunderstandings as your
> own.
I see. So from four words you infer a "propensity to distort." You're
treading dangerously close to libel.
>Of course, most people would reasonably conclude that you did so
> deliberately and self-servingly, to promote your own competing products,
> although of couse we can't prove this. Still, shame on you.
Whatever you think "most people would reasonably conclude" is not fact,
and in this case it happens to be wrong.
--
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Contributing Editor, C/C++ Users Journal (http://www.cuj.com)
------------------------------
From: Pete Becker <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Wed, 13 Dec 2000 09:48:55 -0800
jbs wrote:
>
> Pete Becker wrote:
> > What I have said is that
> > basing such a decision on a representation from someone on the internet
> > that there is no problem is not legally sound.
>
> That's true, but that's hardly what reasonable and intelligent people
> are basing their decisions on.
>
> > If people want to base
> > business decisions on shaky legal logic that is their prerogative.
>
> There you go again. The logic is not necessarily (or even in this case,
> at all) shaky just because it happens to be posted on the Internet.
>
> If you want to claim that someone's legal logic is "shaky" back it up
> with hard facts, case law, and citations to recognized authorities.
> Otherwise, take your self-promoting FUD and take a hike.
You seem to think that I have said that there is some serious flaw in
GNU's licensing. I have not. What I have said, and I'll say it again, is
that business decisions based on opinions garnered from newsgroups are
inherently more risky than business decisions based on sound legal
advice. I don't understand why this is so controversial.
--
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Contributing Editor, C/C++ Users Journal (http://www.cuj.com)
------------------------------
From: Aldo Pignotti <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions
Subject: Re: How do I . . . ?
Date: Wed, 13 Dec 2000 14:43:06 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> I am looking for the command that will help me compare two directory
> structures.
>
I would do an "ls -alR > afile" on one directory and an
"ls -alR > bfile" on the other directory. Then I would
"diff afile bfile | more"
--
It ain't no sin
to be glad you're alive - the boss
Sent via Deja.com
http://www.deja.com/
------------------------------
From: "Z" <[EMAIL PROTECTED]>
Subject: Re: connect 2 sockets
Date: Wed, 13 Dec 2000 16:09:18 +0100
Once upon a while "Clemens Hermann" <[EMAIL PROTECTED]> wrote:
> Hi Zoran,
>
> thanks for your help.
>
>> > How can I connect two sockets? I have something like a small proxy and I
>> > just want to pass things through. Therefor I want to connect the client
>> > connected to me to the server I am connected to (like piping).
>>
>> read client, send to server.
>> read server send to client.
>
> That is what I did. I read it into a buffer from the server and then wrote
> the buffer to the client.
> My problem: I do not know how big the sent Data (-> the buffer) will be (it
> could be some Megs). So how can I connect the server and the client directly?
>
> Could you show me a snippet?
>
> Thanks
>
> Clemens
>
>
So what you want is a resizeable buffer for reading and sending?
How do you know your data has finished? I mean is there some special
data that tells you to take the preceding data and send it? Or do
you get some length information before you recieve the actual data?
--
Z ([EMAIL PROTECTED])
"LISP is worth learning for the profound enlightenment experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days." -- Eric S. Raymond
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************