Linux-Development-Sys Digest #156, Volume #8     Mon, 18 Sep 00 16:13:13 EDT

Contents:
  Timer Interrupt (Jan Pietrusky)
  Re: Installing Win98, Win2000 and Linux on one PC?! ([EMAIL PROTECTED])
  I2C autodetecting and accessing (MJ Dainty)
  translate a driver from kernel-2.1 to kernel-2.2 ([EMAIL PROTECTED])
  X11, Netscape -xrm "X Resource" (Thomas Wright)
  Re: translate a driver from kernel-2.1 to kernel-2.2 (Kaz Kylheku)
  X11 Resources, Netscape (Thomas Wright)
  Re: Is it possible to invoke shell command using java application in linux?
  Multiple sockets on same port. (Jerome Tollet)
  Re: -lcrypt (B.Lim)
  Re: I'm in kernel land now! (Steve Helding)
  ipv6 tunneling in kernel 2.4.0-test8 ("Diego")
  64M buffer passed from user to kernel (lsnover)
  Re: translate a driver from kernel-2.1 to kernel-2.2 ("Norm Dresner")
  Re: interrupt HD access, how ? (ZIP-Prob.) (Dirk Schenkewitz)

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

From: Jan Pietrusky <[EMAIL PROTECTED]>
Subject: Timer Interrupt
Date: Mon, 18 Sep 2000 17:06:50 +0200

Hello,
I'm new in linuxprogramming. I'll use a timerinterrupt at my programm
every 100ms. How could I do that, if possible with a small example.
Thanks
jan
-- 
 ---------------------------------------------------------------------
| Dipl.-Ing.(FH) Jan Pietrusky             |                          |
|                                          | Tel: +49 (0) 3677 678331 |
| Institut fuer Mikroelektronik- und       | FAX: +49 (0) 3677 678338 |
| Mechatronik-Systeme                      |                          |
| Langewiesener Strasse 22, 98693 Ilmenau  |                          |
|                                          |                          |
|---------------------------------------------------------------------|
| MAIL/WWW: [EMAIL PROTECTED], http://www.imms.de/                |  
 ---------------------------------------------------------------------

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

From: [EMAIL PROTECTED]
Crossposted-To: alt.os.linux,comp.os.linux.setup,microsoft.public.win2000.applications
Subject: Re: Installing Win98, Win2000 and Linux on one PC?!
Date: Mon, 18 Sep 2000 15:11:09 GMT

In article <_46v5.2724$[EMAIL PROTECTED]
  "Pat Parsons" <[EMAIL PROTECTED]> wrote:
> I could be wrong, but I don't think win98 and 2000 will be able to
coexist.
> Won't they just install over each other?
>
> "Kasper Dupont" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > noodlez wrote:
> > >
> > > don't forget to create a linux swap partition as well as one
mounted
> > > as /home .
> > >
> > [...]
> >
> > There is a HOWTO descibing how a swap partition can be shared
> > between Linux and Win98. I don't know if it can be used by
> > Win2000 too.
> >
> > If it is of interest it is actually posible to run Win2000
> > under Linux using the VMWare PC-emulator. I think the
> > performance is quite good.
> >
> > --
> > Kasper Dupont
>
>
Symon at http://symon.da.ru/ will let you have up to 20 os's ,and let
you boot with any 4 of 36 partitions of your choice in any order.
And it does this without a dedicated partition.
Check it out, good stuff.


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

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

From: MJ Dainty <[EMAIL PROTECTED]>
Subject: I2C autodetecting and accessing
Date: Mon, 18 Sep 2000 15:33:51 GMT

Hi,

I'm trying to write a driver to use a Matrix Orbital LCD display over an
I2C bus, and I was wondering if anyone could offer any advice on how to
access it properly.

1) Is it possible to autodetect the device? Do I need to check for a
   specific "feature" of my hardware, or is there an I2C standard
   identifier, (akin to PCI), for each device? How do I find out how
   many buses to scan, etc.?

2) Failing that I can't autodetect, but *do* know the bus and slave
   address, is it as easy as opening the correct /dev/i2c-X device and
   ioctl'ing the slave address using the I2C_SLAVE function? What errors
   should I check for along the way?

