Linux-Development-Sys Digest #638, Volume #7     Tue, 29 Feb 00 16:13:20 EST

Contents:
  Re: complex math in a device driver ("Dan Miller")
  Re: Binary compatibility: what kind of crack are they smoking? (Martin Schenk)
  BFD: how do I get source-line of EIP? (Henning)
  Re: complex math in a device driver (Robert Redelmeier)
  Re: telnetd stopped working (Steve Berridge)
  Re: processes surviving shell shutdown (Larry Zimmerman)
  Linux ODBC ("John Smith")
  Re: Binary compatibility: what kind of crack are they smoking? (J.H.M. Dassen (Ray))
  GCC and EGCS, SuSE say they can co-exist, I don't see how (Robin Collins)
  can't read track info on my new Acer cdrom (Michael Hirsch)
  Semaphore quustion ... part 2!! Bug ? (mark)
  Re: Problem with SIGALRM and rad() from a pipe (Juergen Heinzl)
  Re: glibc development language (Juergen Heinzl)

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

From: "Dan Miller" <[EMAIL PROTECTED]>
Subject: Re: complex math in a device driver
Date: Tue, 29 Feb 2000 09:22:49 -0800

Gordon Haverland wrote in message <[EMAIL PROTECTED]>...
>Grant Edwards wrote:
>>
>> In article <89782j$[EMAIL PROTECTED]>, Oliver Bandel wrote:
>> >
>> >Dan Miller <[EMAIL PROTECTED]> wrote:
>> >> I need to access some math library function in my device driver.  I
believe
>> >> I've read here that one cannot do that, and I don't actually see a way
to do
>> >[...]
>> >
>> >Why should you use math in a device driver?
>>
>> To provide a layer of abstraction.  For example, if I have a set of
>> analog inputs, and I make an IOCTL call to read the voltages, it's
>> awfully nice to get answers in volts.  That way the driver has to keep
>> track of the peculiarities of the hardware rather than the user
>> software.
>
>Why not do a table lookup?  Your N bit A/D converter returns
>a number, do a lookup of that number to convert it to volts,
>or whatever.
>
>Gordon Haverland

This is all well and good, but my computational requirements are *much* more
complex than A/D conversion.  A typical computation in my set is:

     temp2usl = 0x0000000f & (unsigned long) floor( 0.5 + 16.0*(( m1a *









                  pow(2.0,-1.0*(double)( floor(log10( m1a )/log10of2) )) ) -
1.0) );

... and a large number of this degree of computation must be performed for
each set of register modifications.

I probably will use a library for now to encapsulate these computations; it
will solve my immediate problem.  Ultimately, though, this won't be a really
good solution because I can anticipate at least one situation where the
driver may realize on its own (with no user process attached) that it needs
to modify the hardware, and it won't be able to...






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

From: Martin Schenk <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.setup
Subject: Re: Binary compatibility: what kind of crack are they smoking?
Date: Tue, 29 Feb 2000 18:21:21 +0100

JEDIDIAH wrote:
> 
> >This assumes that there exist no third party binary only apps. This in
> >the long term is a dangerous assumption.
> 
>         No it doesn't. The concept of 'relink-at-install-time' actually
>         has some precedent in Unix. As long as the standard system is
>         considered to have a full build enviroment, this issue should
>         never really be a problem.
> 

On principle, I agree with this - but in practice this is not immune to
problems either. When installing Oracle, a lot of the stuff gets
relinked -
alas installing Oracle 8.0.5 on my SuSE 6.2 based machine (glibc 2.1
development, should run glibc2.0 and glibc2.1 binaries without problems)
did not work until I downloaded a different version of the C-compiler
and a special set of "glibc2.0-development on a glibc2.1-based system"
libraries (the SuSE help database explains what has to be done).

I also needed a different version of the Openlink drivers (to use the
ODBC API under linux) - and finally could not build me program with
Solid (another database, uses the ODBC API natively) anymore.

I'm sure that one can get all these things to work properly, but it
certainly is pain.

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

From: Henning <[EMAIL PROTECTED]>
Subject: BFD: how do I get source-line of EIP?
Date: Tue, 29 Feb 2000 18:41:15 +0100

Hello,

