Linux-Development-Sys Digest #421, Volume #8     Tue, 16 Jan 01 09:13:15 EST

Contents:
  Re: Ansi C++ forbids implicit conversion from 'void *' in argument passing (Tim 
Roberts)
  Re: double to byte stream convert ("O.Petzold")
  Re: double to byte stream convert (Josef Moellers)
  system halts at exchange with ISA (salikova)
  ldconfig error message ("Guennadi V. Liakhovetski")
  Re: Problems compiling programs with new 2.4 kernel ("Guennadi V. Liakhovetski")
  Re: ldconfig error message (Andreas Jaeger)
  Re: How to set r/w error conditions in a device driver? (Kasper Dupont)
  initrd problems (Mats Liljegren)
  Re: Problem w/ tty modes? (Kasper Dupont)
  module kernel version problem ("KPG")
  Re: Keyboard input (Kasper Dupont)
  Re: Developing a mouse replacement driver. (Kasper Dupont)
  Re: Kernel -> user mode data tranfer  ???? (Kasper Dupont)
  2.4.0 ISDN Problems ("Morten Bøhmer")
  su cannot run /bin/bash? was: 2.2.18 won't boot diskless (Ulrich Hahn)
  Re: 2.4.0 loop device ([EMAIL PROTECTED])

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

From: Tim Roberts <[EMAIL PROTECTED]>
Subject: Re: Ansi C++ forbids implicit conversion from 'void *' in argument passing
Date: Mon, 15 Jan 2001 23:30:35 -0800

"Victor Morales" <[EMAIL PROTECTED]> wrote:

>I'm using C++ with Posix linux threads (lib6). I've a problem when passing
>(void *) &my_function to pthreads_create function.Compiler (g++) says: "ANSI
>C++ forbids implicit conversion from 'void *' in argument passing".
>Does anybody know what is the problem?

The other posters gave you the correct reason; strict C++ does not allow
you to cast a pointer-to-function to a pointer-to-non-function.  This
should fix it:

  ((void*)(*)(void*)) my_function
or
  typedef (void*)(*PTHREADFUNC)(void*);
     ... PTHREADFUNC(my_function) ...
--
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.

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

From: "O.Petzold" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: double to byte stream convert
Date: Tue, 16 Jan 2001 09:56:37 +0100

Hello,

thanks to all for the answers. I found the following (principle)
solution:

#include <iostream>
#include <ieee754.h>

int main()
{
    double fp = +1.01234523e34;
    union ieee754_double fp_in, fp_out;

    fp_out.d = fp;

    unsigned int negative = fp_out.ieee.negative;
    unsigned int mantissa0 = fp_out.ieee.mantissa0;
    unsigned int mantissa1 = fp_out.ieee.mantissa1;
    unsigned int exponent  = fp_out.ieee.exponent;

    cout << "out_fp = " << fp_out.d << endl;
    cout << "negative: " << negative << endl;
    cout << "mantissa0: " << mantissa0 << endl;
    cout << "mantissa1: " << mantissa1 << endl;
    cout << "exponent: " << exponent << endl;

    fp_in.ieee.negative = negative;
    fp_in.ieee.mantissa0 = mantissa0;
    fp_in.ieee.mantissa1 = mantissa1;
    fp_in.ieee.exponent = exponent;

    cout << "in_fp = " << fp_in.d << endl;
}

Well, I've no idea how this is portable to the RFC1832. If I study the
ieee754 header, there are #ifdefs for different endians, therefore my
conclusions: it should be. Different targets are able to rebuild the
double
from splitted components regards to their fp representation.
Maybee I should convert the uint to network byte order for transport.
With the sprintf solution I miss the precision on some case. On big
numbers
the string is very long, with the above I double only the sizeof(double)
due to
the use of unit's.
Does the sun rpc xdr handle this in a same manner ?

Thanks
Olaf



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

From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: double to byte stream convert
Date: Tue, 16 Jan 2001 10:11:14 +0100

"O.Petzold" wrote:

> Well, I've no idea how this is portable to the RFC1832. If I study the
> ieee754 header, there are #ifdefs for different endians, therefore my
> conclusions: it should be. Different targets are able to rebuild the
> double
> from splitted components regards to their fp representation.
> Maybee I should convert the uint to network byte order for transport.

You shlould certainly do this, e.g. by using htonl() and ntohl().

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: salikova <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: system halts at exchange with ISA
Date: Tue, 16 Jan 2001 16:13:49 +0600

Dear Madam/Sir,

Please, help my with following  problem.
What is happen, if  I change old ASER AP65 mother board with Pentium Pro
by  new ASUS P2-99 mother board, that contains Pentium III? Old system
with Pentium Pro and ISA device works successful, new system  at Pentium
III halts,  then process works with old ISA device.