Any pointers appreciated

Matt



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

From: [EMAIL PROTECTED]
Subject: translate a driver from kernel-2.1 to kernel-2.2
Date: Mon, 18 Sep 2000 16:07:13 GMT

How to translate the listed code from kernel-2.1 to kernel-2.2?
if( current->signal & ~current->blocked )
    return -ERESTARTSYS;

I find in asm/signal.h, signal is defined as a struct.


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

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

From: Thomas Wright <[EMAIL PROTECTED]>
Subject: X11, Netscape -xrm "X Resource"
Date: Mon, 18 Sep 2000 18:18:04 +0200

Hi,
I'm trying to configure something like the MS Windows (sorry, I said the

forbidden word) Active Desktop by simply running Netscape in Fullscreen
(actually over-screen because there is no kiosk mode) behind my other
applications, so I have a Webpage instead of a background image. I am
switching Users with su to have seperate configuration Files for my
Desktop Netscape and my usual Netscape. At the moment its looking pretty

cool!

I just have one problem:

I am using Fvwm95 as a window-manager (basically only the Taskbar and a
clock). Netscape is started as part of the initFunction (+ "I" Exec
Netscape &....). Of course I dont want my desktop-Netscape to show up in

the Taskbar, which is easily changed by putting the line 'Style
"Netscape"   WindowListSkip' in the ~/.fvwm95rc file. The problem is,
this also removes all other Netscape-occurances from the Taskbar (Not a
good thing). I have been trying solutions by calling stuff like
'netscape -xrm "Netscape*WindowListSkip: Yes/No"' but they had no
effect, I guessed beforehand they were wrong, but I don't know how these

X-Resources work (and yes, I've read the docs). Another thing I tried is

calling Netscape from a script (eg 'adesktop') and then adding 'Style
"adesktop"  WindowListSkip' to  ~/.fvwm95rc, didn't work either, because

Style "NAME" means the class name not the file name (damn).....

does anyone know a way of solving my problem ??

I've also got other not so important problems:
1. The Taskbar shows a Start-Button (like in Windows) even if I remove
all lines about the Menu (If you click on it nothing happens), is there
a way of removing it totally ???
2. A second thing is I want don't want to be able to left-click on my
Netscape-Desktop (I am using Frames), can anyone help me on that ?
3. I don't want to be able to quit Netscape by pressing Alt+q

thanks a lot,

Thomas Wright     ([EMAIL PROTECTED])




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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: translate a driver from kernel-2.1 to kernel-2.2
Reply-To: [EMAIL PROTECTED]
Date: Mon, 18 Sep 2000 16:25:20 GMT

On Mon, 18 Sep 2000 16:07:13 GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>How to translate the listed code from kernel-2.1 to kernel-2.2?
>if( current->signal & ~current->blocked )
>    return -ERESTARTSYS;

The procedure for finding this out is to look at how any one of the large
number of drivers in the kernel code have done it. Find a function in some
driver in a 2.0 kernel which contains the above test, and then look at the same
function in a 2.2 kernel to see how it's done there.  Use the source, Luke!

-- 
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: Thomas Wright <[EMAIL PROTECTED]>
Subject: X11 Resources, Netscape
Date: Mon, 18 Sep 2000 18:24:08 +0200

Hi,
I'm trying to configure something like the MS Windows (sorry, I said the

forbidden word) Active Desktop by simply running Netscape in Fullscreen
(actually over-screen because there is no kiosk mode) behind my other
applications, so I have a Webpage instead of a background image. I am
switching Users with su to have seperate configuration Files for my
Desktop Netscape and my usual Netscape. At the moment its looking pretty

cool!

I just have one problem:

I am using Fvwm95 as a window-manager (basically only the Taskbar and a
clock). Netscape is started as part of the initFunction (+ "I" Exec
Netscape &....). Of course I dont want my desktop-Netscape to show up in

