Linux-Development-Sys Digest #962, Volume #7     Tue, 20 Jun 00 11:13:11 EDT

Contents:
  Re: Raw Keyboard Scancode (Jan Panteltje)
  Re: Poll on /proc files (Mario Klebsch)
  TCP question ([EMAIL PROTECTED])
  Hi there, (Sam)
  data acquisition boards (goulmik)
  profiling linux kernel. ("Jay")
  profiling linux kernel ("Jay")
  Why so many collisioins ? ("Boris Pran")
  Re: Why so many collisioins ? ("Cedric Blancher")
  Re: Why so many collisioins ? ("Boris Pran")
  Re: Why so many collisioins ? ("Cedric Blancher")
  Re: Poll on /proc files (Alan Donovan)
  Re: A strange problem using poll() systemcall ("Roman A. Stepanov")
  Re: Why so many collisioins ? (Rick Matthews)
  Driver devel (interruptible_sleep_on_timeout) (Espen Sand)
  can I not get the value of a global variable in an interrupt handler? (Bangnan Xu)
  Re: data acquisition boards (eric keller)
  Re: A strange problem using poll() systemcall (Alan Donovan)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED] (Jan Panteltje)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Raw Keyboard Scancode
Date: Mon, 19 Jun 2000 19:24:56 GMT

>Hi,
>
>I have a compaq system that comes with compaq keyboard with
>some special keys on the top for cd/dvd control as well as
>volume control.
>
>I am planning to write a panel applet to utilize these keys.
>
>Any help in retieving raw keyboard codes ?
>
>Thanks
>
>Yogesh
>
>Please remove NOSPAM from email address while replying.
>
>
>
>
>
You can use xev  to get the keycodes in X.
I did it in console for the Logitech keyboard, by modiying
the kernel source.
Then it still did not work in X.
Now I moved to a new distribution, and deleted the old modified kernel...
In the new kernel /usr/src/linux/drivers/char/keyboard.c is completely
changed.

So I gave up, as I can just access using normal commands.
But it would make an interesting project.
Maybe someone is already working on this?

Jan

------------------------------

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: Poll on /proc files
Date: Mon, 19 Jun 2000 20:30:59 +0200

Mathias Waack <[EMAIL PROTECTED]> writes:

>Alan Donovan <[EMAIL PROTECTED]> writes:

>I know this solution, but my daemon sleep most time in a poll, so it 
>would be nice to simply add another fd to the list of fd it polls on. 

Perhaps /dev/isdninfo is the way to to it. I have used select() on an
FD for that device, and it worked. So, poll() should work, too. But
unfortunately, it requires additional entries in /dev.

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.unix.programmer,comp.unix.programmer,comp.unix.solaris
Subject: TCP question
Date: Mon, 19 Jun 2000 20:19:19 GMT

Hi:
  Many of you might know the answer for this already. But this has been
confusing me a bit...
  when you call listen() on a TCP socket before accept(), I understand
that the backlog is the number of requests that will be queued by the
kernal, between accept()s. I also understands from Unix Networking by
Richard Stevens that this is the sum of the Established quequs and the
Syn received queues. It also specifies that if a requests comes when
the queue is full ( after considering teh fudge factor ) , the SYN will
not be responded with. Now for the questions...
1. What happens when a client tries to connect to a server, whose quequ
is already full. I understand TCP being a reliable protocol will resend
the SYN request again. Does this mean that whatever the delay is
between accept() on teh server side, the client will ultimately ensure
success even on a single connect() by resending the SYN s for an
infinite time. There is a mention about 75sec on Richard Stevens. But
in this case is connect() going to return an ETIMEDOUT or what.
2. The queues( ESTABLISHED & SYN_RECEVD ) are allocated on a system
wide basis or on a per socket basis. I m almost certain that it has to
be on a per socket basis since a system wide queue can result in a bad
process killing off the complete system. But I would like you guys to
confirm this.



Thanks a lot for reading.

Sony





Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: Sam <[EMAIL PROTECTED]>
Subject: Hi there,
Date: Mon, 19 Jun 2000 14:23:55 -0700
Reply-To: [EMAIL PROTECTED]

