Linux-Development-Sys Digest #73, Volume #8      Thu, 10 Aug 00 11:13:16 EDT

Contents:
  semaphore function semop fails with error EINTR ([EMAIL PROTECTED])
  Determin whSignal transmitted by a single key on a keyboard (jac0b)
  Re: share libraries in Linux (Jan Wielemaker)
  Re: What is the difference between soft link and hard link? (Kevin Lacquement)
  how to convert filename to inode inside kernel? (.)
  Re: Camera Application software run on Linux PC (bill davidsen)
  Re: socket call in driver module ("Sake")
  Re: Mount of Zip doesn't work since linux-2.4.0-test2 (softrat`)
  problem about arch/i386/kernel/traps.c ("WSH")
  do_signal?? ("WSH")
  Re: problem about arch/i386/kernel/traps.c (Kaz Kylheku)
  Re: do_try_to_free_pages failed (Johannes von Loewis)
  Re: What is the difference between soft link and hard link? (Johan Kullstam)
  KDE/QT callbak function ([EMAIL PROTECTED])
  kmail and realtek (alik)
  PC-tel modem (".ME.")
  how to find signal frame (Manfred Meyer)
  Re: How to develope a system performance program (Andy Duplain)
  Re: Camera Application software run on Linux PC (Jan Panteltje)

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

From: [EMAIL PROTECTED]
Subject: semaphore function semop fails with error EINTR
Date: Wed, 09 Aug 2000 20:07:33 GMT

Hi ,
 I have run into a problem where the semop function fails in my user
code.
 Here's the full scenario,
 I writing a driver and its support application.
 the driver uses wait queue for back halves but doesnot use any
blocking mode for communication between app and driver.

 the application has 3 threads
  the first sends in a sequence of commands to the hardware
  second polls driver for events, when found puts them in a list
  third thread processes the events in the above said thread.

the second and third thread share a semaphore.
In the third thread I find that the semop operation at times(when thei
r multiple events coming in) fails. error code : 4 (EINTR)

If i send in only 1 command to the hardware, then wait and process the
event, everything works fine. But the problem occurs when sending
multiple commands.

Can someone please tell me what this error is and how to solve it.

please help

regards
jeseem


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

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

From: jac0b <[EMAIL PROTECTED]>
Subject: Determin whSignal transmitted by a single key on a keyboard
Date: Wed, 09 Aug 2000 16:35:30 -0400

Does anyone know of a prog or way of determining what signals are sent
by what keys on a keyboard? I.E. the 'del' key I think sends ^?.

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

From: [EMAIL PROTECTED] (Jan Wielemaker)
Subject: Re: share libraries in Linux
Date: 9 Aug 2000 19:59:12 GMT

In article <8msb45$25a$[EMAIL PROTECTED]>, Peter Huang wrote:
>Is there any way that I can allow different processes using a share library
>to share resources,

This is not related to shared libraries in Unix.  You may wish to have a
look at the shared memory stuff (see shmget() for a starting point).

Indeed you can also use a deamon process to hold the common value.  How depends
on the details.  If the processes are childs of some master process you can
create a pipe before forking.  Otherwise you'll have to use UNIX or INET domain
sockets for the communication.

Finally you can use a file, either using mapping or read/write with proper
locking.

For short, it depends on the details: how do the processes relate as well as
performance and locking requirements.

        --- Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jan Wielemaker                
SWI, University of Amsterdam  
E-mail: [EMAIL PROTECTED]    

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

From: Kevin Lacquement <[EMAIL PROTECTED]>
Subject: Re: What is the difference between soft link and hard link?
Date: Wed, 09 Aug 2000 20:48:00 GMT

Mario Klebsch wrote:
<SNIP>
> 1st link is the directory (stored in its parent dir).
> 2nd link is '.' stored in the directory
> 3rd, 4tt, .. link is '..' stored in each child direcory.

Is this true for the root directory as well?  I don't see that
it would have the first link you describe here.

Cheers,
Kevin

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