the Taskbar, which is easily changed by putting the line 'Style
"Netscape"   WindowListSkip' in the ~/.fvwm95rc file. The problem is,
this also removes all other Netscape-occurances from the Taskbar (Not a
good thing). I have been trying solutions by calling stuff like
'netscape -xrm "Netscape*WindowListSkip: Yes/No"' but they had no
effect, I guessed beforehand they were wrong, but I don't know how these

X-Resources work (and yes, I've read the docs). Another thing I tried is

calling Netscape from a script (eg 'adesktop') and then adding 'Style
"adesktop"  WindowListSkip' to  ~/.fvwm95rc, didn't work either, because

Style "NAME" means the class name not the file name (damn).....

does anyone know a way of solving my problem ??

I've also got other not so important problems:
1. The Taskbar shows a Start-Button (like in Windows) even if I remove
all lines about the Menu (If you click on it nothing happens), is there
a way of removing it totally ???
2. A second thing is I want don't want to be able to left-click on my
Netscape-Desktop (I am using Frames), can anyone help me on that ?
3. I don't want to be able to quit Netscape by pressing Alt+q

thanks a lot,

Thomas Wright     ([EMAIL PROTECTED])




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

From: <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.java,comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer,comp.os.linux.development.apps,comp.unix.programmer,linux.redhat
Subject: Re: Is it possible to invoke shell command using java application in linux?
Date: 18 Sep 2000 16:33:03 GMT

In comp.lang.java Richard Lim <[EMAIL PROTECTED]> wrote:
> I am currently programming a GUI java application that run in kde or gnome
> to invoke certain shell command in linux such as chmod, ls, less etc.
> Is it possible to invoke shell command using java application in linux, are
> there any restrictions.
> please advice.

One thing I have learned is that in general you need to write to STDOUT and read
from STDIN with separate threads to avoid deadlocks.  The deadlock occurs if you
try to read and/or write more than a certain amount (empirically it is around 4k).

--arne

DISCLAIMER:  These opinions and statements are those of the author and
do not represent any views or positions of the Hewlett-Packard Co.

> regards,
> richard lim



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

From: Jerome Tollet <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Multiple sockets on same port.
Date: Mon, 18 Sep 2000 19:03:29 +0200

Hello,

a)
I would like to make two processes waiting for UDP messages on the same
port. I used the socket option SO_REUSEADDR, but it seems that one only
process receives the message (the other continues to sleep).
Is it possible to make linux duplicates received packets for each
process waiting ?


b)
If it isn't possible, i think it i can program another software which is
waiting on the port and when a packet arrive, it duplicates messages :


    P2   P3
     \  /
      \/
      P1
      |
===============
      |
    KERNEL


My problem is that when P2 and P3 receive messages sent by P1 with the
recvfrom() primitive, the fromaddr is the P1 one. I tryed to bind P1 on
a fake adresse but i get an error message : "Cannot assign requested
address".

So my questions are :
-how to send a packet with a fake source address ?
-Is it possible to make linux duplicate received packets for multiple
applications ?

Thanks a lot for help

=============
Jerome Tollet
[EMAIL PROTECTED]
=============

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

From: [EMAIL PROTECTED] (B.Lim)
Subject: Re: -lcrypt
Date: 18 Sep 2000 17:00:54 GMT

Well, I already have glibc install on Debian 2.2 and libcrcrypt
is present.

On Mon, 18 Sep 2000 10:25:22 -0400, mconroy <[EMAIL PROTECTED]> wrote:
>Ben,
>
>I believe lcrypt is "libcrypt" which you should find in
>/usr/i386-glibc20-linux/lib/ as a .so.  You'll also find it under /usr/lib,
>and /lib.  This holds for RH 6.1 and 6.2, though.  Not sure what Debian
>does.  You ought to be able to grab these from RedHat's site, though, if you
>don't have them.
>
>Cheers,
>Mike
>
>
>B.Lim wrote in message ...
>>Can anyone tell me where I can get 'lcrypt'? I'm trying to
>>compile util-linux to enable serpent encryption support in
>>losetup and mount so that I can use the loopback encrypted
>>file system. When doing a './configure' it states that I
>>need lcrypt. What library does lcrypt belong to? I'm running
>>Debian 2.2 and would like to know if there's a deb package of
>>that library that has 'lcrypt'.
>>
>>Thanks.
>>Benjamin Lim.
>>
>
>