Hi there,
    I tried to recomplie my kernel in order to make hte HPT 366 DMA 66
to work. However, I cannot install the patch successfully, can anyone
teach me how ? when I start to patch, it asked me which file to patch
..hum...but is it suppose to install without a hitch ....rite... and the

other thing is. after I did make dep clean bzImage modules
modules_install and move the img to /boot....when I restart again... it
said missing so modules or files about my soundblaster live, can anyone
tell me how to solve it or am I did anything wrong?
plz advice..

Sam




------------------------------

From: goulmik <[EMAIL PROTECTED]>
Subject: data acquisition boards
Date: Mon, 19 Jun 2000 23:14:57 +0200

Hi,

I'm searching for any kind of informations about Linux and Data
Acquisition boards
known supported hardware
configuration
visualisation of plots collected
Related websites
books

so if you can help me, feel free to contact me...
thank


------------------------------

From: "Jay" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: profiling linux kernel.
Date: Mon, 19 Jun 2000 22:24:55 -0700

Iam trying to use "readprofile" to profile a running kernel. I have the IKD
patch installed on 2.2.14 kernel. The program outputs a column for
"normalized load".  Any idea what exactly it means and/or how its
calculated? Is there a way to get a count of the number of times a function
was called from this "normalized load" or otherwise?
  Any help would be appreciated. Thanks.



------------------------------

From: "Jay" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: profiling linux kernel
Date: Mon, 19 Jun 2000 22:35:46 -0700

Iam trying to use "readprofile" to profile a running kernel. I have a
IKD-patched 2.2.14 kernel. Does anybody know what exactly the "normalized
load" that is given by 'readprofile' means? How is it normalized? Also, Iam
mainly interested in getting a count of the number of times a particular
function was called. How can I get this number reliably?
  Any help would be appreciated. Thanks.
--Jay.



------------------------------

From: "Boris Pran" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Why so many collisioins ?
Date: Tue, 20 Jun 2000 10:16:46 +0200

I have two Linux boxes, one is 2 x Celeron433 with D-Link DFE530TX NIC and
the another is AMD5x86 - 160Mhz with some VIA NE2k PCI clone NIC.

My intention was to use the slower one as a X terminal on the faster
machine.
These are the only two computers on the network.

It works but,  an enormous amount of collisions are detected. Collision led
on the hub is on almost all the time. It significantly slowes down the
communication.

How can I find out which one, out of two computers on my network, produces
those collisions and why ?
Should I try with different NICs / drivers ?

Thanks.

Boris




------------------------------

From: "Cedric Blancher" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Why so many collisioins ?
Date: Tue, 20 Jun 2000 10:30:16 +0200

"Boris Pran" <[EMAIL PROTECTED]> a �crit dans le message news:
8in99u$48a$[EMAIL PROTECTED]
> I have two Linux boxes, one is 2 x Celeron433 with D-Link DFE530TX NIC and
> the another is AMD5x86 - 160Mhz with some VIA NE2k PCI clone NIC.

D-Link DFE530TX is a 10/100Mbps ethernet adapter. The other card is a 10Mbps
one.

> My intention was to use the slower one as a X terminal on the faster
> machine.
> These are the only two computers on the network.

Fine.

> It works but,  an enormous amount of collisions are detected. Collision
led
> on the hub is on almost all the time. It significantly slowes down the
> communication.

If your HUB is a 10/100Mbps one, D-Link card is ten time faster than the
other. It has to slow down for the other card not to get flooded.

> How can I find out which one, out of two computers on my network, produces
> those collisions and why ?

Ethernet is in charge to slow down 100Mbps traffic and does this, according
to CSMA-CD principles, by generating collisions.
All collisions are produced by the slowest one, to slow down the fastest
one.

> Should I try with different NICs / drivers ?

Use a 100Mbps ethernet adapter on the other box too.




------------------------------

From: "Boris Pran" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Why so many collisioins ?
Date: Tue, 20 Jun 2000 10:42:14 +0200