From: . <[EMAIL PROTECTED]>
Subject: how to convert filename to inode inside kernel?
Date: Wed, 9 Aug 2000 23:41:30 +0200


Hi,

I'm replacing the sys_open call with my own version.
Inside my_sys_open(filename, flags, mode) I need to find out what device 
(major+minor) the file "filename" resides on.

My attempt was to copy the string filename to kernel space and then get 
the corresponding inode using namei().
Problem is, namei() always returns an EFAULT (-14).

Can anyone please help me out with a working piece of code that gives me 
the minor and major number of the device where "filename" sits?
Could it be a problem, that "filename" often is not a full path (e.g. 
../somedir)?


my code:

asmlinkage int my_sys_open(const char *filename, int flags,                  
int mode)
{
  int i = 0;
  char ch='\0';
  char name[255];
  struct dentry *dentr=NULL;

do {
get_user(ch, filename+i);
        name[i++]=ch;
    } while (ch != 0 && i<255);
    name[i]='\0';
    printk("�%s�\n",name);
    
dentr = namei(name);
printk("%p\n",dentr); /* returns -14, EFAULT */
  
  }



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

From: [EMAIL PROTECTED] (bill davidsen)
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.networking,comp.os.linux.setup
Subject: Re: Camera Application software run on Linux PC
Date: 9 Aug 2000 22:41:15 GMT


In article <[EMAIL PROTECTED]>,
Jan Panteltje <[EMAIL PROTECTED]> wrote:

| Only on par port and with the Creative webcam II, that is what I wrote.
| And not so much conferencing, but just internet connection.
| http://www.panteltje.demon.nl/mcam/

  Is the hardware still available? I have several webcams which I
ordered only to find that the model had changed, and by the time there
was Linux support the camera was out of production.

  The latest is a something-webcam-VC from Logitek (IIRC) which I got
instead of what I ordered. Fortunately that stuff makes nice Christmas
presents.

-- 
bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
"Anything worth doing is worth doing to excess."
        -- Fat John (R.I.P.)

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

From: "Sake" <[EMAIL PROTECTED]>
Subject: Re: socket call in driver module
Date: Wed, 9 Aug 2000 20:53:40 -0400

There are two possible reasons for no answers offered to this question:

1) it's really a dumb question.

2) no body really knows except Linus who may be too busy to answer.

Sake <[EMAIL PROTECTED]> wrote in message
news:8mal24$6qm$[EMAIL PROTECTED]...
> Hi gurus,
>
> I asked this question several times, no answer so far.
> Here it is again:
>
> I want to use the RAW socks to implement a transport protocol
> that is slightly different from UDP. And I want to make it a driver module
> instead of a user space appl/server.
>
> Question is: how do I call the socket functions from within a driver
module
> ?
>
> Please help and thanks in advance.
>
>
>
>



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