-- 
B.Lim - http://unixbox.freewebsites.com
GNUPG key fingerprint = C94E C318 90D5 38F7 EF1A  657B DDC9 7BD7 5BC2 AE1E 
"Security through obscurity is an unworkable principle."

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

From: Steve Helding <[EMAIL PROTECTED]>
Subject: Re: I'm in kernel land now!
Date: 18 Sep 2000 17:32:37 GMT
Reply-To: [EMAIL PROTECTED]

Actually, I am using the module approach but I patched the kernel based on a
page in Rubini's book (pg.174) that gives code to keep the 15-16 Mb region
reserved in memory.  Turns out that the module I developed still works without
the kernel patch.  Correct me if I'm wrong but it seems that most of the
documentation available is based on older versions of the kernel.  Rubini's
book is based on 2.0, Beck's Linux Kernel Internals is based on 2.0 and all
the website's I've looked at are 2.0 based and have disclaimers as to accuracy
of the information.  It definitely seems that a solid understanding of the
kernel requires going through the basic source code.  If anyone knows of a
good source of information for 2.2 versions please post them.

As for the suggestion of not mounting unneeded partitions I think it's a very
good idea.  I've found that if for some reason an address is wrong you can
corrupt your disk files.  Fortunately I keep everything backed up on a
separate server.


Robert Redelmeier wrote:

> Steve Helding wrote:
> >
> > Gave up on trying to write to the ISA board at 15 M in user mode.  Got a
> > crude device driver writing to the board.  Flashing the lights so I know
> > it's talking to it.  Gettin' in deep now.  Talk about a clusterf* having
> > to patch the kernel to do this.  I'm using a bzdisk/floppy with the
> > Linux kernel patch so I don't screw up my development system but soon
> > I'll need to make it a permanent patch to the hard drive.  Sheesh, what
> > a pain.  I need to ask my boss for a raise.
>
> Why patch the kernel?  That's the old & hard way.  Just write a simple
> kernel module.  0:edit-compile-insmod-debug-rmmod / jnc 0b.  No reboots
> unless you goof badly.  The current Assembly Programmers Journal
> http://asmjournal.freeservers.com/ gives an excellent overview, and
> good references for `c`.
>
> You'll probably want to map that ISA board as /proc/something .
> Very easily done.  Otherwise, kernel IO is very restricted.
>
> As for disk safety, make sure you umount anything not needed (/home),
> and an unmounted back-up partition would take it a step further.
>
> -- Robert
>
> -- Robert


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

From: "Diego" <[EMAIL PROTECTED]>
Subject: ipv6 tunneling in kernel 2.4.0-test8
Date: Mon, 18 Sep 2000 19:28:40 +0200

Hello,
I use a tunnel of ipv6 (www.ipv6.ircd.it).
When I run this script in kernel 2.2.17, it work...
=================================================
## script for tunnel-ipv6 ##
ifconfig sit0 up
ifconfig ippp0 add 3ffe:1001:200:b::8d/127
ifconfig sit0 tunnel ::194.247.166.147
ifconfig sit1 up
route -A inet6 add 2000::/3 gw fe80::194.247.166.147 dev sit1
=================================================
but in kernel 2.4.0-test8 don't work, infact it give me this error:

SIOCSIFDSTADDR: No buffer space available
SIOCADDRT: Invalid argument

Diego



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

From: lsnover <[EMAIL PROTECTED]>
Subject: 64M buffer passed from user to kernel
Date: Mon, 18 Sep 2000 18:48:50 GMT

I'm a newbie and need help.
I need to allocate a 64MB of contiguous memory which needs to be mapped
into user memory.  Then the buffer will be passed to a kernel module
for DMAing to a custom PCI board.  I've heard one approach is to use
kmalloc() and copy_to_user().  Is this my only option?  Does
copy_to_user() create a second copy of the buffer, hence creating 2 64MB
buffers?

Any other suggestions?

