Linux-Development-Sys Digest #953, Volume #7     Thu, 15 Jun 00 08:13:13 EDT

Contents:
  Re: ansiTime library: mktime() inconsistencies across platforms? (Erik Max Francis)
  Re: Disabling Buffer Cache? (Michael Mesnier)
  Re: Interrupt for parallel port on 4 pins? (Frank Sweetser)
  Re: Catch system calls from an apps? ("Douglas Kilpatrick")
  Loading RedHat 6.2 onto Toshiba Satellite 2655XDVD (FarrantS)
  Re: Disabling Buffer Cache? ("David A. Gray")
  Re: Good Basic compiler for linux? (Steven Yap)
  Re: Disabling Buffer Cache? (Pete Zaitcev)
  Re: HELP!! login stops on new serial driver (Pete Zaitcev)
  Re: Disabling Buffer Cache? (Kaz Kylheku)
  Re: Kernel loadable modules... (David Steuber)
  Re: Kernel loadable modules... (David Steuber)
  Re: Kernel loadable modules... (David Steuber)
  I need betatesters for a linux ring0 debugger (Vicente Aurelio Esteve Lloret)
  sigaltstack and libpthread (Henning)
  A strange problem using poll() systemcall ("Roman A. Stepanov")
  Re: Kernel loadable modules... ([EMAIL PROTECTED])
  Re: Interrupt for parallel port on 4 pins? (David Gauchard)

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

From: Erik Max Francis <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,comp.os.linux.misc,comp.os.linux.portable
Subject: Re: ansiTime library: mktime() inconsistencies across platforms?
Date: Wed, 14 Jun 2000 16:53:59 -0700

Robert J Carter wrote:

> I would tend to go with the SunOS behaviour. tm_isdst is *supposed* to
> be a boolean value; non-zero is true, zero if false. The actual value
> shouldn't matter.

Zero, positive, or negative.

>From ANSI C 1989, 7.12.2.1:

    The value of tm_isdst is positive if Daylight Savings Time is in
    effect, zero if Daylight Savings Time is not in effect, and
negative     if the information is not available.

-- 
 Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Take my advice:  Pull down your pants and slide on the ice.
\__/ Dr. Sidney Freedman
    7 sisters productions / http://www.7sisters.com/
 Web design for the future.

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

From: Michael Mesnier <[EMAIL PROTECTED]>
Subject: Re: Disabling Buffer Cache?
Date: Wed, 14 Jun 2000 17:40:26 -0700

No, I'm not worried about coherency.  It's just that our application maintains its
own buffer cache, and I would like to measure its effectiveness without any
perturbation from the system cache.

-Mike

Kaz Kylheku wrote:

> On Wed, 14 Jun 2000 14:58:27 -0700, Michael Mesnier <[EMAIL PROTECTED]>
> wrote:
> >I just tried this, with no luck.  I put the sync option both in /etc/fstab and
> >tried it on the command line via -o sync.
> >
> >What I really need to do is simply avoid the buffer cache altogether.  I'm not
> >even sure if this is possible in linux.
>
> What will this give you? Are you expecting the data on disk to change behind
> the operating system's back?
>
> --
> #exclude <windows.h>


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

From: [EMAIL PROTECTED] (Frank Sweetser)
Subject: Re: Interrupt for parallel port on 4 pins?
Date: 15 Jun 2000 01:45:12 GMT

fprintf <[EMAIL PROTECTED]> wrote:
>Is it possible to designate activity on pins 10, 11, 12 and 15
>to generate an interrupt?  If not, is there a better way to
>monitor activity on those pins other than a constantly cycling
>do loop?

No.  Only pin 10 can generate interrupts - it's a hardware limitation.  Search
for the parapin library on freshmeat.net - it's a nice library for monitoring
individual pins either from user space and kernel space, with some decent docs
too.

-- 
Frank Sweetser rasmusin at wpi.edu, fs at suave.net
Full-time WPI Network Tech, Part time Linux/Perl guy
But then it's a bit odd to think that declaring something int could
actually slow down the program, if it ended up forcing more conversions
back to string.
             -- Larry Wall in <[EMAIL PROTECTED]>

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