what do I have to do to retrieve the filename and lineno by given eip?

I have executable name.

Thanx;-)

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

From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: complex math in a device driver
Date: Tue, 29 Feb 2000 12:17:11 -0800

Dan Miller wrote:
> complex than A/D conversion.  A typical computation in my set is:
> 
>      temp2usl = 0x0000000f & (unsigned long) floor( 0.5 + 16.0*(( m1a *
> 
>                   pow(2.0,-1.0*(double)( floor(log10( m1a )/log10of2) )) ) -
> 1.0) );

Ouch!  While Linux might not do FSAVE / FRSTOR on every interrupt
and kernel entry for obvious performance reasons, AFAIK there's 
nothing to stop you from adding this pair around your bottom-half
code and FPUing away to your hearts content.  You will have to
provide enough space [stack?], and interrupt latency may become
a problem.  Reentrancy and SMP will need special attention.

-- Robert   author `cpuburn`   http://users.ev1.net/~redelm

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

From: Steve Berridge <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.best
Subject: Re: telnetd stopped working
Date: Tue, 29 Feb 2000 13:43:58 -0500

I had looked for the file and found it was indeed missing.
I created an empty file in bin called login but no joy.
I just solved the problem tho (well with the help of a
knowledgeable grad student) - the /bin/login file is created by
util-linux.  I reinstalled its rpm and telnet worked fine.

Thanks for you help.
Steve

Toomas Gavrilin wrote:

> Steve Berridge wrote:
>
> > Hello group -
> > I am running RH 6 on a Dell server and suddenly when I try to telnet to
> > the machine I get an error message saying
> > "telnetd: /bin/login: No such file or directory   "
> >
> > I have uninstalled telnet and installed a newer version from RH
> > (telnet-0.10-29)
> >
> > Does anyone know what causes this and what the fix is?
> > Your help is greatly  appreciated.
>
> Well, first, make sure you've got 'login' in directory /bin.

--
Steve Berridge
University of Tennessee
Department of Physics
401 Nielsen Physics Bldg
Knoxville  TN  37996-1200
Phone 865/974-7819  fax x9682



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

From: [EMAIL PROTECTED] (Larry Zimmerman)
Subject: Re: processes surviving shell shutdown
Date: 29 Feb 2000 12:56:47 -0800

In article <[EMAIL PROTECTED]>,
        Toby Haynes <[EMAIL PROTECTED]> writes:
> !! "phil" == phil-news-nospam  <[EMAIL PROTECTED]> writes:
> 
>   phil> On Tue, 29 Feb 2000 04:14:30 GMT Pierre-Marc Fournier
>   phil> <[EMAIL PROTECTED]> wrote: | I am trying to start a
>   phil> process that will not end when I logout from a | session (like
>   phil> an ftp download). I read about nohup and tried it but it |
>   phil> didn't work : the process starts but ends like if I hadn't
>   phil> used nohup.  | Running redhat 6.0...
> 
> You can wrap the program up in a shell under nohup in that case, such
> as:
> 
> nohup tcsh -c 'myprog >&! /tmp/myprog.log' &
> 

If you type "nohup whatever", you will be running the shell's
built-in nohup. To get the "real" nohup, try
/bin/nohup whatever &
This works on linux, solaris, ...

Larry Z.
-- 
.signature withheld pending a patent/copyright search.

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

From: "John Smith" <[EMAIL PROTECTED]>
Subject: Linux ODBC
Date: Tue, 29 Feb 2000 11:31:36 -0800

are there any odbc c/c++ libraries available?

thanks



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

From: [EMAIL PROTECTED] (J.H.M. Dassen (Ray))
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.setup
Subject: Re: Binary compatibility: what kind of crack are they smoking?
Date: Sun, 27 Feb 2000 21:03:46 +0100

Miquel van Smoorenburg <[EMAIL PROTECTED]> wrote:
>In article <[EMAIL PROTECTED]>,
>Mario Klebsch <[EMAIL PROTECTED]> wrote:
>>e.G. the X11 libs, and althoug theit interface changed with the libc, too,
>>their version number did not.
>
>You must be kidding, or you are using a weird system. I can run libc5,
>glibc 2.0 and glibc 2.1 X based applications at the same time without any
>problems.