I understand your points, except my hub is 10MB and 10/100MB card is in 10MB
mode, so no need to slowing it down in that part.

Having it both on 10MB does the slower computer still generates collisions
to slow down the connection or there is more sophisticated way than
generating collisions?

I can understand that the slow computer could be the bottleneck but I would
expect that some kind of acknowledgement would be done on the protocol or
even higher level - not flooding the slower computer with packets and
slowing down complete network.

Boris


Cedric Blancher <[EMAIL PROTECTED]> wrote in message
news:8ina1m$5k7$[EMAIL PROTECTED]...
> "Boris Pran" <[EMAIL PROTECTED]> a �crit dans le message news:
> 8in99u$48a$[EMAIL PROTECTED]
> > I have two Linux boxes, one is 2 x Celeron433 with D-Link DFE530TX NIC
and
> > the another is AMD5x86 - 160Mhz with some VIA NE2k PCI clone NIC.
>
> D-Link DFE530TX is a 10/100Mbps ethernet adapter. The other card is a
10Mbps
> one.
>
> > My intention was to use the slower one as a X terminal on the faster
> > machine.
> > These are the only two computers on the network.
>
> Fine.
>
> > It works but,  an enormous amount of collisions are detected. Collision
> led
> > on the hub is on almost all the time. It significantly slowes down the
> > communication.
>
> If your HUB is a 10/100Mbps one, D-Link card is ten time faster than the
> other. It has to slow down for the other card not to get flooded.
>
> > How can I find out which one, out of two computers on my network,
produces
> > those collisions and why ?
>
> Ethernet is in charge to slow down 100Mbps traffic and does this,
according
> to CSMA-CD principles, by generating collisions.
> All collisions are produced by the slowest one, to slow down the fastest
> one.
>
> > Should I try with different NICs / drivers ?
>
> Use a 100Mbps ethernet adapter on the other box too.
>
>
>



------------------------------

From: "Cedric Blancher" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Why so many collisioins ?
Date: Tue, 20 Jun 2000 11:19:20 +0200

"Boris Pran" <[EMAIL PROTECTED]> a �crit dans le message news:
8inape$c37$[EMAIL PROTECTED]
> I understand your points, except my hub is 10MB and 10/100MB card is in
10MB
> mode, so no need to slowing it down in that part.
>
> Having it both on 10MB does the slower computer still generates collisions
> to slow down the connection or there is more sophisticated way than
> generating collisions?

If both cards are in 10Mbps mode, there's no need any more for a slow down.

> I can understand that the slow computer could be the bottleneck but I
would
> expect that some kind of acknowledgement would be done on the protocol or
> even higher level - not flooding the slower computer with packets and
> slowing down complete network.

No. Network speed is up to ethernet layer to control.

But I don't think that your slowest computer could be flooded by a 10Mbps
network.



------------------------------

From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: Poll on /proc files
Date: Tue, 20 Jun 2000 10:36:05 +0100

Mathias Waack wrote:
> 
> Alan Donovan <[EMAIL PROTECTED]> writes:
> 
> > Mathias Waack wrote:
> [user process waits for a msg from a kernel driver]
> > > Canonical answer for this sort of problem is to spawn a thread in the
> > daemon that calls an ioctl that blocks in sleep_on() until the driver
> > wants to make the "callback". Then driver calls wake_up() and the
> > daemon thread continues and does the notification work.
> 
> I know this solution, but my daemon sleep most time in a poll, so it
> would be nice to simply add another fd to the list of fd it polls on.

Hmm.. You might be able to "subclass" the proc entry by specifying a
non-NULL ops field in the proc_dir_entry structure. I've not tried this,
it's only a guess. Might be worth taking a look at. The only textbook
way I can think of is to create another meta-device in your driver which
is just for polling on (as Mario pointed out). It's a bit cluttered
though. You could use the original ioctl method in another thread and
send a user-defined signal to unblock the polling thread with EINTR,
although that's also messy.


 
> > This is such a common question, it should be in the FAQ... er, that
> > is, if we had a FAQ :-)
> 
> Oh, I've got a deja vu ;)
> IIRC we've talked about this some weeks ago. If you want a faq, you must
> write a faq. Shall we start it? Maybe some poeple join us...