Best Regards,
Tatiana
====================================
Budker Institute of Nuclear Physics
prospekt Lavrentev  11
630090, Novosibirsk, RUSSIA
fax     +7 3832 342163
phone   +7 3832 394977
e-mail: [EMAIL PROTECTED]



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

From: "Guennadi V. Liakhovetski" <[EMAIL PROTECTED]>
Subject: ldconfig error message
Date: Tue, 16 Jan 2001 10:31:34 +0000

Hello all

After upgrading to glibc-2.2 on my SuSE6.3 Every time ldconfig is run it
produces the following message:

ldconfig: Can't stat .2

And then it seems to run happily... What does this mean?

Thanks
Guennadi
___

Dr. Guennadi V. Liakhovetski
Department of Applied Mathematics
University of Sheffield, U.K.
email: [EMAIL PROTECTED]



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

From: "Guennadi V. Liakhovetski" <[EMAIL PROTECTED]>
Subject: Re: Problems compiling programs with new 2.4 kernel
Date: Tue, 16 Jan 2001 10:41:43 +0000

Hi

On Mon, 15 Jan 2001, Josh Liechty wrote:

> When I try to compile the Lucent Winmodem driver under the 2.4 kernel,
> it complains that it can't find
> /usr/src/linux/include/linux/modversions.h and serial_compat.h . It also

Does this file exist? In particular, do you have a link 
linux -> linux-2.4.0 
in your /usr/src/ directory?

> complained about autoconf.h, but I copied autoconf*.h from the Linux
> kernel 2.2.14 files, and now that works ok, but it still is complaining

You shouldn't need to do this either. You are mixing up kernel versions
this way. If the missing files REALLY do not exist in 2.4.x, this means
you need to upgrade / patch your driver. I've seen some reports about
winmodem drivers not working with the new 2.4 kernels, and then usually
usually it was possible to download a patch for the driver.

HTH
Guennadi
___

Dr. Guennadi V. Liakhovetski
Department of Applied Mathematics
University of Sheffield, U.K.
email: [EMAIL PROTECTED]



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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: ldconfig error message
Date: 16 Jan 2001 12:16:41 +0100

>>>>> Guennadi V Liakhovetski writes:

 > Hello all
 > After upgrading to glibc-2.2 on my SuSE6.3 Every time ldconfig is run it
 > produces the following message:

 > ldconfig: Can't stat .2

 > And then it seems to run happily... What does this mean?
A minor bug in glibc 2.2 that's fixed in glibc 2.2.1, just ignore it.

Alternativly download a fix from http://www.suse.de/~aj/ldconfig.patch

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [EMAIL PROTECTED]
   private [EMAIL PROTECTED]
    http://www.suse.de/~aj

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How to set r/w error conditions in a device driver?
Date: Tue, 16 Jan 2001 11:55:45 +0000

[EMAIL PROTECTED] wrote:
> 
> How does device driver return error back to caller of fread() and fwrite
> ()? I know that the user level code should check the return value of
> fread() and fwrite(). If the value is 0, then call ferror() to see if
> it is an eof or error.
> 
> I look into the "file" structure in include/linux/fs.h and found a
> field called f_error. The only problem is that it seems not to many
> code set that variable. (I would image that a lot of device driver
> would be setting it)
> 
> My questions are :
> 
> Is the f_error is right field to use for report read/write errors
> detected by the driver?
> 
> Where can I found the definition of f_error()? I like to take a look to
> see what variable does it look at to report the error.
> 
> Thank You
> 
> Sent via Deja.com
> http://www.deja.com/

The function ferror() is found in a library not in the kernel.
Errors are reported differently in userspace and kernel.

The way it works is (slightly simplified) this:

1. Program calls the library function fread().
2. fread() calls the library function read().
3. read() calls the kernel function sys_read().
4. sys_read() does what have to be done.
5. sys_read() returns number of bytes read if sucessfull.
                      0 if end of file reached.
                      negative number in case of an error.
6. read() tests sign of return value. If there was an
   error errno is set to -return value and returns -1.
   If there was no error read() returns the return value
   from sys_read().
7. fread() tests the return value of read() and computes
   the number of elements read. Error condition is
   stored in a variable in the library. The number of
   elements read is returned.

I think glibc is where the library functions can be
found. A device driver reports errors by returning a
negative number like -EIO, the possible error codes
can be seen in /usr/include/asm/errno.h.

-- 
Kasper Dupont

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

From: Mats Liljegren <[EMAIL PROTECTED]>
Subject: initrd problems
Date: Tue, 16 Jan 2001 13:04:36 +0100

Hi,