Lisa


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

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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: translate a driver from kernel-2.1 to kernel-2.2
Date: Mon, 18 Sep 2000 19:15:45 GMT

Start by reading the page(s) at
    http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.2.html

Norm

<[EMAIL PROTECTED]> wrote in message news:8q5eiv$nen$[EMAIL PROTECTED]...
> How to translate the listed code from kernel-2.1 to kernel-2.2?
> if( current->signal & ~current->blocked )
>     return -ERESTARTSYS;
>
> I find in asm/signal.h, signal is defined as a struct.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.


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

From: Dirk Schenkewitz <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: interrupt HD access, how ? (ZIP-Prob.)
Date: Mon, 18 Sep 2000 20:51:28 +0200



Stolm�r Tam�s wrote:
> 
> Dirk Schenkewitz wrote:
> 
> > Hi All,
> >
> > Is there a way to make accesses to _locally_mounted_ discs interruptible ?
> > 
> > The problem is: when I acces a ZIP drive, it sometimes happens that the drive
> > goes into a loop of rhythmic stepping and such, over and over, ...

Let me point out that the zip drive now appears to the linux system as if you
have cut off the parallel cable - it accepts no data anymore and answers to
nothing.

> > ... until I pull and replug its power (It's a parallel ZIP, accessed via ppa).
> > After that, the ZIP-drive calms down, but now the linux system hangs completely
> > - no console switching, no shutdown via alt-ctrl-del, only hard reset works.
> > ...
> > I know that nfs-mounts can be made interruptibe - is there a solution for
> > local HDs ?
> 
> fuser -mv /mnt/zip will show you which pids are using the mount point.
> So you can kill them.

Thanks for answering !
But that is no option: after the the zip-drive has gone berzerk, the system
hangs completely - it accepts NO key-press at all !- so I cannot switch to
another console and do what you say :-(

> After that do a sync if you want, so the system will write out all puffered
> data. Somehow it's possible to disable caching on specified devices.
> 
> Then umount, and then
> echo "remove-scsi-singledevice 0 0 0 0" > /proc/scsi
> then you can discoonect the device safely.

Well, I did not know the last part, but anyway, I get no chance to do so, because
the system (or maybe better, the kernel) waits for the zip-drive to finish its
(uninterruptible) operation - and since the zip-drive never reports that it has
finished its job, the system waits forever....
This behaviour is useful in most cases: so-called "atomic" operations (like 'mv')
should not be interrupted, so it is impossible that such an operation is half-done,
which might leave the filesystem in an unconsistent state. But in case of hardware
failure, the system just plays dead.
'man mount' says under "Mount options for nfs" (among other stuff):
       hard   The program accessing a file on a NFS mounted file system will hang
              when  the  server  crashes.  The  process  cannot be interrupted or
              killed unless you also specify intr.  When the NFS server  is  back
              online  the  program  will  continue undisturbed from where it was.
              This is probably what you want.
"The program accessing a file on a (locally) mounted file system will hang when
the hardware stops responding" - that is exactly the problem. So, if either
a) there is a way to disconnect and reconnect the zip drive WITHOUT having the
   system loose all contact to it, or
b) there is a way to simply interrupt the access (which would be similar to having
   'intr' for a local filesystem), disconnect the zip-drive, then do all you des-
   cribed above, then reconnect the zip-drive and repeat the interrupted access,
I would be all happy. (Even if reconnecting does not work, I would be happier than
I am now.)

I would be rather surprised if nobody had seen that type of problem before me.
If that would be true, there is nothing left than hacking the kernel by myself,
but then comes the next question: where to start ?

Anyway, Many Thanks for Your answer and sorry for the delayed reaction - I was busy
with other stuff (and I nearly abandoned all hope to get an answer for this non-
trivial question. :-/ )

Cheers
        dirk

-- 
Dirk Schenkewitz 

InterFace AG                 phone  +49 (0)89 / 610 49 - 126
Leipziger Str. 16            fax    +49 (0)89 / 610 49 - 85
D-82008 Unterhaching         
http://www.InterFace-AG.com  mailto:[EMAIL PROTECTED]

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


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