Yeah, why not?  I've already got some notes from the previous time
around. Just need a bit of web space I can write to -- let me check out
my ISP.


> BTW it was not an answer to my first question: is it possible to poll
> a /proc file?

No, it wasn't -- try the "subclassing" method though:

unsigned int my_poll(struct file *, struct poll_table_struct *)
{
 /* ... */
}

static struct file_operations proc_pollfile_operations = {
    lseek:  proc_file_lseek,
    read:   proc_file_read,
    write:  proc_file_write,
    poll:   my_poll,
};

struct inode_operations proc_pollfile_inode_operations = {
        &proc_pollfile_operations,
};

Then in your proc_dir_entry, make sure you do:

    ops: proc_pollfile_inode_operations


Not sure about the visibility of all these functions to modules. Might
be hacky.

Let me know how you get on!

cheers,

alan

-- 
========================================================================
  Alan Donovan     [EMAIL PROTECTED]    http://www.imerge.co.uk
  Imerge Ltd.      +44 1223 875265

------------------------------

From: "Roman A. Stepanov" <[EMAIL PROTECTED]>
Subject: Re: A strange problem using poll() systemcall
Date: Tue, 20 Jun 2000 15:22:47 +0400


Alan Donovan <[EMAIL PROTECTED]> wrote:
> "Roman A. Stepanov" wrote:
>
>
> to do something else).   If the hardware requires "polling" (here used
> in a slightly different sense to poll()), you will need to wait, send a
> command, try and receive a reply, wait again, etc etc. This is very
> inefficient and is the motivation for hardware that interrupts
> (synchronous serial HW _is_ in fact interrupting).
>

I have about twenty railway station tourniquets connected to computer via
RS-422/RS-232 converter. Each tourniquet is a passive device, I have to ask
it if it has a ticket inserted in the ticket check area and then if it's a
valid ticket I must send a command to open tourniquet. So I have to check
all tourniquets one by one _very_ fast because nobody wants to wait while
tourniquet is "thinking". I'm sending a command to the first touniquet,
waiting for answer, if it has a ticket, I send a command to open it, then I
have to check if the second one have a ticket and so on. Because the minimal
timeout I can set for serial port using termios struct is not small enough I
have to use poll() or anything else to check if I have any answer from
tourniquet. If I have no incoming data during about 5 ms I have to check the
next tourniquet.

> Nor do I. From what you've said, blocking in poll() for long periods
> should be ok.

I know my English is not good. What do you mean by 'blocking in poll()'? As
far as I understand poll() will block only with negative timeout.

Greetings,
Roman A. Stepanov



------------------------------

Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Why so many collisioins ?
From: [EMAIL PROTECTED] (Rick Matthews)
Date: Tue, 20 Jun 2000 12:22:25 GMT

Boris Pran <[EMAIL PROTECTED]> wrote:

>there is more sophisticated way than
>generating collisions?
>

Sorry, that's the way it works.

You can see the traffic count with ifconfig.



------------------------------

From: Espen Sand <[EMAIL PROTECTED]>
Subject: Driver devel (interruptible_sleep_on_timeout)
Date: Tue, 20 Jun 2000 14:22:51 GMT

Hi all,

I am in the process of moving some driver code from
a 2.0.x system to 2.2x. The driver reads data from external
HW which sends an interrupt each time it has prepared some. 
If there is no data pending when I want to read,
I do an interruptible sleep for a second. Normally new 
data will arrive long before the second has elapsed.

How should this be done in 2.2x? Is the 
interruptible_sleep_on_timeout() the preferred method? To
me it seems so, but how should I detect that a timeout has 
occurred or not? (the complier is not happy about the 
"current->signal & ~current->blocked" test below)



Here is how I did it in 2.0.x

/* wait for resonse */
current->timeout = jiffies + i960.readTimeout;
interruptible_sleep_on( &i960.waitQueue );
current->timeout = 0;
sti();
if( current->signal & ~current->blocked )
{
   /* New data has arrived */ 
   ...
}