The X libraries compiled against libc5 and libc6 both use 6.1 as their
soversion. This doesn't cause problems as long as your X applications are
not linked with a hardwired library search path (-rpath), allowing ldso to
find the right libc to load them against. On Debian, X applications aren't
compiled -rpath. On at least some versions of Red Hat, X applications are
compiled -rpath, causing problems. This e.g. caused problems with Red Hat's
libc5-compiled CDE on libc6 Debian. This problem, once identified, is fairly
easy to fix: edit the binaries to have the RPATH start with the NULL
character.

HTH,
-- 
Ray Dassen <[EMAIL PROTECTED]>

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

From: Robin Collins <[EMAIL PROTECTED]>
Subject: GCC and EGCS, SuSE say they can co-exist, I don't see how
Date: Tue, 29 Feb 2000 19:36:53 +0000

According to the SuSE installer one can install EGCS and GCC together,
you either install GCCFRONT or EGCS but not both, looking at the files
they install I can see why.

My problem is I don't see how to make them live together!  If I
install EGCS then GCC runs EGCS, if I install GCCFRONT GCC runs GCC
2.7.2.3.

I want 2.7.2.3 for kernel builds, but EGCS for software development.
I fail to see how to do this and have GCC somehow run one then the
other.

I admit to being somewhat new to Linux, having used other *nixes, so
am not really used to the GNU toolset.

I'd appreciate some education :)

Cheers,
Robin

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

From: Michael Hirsch <[EMAIL PROTECTED]>
Subject: can't read track info on my new Acer cdrom
Date: 29 Feb 2000 15:45:01 -0500

My old scsi cdrom finally bit the dust, so I bought a new one.  I got
a Acer 50x ide drive from buy.com.  I figured that cdroms are cdroms,
but it isn't working like I thought it would.  I'm hoping that someone
knows how to remedy this problem.

I'm writing a cd playing application.  When I query the cd drive like

struct cdrom_tochdr tinfo;
if (ioctl(cdrom,CDROMREADTOCHDR, &tinfo)) == -1 {
        perror("tochdr");
}

I get the error: 
        tochdr: Function not implemented.

I can get similar errors when trying to read a tocentry, too.

I have another machine with an ide drive for which this code works
flawlessly.  

I am running 2.2.14 with the autofs patches on both machines.

One other data point: I have a Commate S7AX motherboard with a k6-2.
At boot up I get this message: 
PCI_IDE: unknown IDE controller on PCI bus 00 device 78, VID=10b9,
DID=5229
PCI_IDE: not 100% native mode: will probe irqs later.

/anyone seen this problem before?

Thanks,

-- 
Michael D. Hirsch                       Work: (404) 727-7940
Emory University, Atlanta, GA 30322     FAX: (404) 727-5611
email:  [EMAIL PROTECTED]         http://www.mathcs.emory.edu/~hirsch/

Public key for encrypted mail available upon request (or finger
[EMAIL PROTECTED]).

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

From: mark <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Semaphore quustion ... part 2!! Bug ?
Date: Tue, 29 Feb 2000 20:51:17 +0000

Hi all,
    I know I recently posted a question one semaphores (Thanks for the
replies) but I'm still having problems with them ... not convinced
they're working properly!

This is an interleaving of what I can see happening (Where the Writer
process starts a little before the Reader - not that this should cause a
problem).

Writer Gets Semaphore
Writer Returns Semaphore
Writer Gets Semaphore
Reader Tries Semaphore - Blocked
Writer Returns Semaphore
Writer Gets Semaphore
Writer Returns Semaphore
etc...
Reader might get to play if its lucky


Its not helped by the fact its not always the same process that does
this (The Reader can end up with the semaphore for ages as well.)

The problem is one process is effectively able to jump the queue
(Somehow!!) and keep the semaphore for itself - even when the other
process was blocked  that semaphore. The programs are so simple its
either some really stupid I'm doing (Quite possible!) or the semaphore
semop() function has a bug.

I dumped the code for the Reader and Writer processes below. If anyone
is able to try it out I'd really appreciate it. This is pretty annoying
! :) Another odd fact is you'll notice there are two lines in each bit
commented out (All they do is print out the Semaphore at that time). The
problem doesn't seem so bad when there compiled in!!???