From: "Douglas Kilpatrick" <[EMAIL PROTECTED]>
Subject: Re: Catch system calls from an apps?
Date: Wed, 14 Jun 2000 22:42:41 -0500

In article <[EMAIL PROTECTED]>, Gautier Fabrice
<[EMAIL PROTECTED]> wrote:

> For Example:
>  I've a modified read() in my lib, and i want it to call the libc read()
>  how do I make a distinction between both?  What happens if I do

I don't know what the best way is.  I used platform-specific extensions to
directly trap the system call.

If you can compile the program, the -wrap option of GNU's ld might work.
Otherwise (linux x86 specific):


#include <asm/unistd.h>

ssize_t trap_read(int fd, void *buf, size_t count)
{
    long __res;
    __asm__ volatile ("int $0x80"
        : "=a" (__res)
        : "0" (__NR_read), "b" ((long)fd), "c" ((long)buf),
          "d" ((long)count));
    __syscall_return(ssize_t,__res);
}

ssize_t read(int fd, void *buf, size_t count)
{
    ssize_t retval;

    do_whatever();

    retval = trap_read(fd, buf, count);

    do_another_thing(); return retval;
}

Actually trying to compile this runs into lots of fun problems:

1) The compiler complains about the symbol conflict, so you have to
compile without linking in libc. 

2) The definition of errno is in libc or libpthread, so you have to
link in libc.

Needless to say, the combination of 1 & 2 makes things fun.  I'm sure there
is a good way of doing it, but I didn't figure out what it was.

Doug
-- 
Doug Kilpatrick       [EMAIL PROTECTED]


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

From: FarrantS <[EMAIL PROTECTED]>
Subject: Loading RedHat 6.2 onto Toshiba Satellite 2655XDVD
Date: Wed, 14 Jun 2000 20:11:57 -0700

Hello!

I'm new to the world of Linux.  I am trying to see if there
are many out there who run Linux on a Toshiba laptop, in case
I get into too much trouble after I start running Linux.

The first thing I need to learn is how to recompile my kernal
so that i can use my keyboard joystick.

Thanks!

Farrant


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


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

From: "David A. Gray" <[EMAIL PROTECTED]>
Subject: Re: Disabling Buffer Cache?
Date: Wed, 14 Jun 2000 21:18:59 -0500