From: softrat` <[EMAIL PROTECTED]>
Subject: Re: Mount of Zip doesn't work since linux-2.4.0-test2
Date: Wed, 09 Aug 2000 18:58:25 -0700

bill davidsen wrote:
> 
<snip>
 five years and then calling the same color purple because you like the
> sound of it.
> 
You probably need to update your package modutils. Documentation/Changes
for kernel 2.4.0-test5 recommends version 2.3.10 or later. I am using
version 2.3.14-1.

-- 
the softrat
mailto: [EMAIL PROTECTED]
---
Uncertain fortune is thoroughly mastered by the equity of the
calculation.
- Blaise Pascal

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

From: "WSH" <[EMAIL PROTECTED]>
Subject: problem about arch/i386/kernel/traps.c
Date: Thu, 10 Aug 2000 11:58:45 +0800

hello everyone
    I had some question when I traced source. If possible, please give me
some answer....

(1)in traps.c, when we set IDT, all the entry in IDT are of three types:
    system_gate,trap_gate,call_gate
--call_gate is just for lcall7(iBCS2)
--system_gate and trap_gate are for all the other ones and they are all
"trap gate" in intel architecture(the only difficulty is DPL)

but there is no "interrupt gate" type in IDT.
does it mean we can RE-ENTRANT any interrupt handler?
<for example> if process A is handling int 14--page_fault and something
happened--time clock, then we should be interrupted to service time clock
first then go back to continue page_fault??even the time is out and A should
be switch to other process?

ps in Vahallia's Unix internals, p23, he sayed: "the unix kernel is
re-entrant, meanin that several processes may be involved in kernel activity
concurrently" . Does he mean what I saied?



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

From: "WSH" <[EMAIL PROTECTED]>
Subject: do_signal??
Date: Thu, 10 Aug 2000 12:17:08 +0800

hi
in the last part of do_signal(), we should check whether we come from a
system call. the code is :

if(regs->orig_eax>=0){
    if(regs->eax==-ERESTARTNOHAND||.........){
        regs0>eax=eax=regs->orig_eax;
        regs->eip-=2;
    }
}

the ways I know we can enter do_signal() are from ENTRY(system_call)(when we
are to return from system call to user mode) and two system calls.
but under these conditons, the orig_eax is not 0,  especially when we enter
from ENTRY(system_call). The flow is here, orig_eax was untouched.....

 ENTRY(system_call)
         pushl %eax                      # save orig_eax
         SAVE_ALL
         GET_CURRENT(%ebx)
         cmpl $(NR_syscalls),%eax
         jae badsys
         testb $0x20,flags(%ebx)         # PF_TRACESYS
         jne tracesys
         call *SYMBOL_NAME(sys_call_table)(,%eax,4)
         movl %eax,EAX(%esp)             # save the return value
         ALIGN
         .globl ret_from_sys_call
         .globl ret_from_intr
 ret_from_sys_call:
         movl SYMBOL_NAME(bh_mask),%eax
         andl SYMBOL_NAME(bh_active),%eax
         jne handle_bottom_half
 ret_with_reschedule:
         cmpl $0,need_resched(%ebx)
         jne reschedule
         cmpl $0,sigpending(%ebx)
         jne signal_return
 restore_all:
         RESTORE_ALL

         ALIGN
 signal_return:
         sti                             # we can get here from an interrupt
handler
         testl $(VM_MASK),EFLAGS(%esp)
         movl %esp,%eax
         jne v86_signal_return
         xorl %edx,%edx
         call SYMBOL_NAME(do_signal)
         jmp restore_all

 why is it ok? or anything I lost??
please help me, thank you.....



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: problem about arch/i386/kernel/traps.c
Reply-To: [EMAIL PROTECTED]
Date: Thu, 10 Aug 2000 05:04:16 GMT

On Thu, 10 Aug 2000 11:58:45 +0800, WSH <[EMAIL PROTECTED]> wrote:
>ps in Vahallia's Unix internals, p23, he sayed: "the unix kernel is
>re-entrant, meanin that several processes may be involved in kernel activity
>concurrently" . Does he mean what I saied?

It is true; however that's not what reentrant means. Several processes may be
involved in kernel activity, but that only makes the kernel thread-safe.
If the kernel was reentrant, then an interrupt service routine could execute
arbitrary system calls without ill effects.

Traditional UNIX kernels are not only not reentrant, but they are
non-preemptive, meaning that kernel code is cooperatively multitasked. 
Support for SMP is hacked into this model. Linux is no exception.

-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

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

From: Johannes von Loewis <[EMAIL PROTECTED]>
Subject: Re: do_try_to_free_pages failed
Date: 10 Aug 2000 10:52:55 GMT
Reply-To: [EMAIL PROTECTED]

marian <[EMAIL PROTECTED]> wrote:
> Since I compiled and installed kernel 2.2.17pre5 I receive from time to
> time the message:

> kernel: VM: do_try_to_free_pages failed for kswapd
>      or
> kernel: VM: do_try_to_free_pages failed for pine

I used to have the same problem after going from 2.2.14 to 2.2.16 (the
SuSE version). Both, the binary provided by the SuSE ftp server as well as
the one I compiled myself showed such behavior. On the other hand this
does _not_ seem to be a problem being specific to that particular kernel,
since I was told that it appears with the standard Linux 2.2.16 kernel
too.

Fortunately, on my box (586, 32MB, i.e, not very much memory!), it
disappeared after I installed a standard 2.2.16 kernel.

> What does it mean? Is it dangerous?

I don't know, what exactly the messages mean, but I observed that somtimes
the applications for which do_try_to_free_pages failed, got killed. This
may become dangerous or at least unpleasant, especially, when it happens
to X.

> Or it simply mean that I have not enough memory? (I have 16MB RAM)

I suspect, this is some sort of kernel bug, which tends to appear the more
frequently, the less memory you have. I guess, you can make it occur by
starting lots of huge applications. It seems somehow related to
swapping... at least this was my impression.

Johannes

-- 
Johannes von Loewis
Institut fuer Regelungs- und Steuerungstheorie, 
Technische Universitaet Dresden, Tel. (0351) 463 3268


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

Subject: Re: What is the difference between soft link and hard link?
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 10 Aug 2000 08:21:15 -0400

[EMAIL PROTECTED] writes:

> On Tue, 08 Aug 2000 17:12:34 +0200 Josef Moellers 
><[EMAIL PROTECTED]> wrote:
> 
> | Yi-Hsiu Chou wrote:
> |> 
> |> Hi..
> |>    I want to know what is the difference between soft link and
> |> hard , and if they will use inode ?
> |
> | A soft link is a file which contains a pathname which will be used to
> | further search for the file.
> | A hard link is just an additional name for the same inode.
> 
> Some people will miss the concept of how a Unix filesystem is built,
> and how this relates to hard links.  I hope this explanation will help:
> 
> Most Unix filesystems start with an array of inodes on disk.  The inodes
> are structures that describe file objects of all types, and are the
> starting point to find the data.  However, inodes contain no names.
> They are referenced directly by number.
> 
> Some of the file types are directories.  A directory is a list of names
> with a number which points to the inode.  A hardlink is a misnomer which
> really describes a situation where 2 or more names, which can be in the
> same directory or in different directories, refers to the same inode.
> Each such name is equal to any other; there is no superior/inferior
> relation between them.
> 
> Any hardlink name can be removed at any time.  Doing so only removes
> the name reference, not the actual file, until the very last name is
> removed.  The inode keeps a counter of the number of "links" it has,
> so when the count reaches zero, the file is gone.
> 
> If a file has the name "abc", and you make a hardlink as "xyz" by doing:
>   ln abc xyz
> there are now 2 names for the original inode.  You can now remove "abc":
>   rm abc
> and the file remains, but under only the name "xyz".
> 
> Since each different partition/filesystem has its own inode numbers,
> any inode reference has to be within the same filesystem.  If you have
> just one big partition/filesystem, then you have no limitations.  But
> if you have split up the file tree into multiple filesystems, then the
> name sharing is limited to within the same filesystem.  Symbolic, or
> "soft" links, are how one gets around that limitation.  Symbolic links
> are sort of like a sign that says "I've moved, find me at this other
> location" but with one difference, you keep going back to the same place
> every time.  If the pointed-to file is removed, the it is gone, but the
> symbolic link is still there, pointing into thin air.  If the symbolic
> link is removed first, the pointed-to file is not affected.
> 
> Directories cannot be hardlinked,

yes they are.  they just can't get *extra* hardlinks.

> that is, they cannot have more than
> one name.

but they do.  e.g., consider

/tmp/foo
/tmp/foo/one
/tmp/foo/two
/tmp/foo/three

in /tmp, it's called "foo"
in /tmp/foo, it's "."
in /tmp/one, it's ".."
&c

in this case, foo has 5 hard links.  try ls -l and see.

> because some nasty things happen if they do (there are ways
> to force this, but don't try unless you know how to clean up the mess).
> Symbolic links, however, work fine for directories.
> 
> -- 
> | Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
> | phil  (at)  ipal.net +----------------------------------------------------
> | Dallas - Texas - USA | [EMAIL PROTECTED]

-- 
J o h a n  K u l l s t a m
[[EMAIL PROTECTED]]
sysengr

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

From: [EMAIL PROTECTED]
Subject: KDE/QT callbak function
Date: Thu, 10 Aug 2000 12:34:43 GMT

Hi ,

i have a pipe file describtor.. how can i install a callback function
that can handle the event of incoming data to that pipe. i am using
KDE /QT

thanks!


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

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

From: alik <[EMAIL PROTECTED]>
Subject: kmail and realtek
Date: Thu, 10 Aug 2000 15:37:13 +0200

hi, i have some trouble with linux-mandrake 7.1 :

1) i am trying to get kmail run on my linux-mandrake box
   but i have a strange error exit massege :
   "kmail got signal 11"
   is there i should do to make it work ?

2) there seems to some problem with my
   realtek 8029 nic under linux.

   when i just installed linux it worked great but
   recently i enetered the network configuration and
   set the irq to 10. (why i did it don't ask me)

   after that linux has some trouble to bring up
   the eth0 interface and the point is
   i can't change the irq back to nothing
   because the linux DrakConf all the time
   returns it to 10.

  is there some manual option to do it?



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

From: ".ME." <[EMAIL PROTECTED]>
Subject: PC-tel modem
Date: Thu, 10 Aug 2000 15:29:15 +0200

Hi ...

i've got mysef a notebook with one of them PCtel modems in it ...
It is in conjuntion with a C-media soundcard.

I have downloaded some drivers from
www.gps.caltech.edu/~stone/pctel
And the drivers compile ok, but neither of them work !
In the readme's it says they are made for a Elite/Sis mainboard, but as far
as i know, i've got a BX chipset board ....
Please, if someone knows a working driver, or knows hot to make these work,
help me !!

Thanx,
siemon

[EMAIL PROTECTED]



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

Date: Thu, 10 Aug 2000 16:17:04 +0200
From: Manfred Meyer <[EMAIL PROTECTED]>
Subject: how to find signal frame

i'm writing a new syscall. how can i find out if that syscall has been
invoked in a signal handler
and if so, how can i find it's signal frame?

thanks,
manfred

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

From: Andy Duplain <[EMAIL PROTECTED]>
Subject: Re: How to develope a system performance program
Date: Thu, 10 Aug 2000 14:18:37 GMT

In article <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> Hi,
>
> I am writing a program that gets the system performance data from
Linux.
>
> Those data include CPU usage, process status, memory usage, ..etc.
> What kind of APIs should I use?
> Thanks.
>
> agnes

I'm no expert, but you could look at the (text) files in /proc; you
only need to then parse the text output and present it how you like.

--
Andy Duplain, <andy@trojanco-demon-co-uk>  (Dashes are Dots...)


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

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

From: [EMAIL PROTECTED] (Jan Panteltje)
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.networking,comp.os.linux.setup
Subject: Re: Camera Application software run on Linux PC
Date: Thu, 10 Aug 2000 14:49:12 GMT

>
>In article <[EMAIL PROTECTED]>,
>Jan Panteltje <[EMAIL PROTECTED]> wrote:
>
>| Only on par port and with the Creative webcam II, that is what I wrote.
>| And not so much conferencing, but just internet connection.
>| http://www.panteltje.demon.nl/mcam/
>
>  Is the hardware still available?
No I think not, and this is the eternal problem indeed.
It takes time to write a app like that, and it takes just as much time to get
the data sometimes, if you can get it at all, for the chips used.
This is an area that manufacturers should realize would help increase sales.
Linux is not small (number of users).
If they released specs to developers, a lot more could be done, and a lot better.
Or even released Linux versions of their software.
Probably there is some fear for giving away secrets to the competition...
Last version I heard was the Creative Webcam III, but different chips are used.
Vision UK has been very helpful in realeasing data (they make the sensor and the
chipset) for the webcam II.
Without their help i could not have written mcam.
Ask in the webcam4linux or maybe the video4linux mailing lists on the satus of
available software for web cams?
Of cause these programmers like me cannot go buying each new model that comes
out either...
So it is up to the manufacturers really to jump into this with Linux software.
Jan

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


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