I've also tried using shed_yeild() when the processes gives up the
semaphore, however I don't believe it will make any difference as the
process should block anyway.

These are System V semaphores, are there any known problems with them?
POSIX any better? If so where can I get info on how to use them (I
assume there more up to date).

Just for the record I'm running Linux 2.2.14

Thanks in advance

Mark

The WRITER:

#include <iostream.h>
#include <sys/shm.h>
#include <sys/sem.h>

//g++ SemaphoreWriter.cpp -o SemaphoreWriter

union semun {
  int val;
  struct semid_ds *buf;
  unsigned short int *array;
  struct seminfo *__buf;
};

  key_t key;
  int shmid;
  char * data;
int AccessCount = 0;

void Setup_Key(void) {
  /* Generate key for the memory segment */
  key = ftok("/home/mark/sharedmemtest", 'B');
}

int sem_id;
char Item;
struct sembuf locker;
union semun options;

void main(void) {

  Setup_Key();

  sem_id = semget(key, 1, IPC_CREAT | 0666);
  cout << "Semaphore ID is: "<< sem_id << endl;

  cout << "Orginal Semaphore Value is: " << semctl(sem_id, 0, GETVAL, 0)
<< endl;
  /* Set the initial value of the Semaphore to 1 */
  options.val = 2;
  semctl(sem_id, 0, SETVAL, options);

  cout << "Initial value of Semaphore is:" << semctl(sem_id, 0, GETVAL,
0) << endl;
  cin >> Item;

  while(AccessCount<5) {
    locker.sem_num = 0;
    locker.sem_op  = -2;
    locker.sem_flg = 0;
    semop(sem_id, &locker, 1);

    cout << "Writer has access: " << endl;
    //cout << "Locked value of Semaphore is: " << semctl(sem_id, 0,
GETVAL, 0) << endl;
    cout << "Access Count: " << AccessCount++ << endl;
    sleep(5);

    locker.sem_num = 0;
    locker.sem_op = 2;
    locker.sem_flg = 0;
    semop(sem_id, &locker, 1);

    cout << "Semaphore Unlocked: " << endl;
    //cout << "Unlocked value of Semaphore is: " << semctl(sem_id, 0,
GETVAL, 0) << endl << endl;
  }

  cout << "Finial value of Semaphore is:" << semctl(sem_id, 0, GETVAL,
0) << endl;
}


The READER:

#include <iostream.h>
#include <sys/shm.h>
#include <sys/sem.h>

//g++ SemaphoreReader.cpp -o SemaphoreReader

union semun {
  int val;
  struct semid_ds *buf;
  unsigned short int *array;
  struct seminfo *__buf;
};

key_t key;
int shmid;
char * data;
char Item;
int AccessCount;



void Setup_Key(void) {
/* Generate key for the memory segment */
  key = ftok("/home/mark/sharedmemtest", 'B');
}

int sem_id;
struct sembuf locker;
union semun options;

void main(void) {

  Setup_Key();

  sem_id = semget(key, 1, IPC_CREAT | IPC_EXCL | 0666);
  if (sem_id = -1 ) {
    cerr << "Semaphore probably already exists...connecting" << endl;
    sem_id = semget(key, 1, 0666);
    cout << "Semaphore ID is: "<< sem_id << endl;
    }

  cout << "Current value of Semaphore is:" << semctl(sem_id, 0, GETVAL,
0) << endl;

  cin >> Item;
  AccessCount = 0;
  while(AccessCount<5) {
    locker.sem_num = 0;
    locker.sem_op = -2;
    locker.sem_flg = 0;
    semop(sem_id, &locker, 1);

    cout << "Reader has access: " << endl;
    //cout << "Locked value of Semaphore is: " << semctl(sem_id, 0,
GETVAL, 0) << endl;
    cout << "Access Count: " << AccessCount++ << endl;
    sleep(5);

    locker.sem_num = 0;
    locker.sem_op = 2;
    locker.sem_flg = 0;
    semop(sem_id, &locker, 1);

    cout << "Semaphore Unlocked: " << endl;
    //cout << "Unlocked value of Semaphore is: " << semctl(sem_id, 0,
GETVAL, 0) << endl << endl;;
  }
  cout << "Finial value of Semaphore is:" << semctl(sem_id, 0, GETVAL,
0) << endl;
  semctl(sem_id, 0, IPC_RMID, 0);
}




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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: Problem with SIGALRM and rad() from a pipe
Date: Tue, 29 Feb 2000 21:04:19 GMT