Mandrake 7.1 Linux supports non-native journaled file systems.  Can't remember
file sys type... ...it's documented, but its been a long day; too tired to look it up.
If you're assuming that system fault could cause active FS data corruption in Linux
you're absolutely correct but journaled FS should take care of this problem.  Don't
know how well this new FS works; haven't had time to test.  A couple of other
options are to write your own FS, or use raw disk I/O method.  Since you're using
your own buffer cache, (I'm assuming in runs at application level in user space?)
raw I/O seems like the best if not easiest approach.

-David


In article <[EMAIL PROTECTED]>, Michael Mesnier
<[EMAIL PROTECTED]> wrote:
> No, I'm not worried about coherency.  It's just that our application
> maintains its own buffer cache, and I would like to measure its
> effectiveness without any perturbation from the system cache.
> 
> -Mike
> 
> Kaz Kylheku wrote:
> 
>> On Wed, 14 Jun 2000 14:58:27 -0700, Michael Mesnier
>> <[EMAIL PROTECTED]> wrote:
>> >I just tried this, with no luck.  I put the sync option both in
>> >/etc/fstab and tried it on the command line via -o sync.
>> >
>> >What I really need to do is simply avoid the buffer cache altogether. 
>> >I'm not even sure if this is possible in linux.
>>
>> What will this give you? Are you expecting the data on disk to change
>> behind the operating system's back?
>>
>> --
>> #exclude <windows.h>
> 



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

Subject: Re: Good Basic compiler for linux?
From: Steven Yap <[EMAIL PROTECTED]>
Date: Thu, 15 Jun 2000 03:44:42 GMT

"dave" <[EMAIL PROTECTED]> writes:

> I manage a small team of VB programmers and I am looking for a Basic
> Compiler and IDE for Linux. I have seen Xbasic and some others but

There's XBasic at http://www.maxreason.com/software/xbasic/xbasic.html
which you might want to check out.

-- 
Steven

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Disabling Buffer Cache?
Date: Thu, 15 Jun 2000 04:34:01 GMT

On Wed, 14 Jun 2000 17:40:26 -0700, Michael Mesnier <[EMAIL PROTECTED]> wrote:
> No, I'm not worried about coherency.
> It's just that our application maintains its
> own buffer cache, and I would like to measure its effectiveness without any
> perturbation from the system cache.
> 
> -Mike

I pondered different weird solutions, such as 
writing a character device driver for a storage device (such as IDE),
then using that in a modified application with a custom ioctls
instead of lseek's. It seems that none is as good as a working
implementation of O_SYNC. Try to write to linux-kernel list,
at vger.rutgers.edu and ask what versions of the kernel support O_SYNC
and/or mounting with -o sync as you wrote before.

--Pete

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: HELP!! login stops on new serial driver
Date: Thu, 15 Jun 2000 04:41:13 GMT

> Getty runs and produces a login: prompt, this accepts the user name and
> as soon as return is hit it goes away. It seems to sit in a loop sending
> TCGETA and TCSETA to the driver. Eventually it times out. There is no
> Password: prompt. The baud rate is set to 19200,8n1

I do not think anyone would be able to diagnose your problem
by these symptoms, but here is an idea. Make a wrapper script
in place of /bin/login, e.g.

# mv /bin/login /bin/real_login
# cat <<EOF >/bin/login
#!/bin/sh
exec strace -o /tmp/trace /bin/real_login
EOF
# chmod 755 /bin/login

Also, read the PAM manual (on my system it's in
/usr/doc/pam-0.64/txts/pam.txt) and find how to add the "debug" word
to your pam configuration file. It may show something interesting too.

--Pete

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Disabling Buffer Cache?
Reply-To: [EMAIL PROTECTED]
Date: Thu, 15 Jun 2000 04:38:55 GMT

On Thu, 15 Jun 2000 04:34:01 GMT, Pete Zaitcev <[EMAIL PROTECTED]> wrote:
>On Wed, 14 Jun 2000 17:40:26 -0700, Michael Mesnier <[EMAIL PROTECTED]> wrote:
>> No, I'm not worried about coherency.
>> It's just that our application maintains its
>> own buffer cache, and I would like to measure its effectiveness without any
>> perturbation from the system cache.
>> 
>> -Mike
>
>I pondered different weird solutions, such as 
>writing a character device driver for a storage device (such as IDE),
>then using that in a modified application with a custom ioctls

That would be the traditional solution; it's somewhat of a pity that Linux
doesn't represent disks as both block and character devices.  Some applications
that provide their own access methods and buffering algorithms can benefit from
that.

-- 
#exclude <windows.h>

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

Crossposted-To: comp.os.linux.misc
Subject: Re: Kernel loadable modules...
From: David Steuber <[EMAIL PROTECTED]>
Date: Thu, 15 Jun 2000 08:00:03 GMT

[EMAIL PROTECTED] writes:

' : getting the information necessary to write a driver for the Logitech
' : QuickCam VC ( USB camera ) yet?  Pulling teeth from an angry tiger is
' : much, much easier! :-(.
' 
' MandrakeSoft is working on it...

Which?  Getting the information?  Pulling teeth from an un-sedated
angry tiger?  Or the driver?

If it is the last, let me know.  I have the camera, and I am hoping to 
grab frames and full MPEG video from it.

-- 
David Steuber   |   Hi!  My name is David Steuber, and I am
NRA Member      |   a hoploholic.

All bits are significant.  Some bits are more significant than others.
        -- Charles Babbage Orwell

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

Crossposted-To: comp.os.linux.misc
Subject: Re: Kernel loadable modules...
From: David Steuber <[EMAIL PROTECTED]>
Date: Thu, 15 Jun 2000 09:00:00 GMT

[EMAIL PROTECTED] writes:

' Note also that binary modules must be rebuilt if any of the following change:
' * compiler version
' * compiler options
' * SMP or no
' * Other kernel config options...

I'm getting the point.

I guess I'm still used to the slow, geologic time, paced evolution of
Windows, even though I have used Linux on my home systems exlusively
for over a year now.

When you rebuild the kernel, you just get used to things working
fine.

Does there exist a model by which a binary standard and kernel
interface could be created so that kernel loadable modules could be
practical in binary form without harming the progress of the kernel?

I have a friend that claims Linux is useless because it doesn't
support hardware and software that he uses.  The software argument
could be solved by creating more multi-media type software.  The
hardware is a more difficult issue.

As said earlier in this thread, the vendors don't want their hardware
used by Linux.  If they did, they would release full specifications so 
that the people who like to write drivers would do so.  Then the
people who like to write applications would use the hardware.

I know the arguments about monolithic vs micro kernels was dealt with
way back in '91 on the comp.os.minux group.  I also haven't read
through Alessandro Rubini's book on Linux Device Drivers yet.  Is that 
book still useful?  I think that writing device drivers is hard.  The
Linux kernel should be architected in such a way to make maintenance
of driver code easier.  As the kernel moves forward and incorporates
new ideas, techniques, optimizations, etc, I think it should become
more modular.  I think certain API's should become more stable if that 
can be done without hindering progress.

-- 
David Steuber   |   Hi!  My name is David Steuber, and I am
NRA Member      |   a hoploholic.

All bits are significant.  Some bits are more significant than others.
        -- Charles Babbage Orwell

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

Crossposted-To: comp.os.linux.misc
Subject: Re: Kernel loadable modules...
From: David Steuber <[EMAIL PROTECTED]>
Date: Thu, 15 Jun 2000 09:00:00 GMT

John Thompson <[EMAIL PROTECTED]> writes:

' I suspect the manufacturers are worried that if they provide
' driver specifications to develop software for other platforms
' they will be expected to support those other platforms. Windows
' is a known commodity: you can hire anyone off the street to tell
' your customers to reboot and reinstall when they run into
' problems.  But users of other platforms may not be satisfied with
' this approach and insist on real support from trained staff.  And
' that costs money.

So how do we convince hardware OEMs that all we need is accurate
documentation, and we will do the rest?  How do we tell them that all
they have to do is publish the same documentation that they give to
the poeple who write the Windows drivers on their web site or to
simply pass it on to sunsite?

It doesn't have to cost them a single penny.  This is a different
world, and they should feel welcome in it.  Hell, they should want to
live here.

-- 
David Steuber   |   Hi!  My name is David Steuber, and I am
NRA Member      |   a hoploholic.

All bits are significant.  Some bits are more significant than others.
        -- Charles Babbage Orwell

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

From: [EMAIL PROTECTED] (Vicente Aurelio Esteve Lloret)
Subject: I need betatesters for a linux ring0 debugger
Date: 15 Jun 2000 09:39:18 GMT

http://ttt.inf.upv.es/~viesllo

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

From: Henning <[EMAIL PROTECTED]>
Subject: sigaltstack and libpthread
Date: Thu, 15 Jun 2000 12:15:54 +0200

Hy folks,

does anyone have an idea what to do if I want to catch
stack exceptions (limited stack size) with pthread library bound?

If an exception occures the pthread_sighandler wants to determine
thread_self but this is found on the program stack NOT on the alternate
exception stack. What should I call or set to make this possible?

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

From: "Roman A. Stepanov" <[EMAIL PROTECTED]>
Subject: A strange problem using poll() systemcall
Date: Thu, 15 Jun 2000 14:57:13 +0400

Dear All!

My C++ program working with /dev/ttyS0 has a very strange bug. When I try to
use poll() to determine if I have a new data in port everything works fine
for a few minutes. After that poll() always returns 0 even if I have a new
data in port and my program thinks there is no new data. When I try to
remove everything related to poll() from my code, the program starts to work
fine but I don't want to wait 10ms if I have no new data. Here is a small
part of my code showing how I am working with serial port. I compiled it
with SuSE 6.3 C++ compiler with no additional patches. Any comment is very
appreciated.

Greetings,
Roman A. Stepanov



my_serial::my_serial(char *devname)
{
    devfile = open(devname, O_RDWR | O_NOCTTY);
    tcgetattr(devfile, &old_tio);
    bzero((void *)&new_tio, sizeof(struct termios));

    new_tio.c_cflag = B19200 | CS8 | CREAD;
    new_tio.c_cc[VTIME] = 1;    // Actually it's a VERY large period of
time, I want it to be
                                                  //  about 150 microseconds
to fit my needs
    new_tio.c_cc[VMIN] = 0;

    res = tcsetattr(devfile, TCSAFLUSH, &new_tio);
}

int my_serial::try_read(char *inp_data)
{
    int                   lastbyte = 0;
    struct pollfd    udfs;

    bzero(&udfs, sizeof(struct pollfd));
    udfs.fd = devfile;
    udfs.events = POLLIN;

    if (poll(&udfs, 1, 1) <= 0)
        return false;

    while ((res = read(devfile, &inp_data[lastbyte], 1)) > 0)
         if (input_data[lastbyte++] == FS)
             break;

    if ((res < 0) || (!lastbyte))
        return false;

    /*
    *    The rest of code works fine, so I don't include it
    */
    return true;
}

int main(int argc, char **argv)
{
    my_serial    *m;
    char            cmd_buf[CMD_MAXLEN];
    char            inp_data[INP_MAXLEN];

    m = new my_serial("/dev/ttyS0");

    for (;;)
    {
        if (m->send_cmd(&cmd_buf, bufLen))
            if (m->try_read(&inp_data))
                puts("Got responce from serial port");
    }
}




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

From: [EMAIL PROTECTED]
Subject: Re: Kernel loadable modules...
Crossposted-To: comp.os.linux.misc
Date: Thu, 15 Jun 2000 11:13:37 GMT

In comp.os.linux.development.system David Steuber <[EMAIL PROTECTED]> wrote:
: [EMAIL PROTECTED] writes:

: ' : getting the information necessary to write a driver for the Logitech
: ' : QuickCam VC ( USB camera ) yet?  Pulling teeth from an angry tiger is
: ' : much, much easier! :-(.
: ' 
: ' MandrakeSoft is working on it...

: Which?  Getting the information?  Pulling teeth from an un-sedated
: angry tiger?  Or the driver?

: If it is the last, let me know.  I have the camera, and I am hoping to 
: grab frames and full MPEG video from it.

A kernel hacker (not me) has NDA'd docs for the Logitech, but since
this isn't a company project, he doesn't have much time to work on
support at present.

        Jeff




-- 
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick

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

From: David Gauchard <[EMAIL PROTECTED]>
Subject: Re: Interrupt for parallel port on 4 pins?
Date: 15 Jun 2000 11:44:09 GMT

fprintf <[EMAIL PROTECTED]> wrote:

> Is it possible to designate activity on pins 10, 11, 12 and 15
> to generate an interrupt?  If not, is there a better way to

No

> monitor activity on those pins other than a constantly cycling
> do loop?

Yes, you should not use pin10 in your hardware.
Use another pin: Say you use 6,7,8,9. Now you
can add 4 diodes (I'm french, not sure diode
is the same word in english, the symbol is -|>|-)
from pins 6,7,8,9 to pin 10. Now each time sthing
occurs on any of the pin 6,7,8,9, an interrupt
is generated (from pin 10) and your handler is
able to read the parport.
Now, its not easy to get an interrupt in user space,
but I've a module that does this if you are interested.

david

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


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