I get a kernel panic message saying that the kernel cannot mount device
0x01 0x01 when I'm running from my initrd image. This happens after
running the initial script (don't remember the name, but it's the
standard initial script for initrd images). The kernel also identifies
the root file system as Minix before this happens, which is correct.

I did set the root to /dev/ram, as the linux/Documentation/initrd.txt
said that by doing so, initrd would be kept as root and not re-mounted.
This is also what I'm after.

Why does the kernel try to do a mount?

Regards,
  Mats

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Problem w/ tty modes?
Date: Tue, 16 Jan 2001 12:12:37 +0000

Kaelin Colclasure wrote:
> 
> Greetings,
> 
> I recently upgraded my system at work to RH6.2 and now I am seeing what
> appears to be a problem with my tty mode settings. bash, emacs and
> other programs that "cook" raw key data are unaffected, but as soon as
> I run any program that's just reading from stdin, none of the "normal"
> delete or backspace keys behave as I'm used to.
> 
> In elden times I used to occasionally do `stty sane' to correct this
> type of issue (when dialed in to a SunOS or DEC Unix box). I tried it,
> but it had no perceptable effect on my Linux machine. Anyone else run
> into this issue? And have a fix?
> 
> -- Kaelin

I have experience lots of this kind of problems under X.
But not from the linux textmode console. If you have
problems under X it is probably related to ~/.Xdefaults
or settings made with xmodmap. The current mapings can
be shown with "xmodmap -pke".

-- 
Kasper Dupont

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

From: "KPG" <[EMAIL PROTECTED]>
Subject: module kernel version problem
Date: Tue, 16 Jan 2001 13:22:32 +0100

Hi all,

I'd like to make a module usable on more than one kernel version, so if it
is compiled on say 2.2.11 it still runs on 2.2.17 et al.

How can this be done?

Klaus P.





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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: [EMAIL PROTECTED]
Subject: Re: Keyboard input
Date: Tue, 16 Jan 2001 12:36:54 +0000

Bernd Oliver Christiansen wrote:
> 
> My application puts the console into graphics mode.
> 
> Thanks again,
> 
> -Bernd
> 
> Kasper Dupont <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Bernd Oliver Christiansen wrote:
> > >
> > > Hello:
> > >
> > > I'd like to learn more about programming the keyboard under Linux.  I
> > > basically need a way to read all keys and modifiers (e.g., I'd like to
> be
> > > able to read SHIFT-LEFT, PAGE UP, etc.).  Where can I find more
> information
> > > on this topic?
> > >
> > > Also, in general, what's a good starting point for exploring the various
> > > Linux APIs?
> > >
> > > Thanks,
> > >
> > > -Bernd
> >
> > That depends on what context you are writing for.
> > Are you writing for X/console/kernel?
> >
> > --
> > Kasper Dupont

Sorry for the late answer, I have been quite busy lately.

I think the functions tcgetattr, tcsetattr and cfmakeraw
might help you. If you use theese functions on stdin you
will be able to receive single keypresses instead of
hole lines.

If you need input at an even lower level you can use
ioctl(0,KDSKBMODE,K_RAW); and restore original opperation
with ioctl(0,KDSKBMODE,K_XLATE); But be carefull as this
will disable all standard key combinations including
CTRL+ALT+DEL, CTRL+ALT+F1, and so on.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Developing a mouse replacement driver.
Date: Tue, 16 Jan 2001 12:48:50 +0000

PeZ wrote:
> 
> My question is :
> can i use highlevel c network routines in my driver function??? and how can
> i link them in...???????

In general you should avoid using highlevel routines inside
the kernel or take lot of care when doing so.

Probably it would be better to write a daemon runing in user
space to do what you want to do. You might want to study how
the repeater function of gpm works.

What exactly is it you want to do?

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Kernel -> user mode data tranfer  ????
Date: Tue, 16 Jan 2001 12:57:45 +0000

hebre wrote:
> 
> > [...]
> >
> > The sys_socket function is in the file linux/net/socket.c.
> > It creates a new socket and it creates a file descriptor
> > for the current process and connects the two.
> 
> >
> > In your case you want to be able to use the socket no
> > matter what the current process is.
> >
> > Instead you can call the sock_create function from your
> > module and save a pointer to the struct socket, the pointer
> > is valid from any process while inside the kernel.
> >
> > When using the socket you cannot use the sys_read and
> > sys_write functions, because they require a filedescriptor
> > and a userspace buffer.
> >
> > But if you look at the sys_read and sys_write functions in
> > linux/fs/read_write.c you will se they are wrappers looking
> > up the filedescriptor and verifying the buf pointer. You
> > can simply skip that and call the read/write function from
> > the socket structure.
> >
> [...]
> 
> I tried to do this. When I insert in module string like "sys_socket(..)"
> it compiles OK, but when I talk "insmod this_module" I see "unresolved
> symbol sys_socket". (kernel 2.4.0-test10)
> What is wrong?
> Can You send some examples?
> 
> Thanks.
> > --
> > Kasper Dupont
> 
> Paul

This is because the symbol sys_socket is not exported by
the kernel. If it should be possible to use sys_socket
from a module there must be an EXPORT_SYMBOL(sys_socket);
line somewhere in the kernel. These lines are normally
placed in linux/kerenl/ksyms.c.

But I don't think sys_socket is the function you need,
perhaps sock_create would be more appropriate. This
symbol is exported from the file linux/net/netsyms.c.

-- 
Kasper Dupont

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

From: "Morten Bøhmer" <[EMAIL PROTECTED]>
Subject: 2.4.0 ISDN Problems
Date: Tue, 16 Jan 2001 14:31:00 +0100

I'm experiencing problems with the 2.4 release of the linux kernel. After
compiling my kernel configuration, and recompiling the other packages
(isdn4kutils etc.). When I connect one isdn line i works ok, but when i
disconnect the machine freezes!!!

Does anyone have a solution to this problem?

--
Med vennlig hilsen/Best Regards,
Morten Bøhmer - [EMAIL PROTECTED]
AdCo Partner AS
Bjellandveien 14 - 3172 VEAR
[EMAIL PROTECTED]
http://www.veggers.no



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

From: Ulrich Hahn <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: su cannot run /bin/bash? was: 2.2.18 won't boot diskless
Date: Tue, 16 Jan 2001 14:52:48 +0100
Reply-To: [EMAIL PROTECTED]


==============3DACD36BD58C0B334B1F4385
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Just another problem - I saw you managed the previous problem well :-)

I am booting a 2.0.36 kernel without problem using a NFS root. The
clients are functional, but you cannot log in as ordinary user. Neither
local nor via telnet or ssh. The problem arises whe trying the "su -
anyusername" or even "su anyusername".
The result is always like this:
su: cannot run /bin/bash: Permission denied
(Replace /bin/bash to whatever you may place into /etc/passwd as the
user shell).

Only root will be allowed to log in - not acceptable for a WORKstation.

(I did the same some years ago, and it there was noting like that..)
Any idea, what might cause this strange result?

--
kind regards
 -ulrich-

PGP fingerprint: 5AC7 FCA6 D0E5 5A5D  DA58 01B0 5458 6BA8

Uncompensated overtime?  Just Say No.


==============3DACD36BD58C0B334B1F4385
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Just another problem - I saw you managed the previous problem well :-)
<p>I am booting a 2.0.36 kernel without problem using a NFS root. The clients
are functional, but you cannot log in as ordinary user. Neither local nor
via telnet or ssh. The problem arises whe trying the "su - anyusername"
or even "su anyusername".
<br>The result is always like this:
<br><tt>su: cannot run /bin/bash: Permission denied</tt>
<br>(Replace /bin/bash to whatever you may place into /etc/passwd as the
user shell).
<p>Only root will be allowed to log in - not acceptable for a WORKstation.
<p>(I did the same some years ago, and it there was noting like that..)
<br>Any idea, what might cause this strange result?
<p>--
<br>kind regards
<br>&nbsp;-ulrich-
<p>PGP fingerprint: 5AC7 FCA6 D0E5 5A5D&nbsp; DA58 01B0 5458 6BA8
<p>Uncompensated overtime?&nbsp; Just Say No.
<br>&nbsp;</html>

==============3DACD36BD58C0B334B1F4385==


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

From: [EMAIL PROTECTED]
Subject: Re: 2.4.0 loop device
Date: Tue, 16 Jan 2001 13:47:13 GMT

In article <[EMAIL PROTECTED]>,
  Kasper Dupont <[EMAIL PROTECTED]> wrote:
[...]
>
> It does sound like a kernel bug. Does the same
> happen when you test with less than 100M,
> something like 1M might be interesting. Perhaps
> watching top or /proc/meminfo while repeating
> the test with more and more data will show
> something interesting. How much physical
> memory does the computer have?

It only happens if the loop driver has to wake bdflush. That depends on
the kernel settings and the available vs used buffer memory.
My machine has currently 192 megs of ram. If I try it just after boot-
up from the console then it happily writes the 100M data in the
example. I don't think size matters, so I have not pursued the issue
further. (I only have some 110M free space on /tmp and I didn't feel
like testing on a "valuable" partition)

I have tried the patch mentioned by ratz, the only difference is that
the process now waits in lock_page.

I am still waiting for confirmation by others, though!

Greets,
    Csaba


Sent via Deja.com
http://www.deja.com/

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


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

Reply via email to