/* The interrupt function */
static void i960_interrupt( int irq, void *dev_id, 
        struct pt_regs *regs )
{
    ....
    wake_up_interruptible( &i960.waitQueue );
    ....
}


--
Espen Sand

------------------------------

From: Bangnan Xu <[EMAIL PROTECTED]>
Subject: can I not get the value of a global variable in an interrupt handler?
Date: Tue, 20 Jun 2000 16:29:38 +0200

Dear all,

to test the interupt i need to have a initialized variable used in a
interrupt
 routing in linux kernel. But strange things have happen when i try to
do so.

unsigned int interruptvariable=5;

unsigned int interupt_handler(unsigned int irq, struct pt_regs *regs)
{
clear_irq();
interruptvariable=interruptvariable-1;
if (interruptvariable==4)
sound_routing();
}
 

in this case when an interrupt happens, sound_routing() will not be
executed;

But if i delete interruptvariable=interruptvariable-1; then 

unsigned int interruptvariable=5;

unsigned int interupt_handler(unsigned int irq, struct pt_regs *regs)
{
clear_irq();
if (interruptvariable==5)
sound_routing();
}
 
at this case the sound_routing() will be executed when an interrupt
happens.

I have no idea to thint about this problem.

-- 
Gruesse

Bangnan 
==============================================================================
Bangnan Xu                                               |     C   O   M
Communication Networks, Technical University of Aachen   |
--v-^-v-^-v-^-v--
Phone: +49-241-807925       Fax: +49-241-8888-242        |   N   E   T  
S
Email: [EMAIL PROTECTED]                         | RWTH Aachen,
Germany

------------------------------

From: eric keller <[EMAIL PROTECTED]>
Subject: Re: data acquisition boards
Date: Tue, 20 Jun 2000 09:34:54 -0400

goulmik wrote:

> Hi,
>
> I'm searching for any kind of informations about Linux and Data
> Acquisition boards
>

Do an internet search for Linux Lab Project or Comedi.
eric



------------------------------

From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: A strange problem using poll() systemcall
Date: Tue, 20 Jun 2000 15:47:27 +0100

"Roman A. Stepanov" wrote:

> I have about twenty railway station tourniquets connected to computer via
> RS-422/RS-232 converter. Each tourniquet is a passive device, I have to ask
> it if it has a ticket inserted in the ticket check area and then if it's a
> valid ticket I must send a command to open tourniquet. So I have to check
> all tourniquets one by one _very_ fast because nobody wants to wait while
> tourniquet is "thinking". I'm sending a command to the first touniquet,
> waiting for answer, if it has a ticket, I send a command to open it, then I
> have to check if the second one have a ticket and so on. Because the minimal
> timeout I can set for serial port using termios struct is not small enough I
> have to use poll() or anything else to check if I have any answer from
> tourniquet. If I have no incoming data during about 5 ms I have to check the
> next tourniquet.

Excuse me if this doesn't help you in your original problem, but if you
are really writing some code to manage railway turnstiles (I think that
must be what you mean by "tourniquet", at least in my dialect -- i.e.
ticket gate), I am curious to know why you are using linux.  The problem
you are trying to solve (in computer science terms) sounds simple but
demanding of very fast response, scalability and above all, very high
reliability, and I would have thought that Linux was not the best choice
for this sort of problem.


> > Nor do I. From what you've said, blocking in poll() for long periods
> > should be ok.
> 
> I know my English is not good. What do you mean by 'blocking in poll()'? As
> far as I understand poll() will block only with negative timeout.


To "block" means (informally) to take a substantial, potentially
infinite amount of time, to complete. poll() and select() block -- that
is their purpose. They block until EITHER the timeout period has expired
OR something has happened on at least one of the filesdescriptors.
Giving them an infinite timeout means they will never timeout and only
unblock when there is file activity.


HTH

alan

-- 
========================================================================
  Alan Donovan     [EMAIL PROTECTED]    http://www.imerge.co.uk
  Imerge Ltd.      +44 1223 875265

------------------------------


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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

Reply via email to