In article <89gsk4$mk7$[EMAIL PROTECTED]>, John Agnew wrote:
>Hi All,
>
>I've an interesting problem with the following piece of code under Linux.
>What I expect when the alarm expires is that the read from the pipe "pipe1"
>terminates - this is what
>happens under other version of Unix - but under Linux the read continues.

Cool, eh 8)

>The effect is that
>the program appears to have hung.

Yes, do a info signal ... you are not only going to find the solution
but much more important information. Keep that all in mind if some other
application does not work anymore that expects system calls are not
restarted per default.
[...]

Cheers,
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: glibc development language
Date: Tue, 29 Feb 2000 21:04:22 GMT

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>On Tue, 29 Feb 2000 02:08:33 GMT Christopher Browne <[EMAIL PROTECTED]> wrote:
>
>| But it is certainly fair to say that amongst the community of Linux
>| kernel developers:
>|   - C gets "high marks"
>|   - C++ *doesn't*
>
>Masses of applications programmers are using C++ because that is what
>Microsoft sells to the companies they work for.

Some doubt Microsoft knows much about C++ ;)

>My first turn off from C++ occurred when I met a programmer working as
>an applications developer for a major corporation.  He stated that all
>you need to do to make sure your program is object oriented is just do
>the coding in C++.  When I asked him how he applied object oriented
>principles to the system design, he replied that he didn't need to worry
>about that because he was using C++.

Oh well ... might be it is about time people get a grip ... C++ is
not about OO, it is about generic programming.
>
>I was hoping this was an isolated case of an incompetent programmer.
>But it was not.  I've run into many others like that who have little
>or no idea how to really make a system work regardless of the language,
>and end up using their language as a crutch.  I worry how many other
>programmers _think_ they are doing things right just because they happen
>to be coding in C++.  To some extent the language developers are at fault
>for actually pushing the idea that "using language XYZ will make things
>better".

Huh ? I�ve never heard anything like that from even one of the C++
gurus. Yes, like Java C++ became the solution to all problems, even
the ones one did not know about yet, but *that* is a different story.

>That doesn't make C++ a bad language.  However, something I find happening
>is that the easier the language gets (such as C++ or Perl or Java), the
>lower the barrier becomes for admitting lower grade programmers.  Business
>seems to need larger numbers of them (although I'm not sure this is entirely
>true) so anything that makes it possible to have more is what they will do.
>
>C++ has more programmers than C because C++ has lowered the barrier.  But
>does a larger number of programmers because of a lower barrier mean that
>those who would be programmers anyway *must* use C++ (not to disparage any
>that choose to do so)?  I think not.
>
>If we used this line of reasoning, we'd all also just forego using Linux
>and switch to MS Windows.  Most people who use computers use MS Windows.
>
>I have my reasons for not using C++.  As long as C functions well as a
>programming language I'll continue to use it.  I don't see why it will
>break any time soon.

C++ helps to let the compiler sort things out an experienced C
developer would do manually anyway.
>
>
>| If anyone wants to create an OS kernel in C++, they are free to start
>| a project to do so.  And they are free to *leave Linux alone.*
>
>It might be interesting to see just how such a project turns out.  Be sure
>to not using ANY non-object oriented language anywhere in the whole project.
>Then do one in Java.

It might turn out quite well and I have seen projects like an OS in Modula
or see Oberon, which is much more of course.

Now while C++ is, to me, a spiffy language and I do like it .. C compilers
can be considered pretty bomb proof, C++ compilers and yes, g++ .. not.

In any case, as soon as a language is being used because "it is there"
someone made a decision out of a whim, not good, no points. Aside from
that I am having my qualms the # of people who *knows* C++ is even near
the one who *knows* C and both are low enough probably.

Cheers,
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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


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