Linux-Development-Sys Digest #988, Volume #6     Fri, 23 Jul 99 15:14:22 EDT

Contents:
  sched_yield() on "SCHED_FIFO" (Kuniyasu Suzaki)
  Values for the printer's control port ("Massimiliano Gugnali")
  game card support? (root)
  Re: Project problem - linux printer port ([EMAIL PROTECTED])
  problem with sigaction(2) wrapper in linuxthreads (glibc 2.1) (peter hatch)
  Re: High load average, low cpu usage when /home NFS mounted (Paul Kimoto)
  Re: when will Linux support > 2GB file size??? (Craig Kelley)
  Multiple kernels with different modules (Tom M. Kroeger)
  HP CD-RW Supported by RH 6.0? (Jack Steen)
  Re: NCR 53C710 Fast SCSI-2 Controller ("Tony Platt")
  Re: HP CD-RW Supported by RH 6.0? ("Youngert")
  Re: HP CD-RW Supported by RH 6.0? (David T. Blake)

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

From: [EMAIL PROTECTED] (Kuniyasu Suzaki)
Crossposted-To: comp.os.linux.questions
Subject: sched_yield() on "SCHED_FIFO"
Date: 23 Jul 1999 15:17:55 GMT


Dear,

The action of sched_yield() on real time class "SCHED_FIFO" is strange
on kernel 2.2.5-15 (Redhat 6.0).

The sched_yield() on kernel 2.2.5-15 did not yield the CPU. The
sched_yield() on kernel 2.0.36 yield the CPU. This action was same on
Solaris. What is changed on kernel 2.2.5-15?

I attached the sample program to check sched_yield(). In the program a
process is changed to be SCHED_FIFO by sched_setscheduler() and then
creates a child process by fork(). The child process should take over
the real time class "SCHED_FIFO". And the parent process yields the
CPU by sched_yield(). After that, the child process and parent process
yield each other.

The process is executed by super user. I was thinking this process
could measure the time for context switch on the real time class
"SCHED_FIFO" and it was measured on kernel 2.0.36 and Solaris. But on
2.2.5-15 the parent process didn't yield.

What makes the action strange?

Result on kernel 2.0.36
bash# ./context
Context swicth time 97 us from 148 to 149
Context swicth time 34 us from 149 to 148
Context swicth time 15 us from 148 to 149
Context swicth time 13 us from 149 to 148
Context swicth time 12 us from 148 to 149
Context swicth time 12 us from 149 to 148
Context swicth time 13 us from 148 to 149
Context swicth time 12 us from 149 to 148
Context swicth time 13 us from 148 to 149

Result on kernel 2.2.5-15
[root@bunsaku Linux]# ./context
Context swicth time 34 us from 834 to 834
Context swicth time 6 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834
Context swicth time 5 us from 834 to 834


/*+++++++ from here sample program "context.c" +++++++*/
/*
  Linux
  gcc -o context context.c

  Solaris
  gcc -lposix4 -o context context.c
 */

#define _REENTRANT
#include <sys/mman.h>
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <sys/time.h>

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define SHM_KEY 3

#include <errno.h>

#define LOOP 10
#define NUMSHM 3
int shmid[NUMSHM];
struct timeval* timelog;
pid_t* pidlist;
int* counter;

void be_rt(pid_t pid, int priority)
{
  struct sched_param param;

  param.sched_priority = priority;
  if(sched_setscheduler(pid,SCHED_FIFO,&param) == -1){
    perror("sched_setscheduler");
    exit(1);
  }
}

int main()
{
  int i,rval;
  pid_t parent,child;
  struct timezone tz;

  if ((shmid[0] = shmget(SHM_KEY, sizeof(struct timeval)*(LOOP), IPC_CREAT | 0666)) < 
0) {
    perror("shmget 0");
    exit(1);
  }
  if ((timelog = (struct timeval*)shmat(shmid[0], NULL, 0)) == (struct timeval*)-1) {  
  
    perror("shmat");
    exit(1);
  }

  if ((shmid[1] = shmget(SHM_KEY+1, sizeof(pid_t)*(LOOP), IPC_CREAT | 0666)) < 0) {
    perror("shmget 0");
    exit(1);
  }
  if ((pidlist = (pid_t*)shmat(shmid[1], NULL, 0)) == (pid_t*)-1) {
    perror("shmat");
    exit(1);
  }

  if ((shmid[2] = shmget(SHM_KEY+2, sizeof(int), IPC_CREAT | 0666)) < 0) {
    perror("shmget 0");
    exit(1);
  }
  if ((counter = (int*)shmat(shmid[2], NULL, 0)) == (int*)-1) {    
    perror("shmat");
    exit(1);
  }

  for(i = 0; i < LOOP; i++) {
    timelog[i].tv_sec = 0;
    timelog[i].tv_usec = 0;
    pidlist[i] = 0;
  }
  *counter = 0;

  if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) {
    perror("mlockall\n");
    exit();
  };

  /***** to be real time process *****/
  be_rt(getpid(),10);


  parent = getpid();
  child = fork();

  if(child == 0) { /* child process */
    child = getpid();
    while(1) {
      pidlist[*counter] = child;
      gettimeofday(&(timelog[(*counter)++]),&tz);
      /*
      thr_yield();
      yield();
      */
      if(sched_yield() == -1) {
        perror("sched_yield()");
        exit(1);
      }
    }
  }
  else {           /* parent process */
    while(*counter < LOOP) {
      pidlist[*counter] = parent;
      gettimeofday(&(timelog[(*counter)++]),&tz);
      /*
      thr_yield();
      yield();
      */
      if(sched_yield() == -1) {
        perror("sched_yield()");
        exit(1);
      }
    }
  }
  for(i = 0; i < LOOP-1; i++) {
    printf("Context swicth time %ld us from %d to %d\n",
           ((timelog[i+1].tv_sec - timelog[i].tv_sec)*1000*1000+timelog[i+1].tv_usec) 
- timelog[i].tv_usec,
           pidlist[i],pidlist[i+1]);
  }

  /*** remove shared memory ***/
  for(i = 0; i < NUMSHM; i++) {
    if (shmctl(shmid[i], IPC_RMID, NULL) < 0) {
      perror("shmctl 0");
      exit(1);
    }
  }
  /*** kill child process ***/
  rval = kill(child,SIGKILL);
  if(rval != 0) {
    fprintf(stderr,"kill(SIGKILL) error\n");
  }
}
/*+++++++ to here +++++++*/
                                        Sincerely yours,
                                        Kuniyasu Suzaki
===========================================================================
OFFICE ; Electrotechnical Lab. Ministry of International Trade and Industry

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

From: "Massimiliano Gugnali" <[EMAIL PROTECTED]>
Subject: Values for the printer's control port
Date: Fri, 23 Jul 1999 15:50:35 +0200

Hello.
I'm studing the programming of a device driver and I'm  analyzing
the files lp.c and lp.h;
I'd like to know the right meaning (a brief description) of the
constant used as control word for the printer:
LP_PSELECTP, LP_PINITP, LP_PSTROBE, LP_STRICT,
LP_PBUSY, LP_ABORT, LP_PACK, LP_PINTEN,
LP_PSELECTD, LP_POUPTPA, LP_EXIST,
LP_ABORTOPEN, LP_CAREFUL.

Please, help me 'cause I'm in a hurry!
Thank you very much.




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

From: root <[EMAIL PROTECTED]>
Subject: game card support?
Date: Fri, 23 Jul 1999 08:59:54 -0400

Hi, I'm thinking of getting the Thrustmaster ACM game card, but I'm
wondering if it is supported under Linux.  I'm running RH6, kernel
2.2.5, on a PII-400 Dell.  Can anyone tell me if they have successfully
used this card with Linux?

Thanks, Bill




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

From: [EMAIL PROTECTED]
Subject: Re: Project problem - linux printer port
Date: Fri, 23 Jul 1999 16:02:04 GMT

on 2.2.9-19 the current file is at

/usr/include/asm/current.h

watch out for the fact that current->signal.sig[0] and
current->signal.sig[1] BOTH have to be considered ...

The underlying type changed from an unsigned long for
signal and blocked to an array of two ...

But there are other "got cha's " since my changes still
dont work.

if you have any success, please let me know, for I am
also working on a parall (printer port) driver.

Thanks in advance.


In article <[EMAIL PROTECTED]>,
  Peter Allen <[EMAIL PROTECTED]> wrote:
> David B Anderson wrote:
> >
> > In article <[EMAIL PROTECTED]>,
> > smith <[EMAIL PROTECTED]> wrote:
> > >Project problem - linux printer port
> > >
> > >
> > >I am trying to wire a simple video switch to the parallel port of a
PC and
> > >have Linux
> > >it.
> > >
> > >So far I have made a connector that fools linux into beleiving that
it has a
> > >printer
> > >connected, and have sent data to it.
> >
> > You might find  the book
> >   Writing Linux Device Drivers
> >   by Alessandro Rubini
> >   Pub by O'Reilly
> > useful.  It seems surprisingly easy to
> > work with the parallel port
> > (and to test the parallel port),  not that I've done
> > anything like it...
> >
> > [EMAIL PROTECTED]
>
> This leads on to my problem brilliantly.  Thanks David :-)
> First I think the original posters problem is that /dev/lp0 is
> designed to run printers.  If you read the source (drivers/char/lp*.c)
> then it has got things like excepting interupts on the
> rising pulse rather than on the top.  /dev/parport* looked
> good, except they didn't work for me, so I used the code
> from WLDD ^^^^^.  (It is available from
> ftp://ftp.oreilly.com/published/oreilly/linux/drivers/
>
> I tried to compile it using gcc 2.7.3, which seems
> to have tightened up its type checking, as I got lots
> of warnings about incompatible pointer types.
> Then the killer error,
> cc -D__KERNEL__ -DMODULE -Wall -O2 -I/usr/include   -c short.c -o
> short.o
> short.c:177: warning: initialization from incompatible pointer type
> short.c:178: warning: initialization from incompatible pointer type
> short.c:184: warning: initialization from incompatible pointer type
> short.c: In function `short_i_read':
> short.c:199: wrong type argument to bit-complement
> short.c: At top level:
> short.c:231: warning: initialization from incompatible pointer type
> short.c:232: warning: initialization from incompatible pointer type
> short.c:238: warning: initialization from incompatible pointer type
> short.c: In function `short_bh_interrupt':
> short.c:345: warning: passing arg 1 of `do_gettimeofday' discards
> `volatile' from pointer target type
> make: *** [short.o] Error 1
>
> The errors is on line 199
> The code looks like
> read_write_t is int.
>
> read_write_t short_i_read (struct inode *inode, struct file *filp,
>                 char *buf, count_t count)
> {
>     int count0;
>
>     while (short_head == short_tail) {
>         interruptible_sleep_on(&short_queue);
>         if (current->signal & ~current->blocked) /* a signal arrived
*/
> // The error is here ^^^^^^^^^^^^^^^^^^^^^^^^
>           return -ERESTARTSYS; /* tell the fs layer to handle it */
>         /* else, loop */
>     }
>     /* count0 is the number of readable data bytes */
>     count0 = short_head - short_tail;
>     if (count0 < 0) /* wrapped */
>         count0 = short_buffer + PAGE_SIZE - short_tail;
>     if (count0 < count) count = count0;
>
>     copy_to_user(buf, (char *)short_tail, count);
>     short_tail += count;
>     if (short_tail == short_buffer + PAGE_SIZE)
>         short_tail = short_buffer;
>     return count;
> }
>
> and I cannot find where the struct 'current' is defined.
> If I could then I could work out what he is trying to do,
> but as it is I cannot.
>
> Thanks for any help,
>
>               Peter Allen
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

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

From: peter hatch <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: problem with sigaction(2) wrapper in linuxthreads (glibc 2.1)
Date: Fri, 23 Jul 1999 11:52:55 -0500

I've been having problems trying to get an app (a commercial Smalltalk
virtual machine) running under glibc 2.1.  A few days ago I positively
nailed the problem down to the sigaction() wrapper that is in the glibc
2.1 linuxthreads implementation.

The wrapper installs pthread_sighandler() as the signal handler for all
signals.  pthread_sighandler() in turn calls the user-supplied signal
handler (if any).

The problem is that pthread_sighandler() interupts Xlib function calls
and so is executed with a bogus %esp and overwrites some of the
process's memory.

This isn't a problem with Xthreads, as there is only one process when
this happens (we haven't spawned any threads).

If I include the line:

#define sigaction(a,b,c) __sigaction(a,b,c)

at the top of the file that contains our signal handling code, the
problem completely goes away because we bypass the wrapper and directly
call the sigaction syscall.

But, I can't figure out what about the wrapper is causing this to
happen.  I guess it could still be some problem with our code, but the
more I look at it the more I'm certain that it's a problem with the
glibc 2.1 code....

Any ideas??

TIA,
pete

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

From: [EMAIL PROTECTED] (Paul Kimoto)
Crossposted-To: comp.os.linux.misc,comp.os.linux.networking
Subject: Re: High load average, low cpu usage when /home NFS mounted
Date: 23 Jul 1999 11:14:16 -0500
Reply-To: [EMAIL PROTECTED]

[posted and e-mailed]

In article <[EMAIL PROTECTED]>, Ole Jacob Taraldset wrote:
> The
> /home partition is NFS mounted from [an?] SGI. When I take a look at cpu
> usage i kpm/qps most of the cpu is idle (~85%), but load average reports
> around 2. Isn't load average a function of cpu usage (only, mostly)? Can
> it be that some process is running, but not showing in ps/top/kpm? I
> feel that the system response has been reduced quite a bit after
> upgrading to RedHat 6.0.

The proc(5) man page says

        loadavg

        The load average numbers give the number of jobs in
        the run queue averaged over 1, 5 and 15 minutes.
 
Processes waiting for (slow NFS) disk operations would be in the run 
queue, but not necessarily consuming much CPU.

Have you tried tweaking the NFS mount options to try to get better
performance?

-- 
Paul Kimoto             <[EMAIL PROTECTED]>

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

Crossposted-To: comp.os.linux.advocacy
Subject: Re: when will Linux support > 2GB file size???
From: Craig Kelley <[EMAIL PROTECTED]>
Date: 23 Jul 1999 09:43:34 -0600

Robert Krawitz <[EMAIL PROTECTED]> writes:

> Not likely (because it's a VM issue rather than a filesystem issue; I
> stand corrected on that important point), but that (to me) is the crux
> of the issue: the other major 32-bit operating systems do support
> large files.

So what would happen if I saved a 3GB file under NT and then booted
into Linux?  What would it do with that NTFS partition?

Inquiring minds want to try this out.  :->

-- 
The wheel is turning but the hamster is dead.
Craig Kelley  -- [EMAIL PROTECTED]
http://www.isu.edu/~kellcrai finger [EMAIL PROTECTED] for PGP block

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

From: [EMAIL PROTECTED] (Tom M. Kroeger)
Crossposted-To: ucsc.comp.os.linux
Subject: Multiple kernels with different modules
Date: 23 Jul 1999 10:14:25 -0700


I'm modifying the 2.2.9 kernel to conduct some tests and
want to have several versions of the same kernel on 
one system.  My problem is that the modules are different 
as well, and that I'd like to be able to at boot (maybe
thought a lilo.conf variable) set where the modules 
for the current kernel should be found
eg..:



image=/boot/vmlinuz-2.2.9-test1
        modules=/lib/modules/2.2.9-test1
        label=test1
        read-only
image=/boot/vmlinuz-2.2.9-test2
        modules=/lib/modules/2.2.9-test2
        label=test2
        read-only
image=/boot/vmlinuz-2.2.9-base
        modules=/lib/modules/2.2.9-base
        label=base
        read-only


Does anyone know how this can be done, so that at boot time when I
select test1 the correct modules are automatically used?

currently I simply,

cp -r  /lib/modules/2.2.9-test1 /lib/modules/2.2.9

before I reboot.

-- 

                       tmk

=======================================================================
Tom M. Kroeger                           Pray for wind
Graduate Student, UC Santa Cruz      \    Pray for waves
e-mail: [EMAIL PROTECTED]              |\    and Pray it's your day off!
http://www.cse.ucsc.edu/~tmk         |~\
(831) 459-4458                       |__\
(831) 426-9055 home                 ,----+--


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

From: Jack Steen <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.misc
Subject: HP CD-RW Supported by RH 6.0?
Date: Fri, 23 Jul 1999 12:22:04 -0500

I have recently upgraded to RedHat Linux 6.0 with the pre-compiled
kernel on both my laptop and a newly constructed Pentium II desktop at
home. The desktop machine has a Hewlett-Packard CD-RW 7200 Plus drive.
The SW recognizes it as a CD drive, but of course I would like to be
able to use the CD-R and perhaps the CD-RW capabilities under Linux. I
have conducted a moderate search of the web, but have not come across
anything saying that someone had done this. Does anyone know of a
reference to HP CD-RW support under Linux?


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

From: "Tony Platt" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: NCR 53C710 Fast SCSI-2 Controller
Date: Sat, 24 Jul 1999 01:52:30 +1000

Mike your problem is this

The Linux NCR driver is written for the PCI bus and NOT the EISA bus card
that you have (proliant 4000 has the NCR controller on the EISA bus)

So I used to say, sorry but this controller won't work PERIOD.

But then I had a guy send me an email saying he had written a driver to
support (specifically Compaqs with NCR / EISA combo) your setup.

His name was Richard, but I can't seem to find the actual link anwhere for
you :-(

Try searching this newsgroup with dejanews or somesuch and you might come
across it.

Hope it helps, and if you still have no luck let me know.as the link ight be
on my work machine

Tony Platt
Mike Coakley wrote in message <[EMAIL PROTECTED]>...
>I am having trouble installing a RedHat 6.0 installation onto a Compaq
>Proliant 4000 with the NCR53C710 controller. The installation simply cannot
>find the controller and cannot continue without it. (I know I shouldn't be
>saying this...) I can install MS WinNT without any problems and the
>controller is recognized and the system boots off of this controller/HD.
>Does anyone out there have any ideas?
>
>Mike
>
>



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

From: "Youngert" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: HP CD-RW Supported by RH 6.0?
Date: Fri, 23 Jul 1999 17:51:43 -0400

You did not mention if your HP CD-RW 7200+ drive is an IDE or SCSI drive.
However, I assumed it is an IDE CD-RW.  Having declared that, the next thing
to do is to determine if this HP CD-RW drive is supported under Linux.  To
do so, you need either do the following:

1. Install the HOWTO doc that comes with the RedHat-6.0 and start reading
the "CD Writing HOWTO".

2. If item #1 is not preferable, you can read the "CD Writing HOWTO" off the
Internet using your web browser.  One best site that carries wuch HOWTO is
http://metalab.unc.edu/Linux/HOWTO/CD-Writing-HOWTO.html.

The "CD Writing HOWTO" should be able to point out where you can download a
set of software packages that works for your Linux and your CD-RW drive.

--
[EMAIL PROTECTED]





Jack Steen <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have recently upgraded to RedHat Linux 6.0 with the pre-compiled
> kernel on both my laptop and a newly constructed Pentium II desktop at
> home. The desktop machine has a Hewlett-Packard CD-RW 7200 Plus drive.
> The SW recognizes it as a CD drive, but of course I would like to be
> able to use the CD-R and perhaps the CD-RW capabilities under Linux. I
> have conducted a moderate search of the web, but have not come across
> anything saying that someone had done this. Does anyone know of a
> reference to HP CD-RW support under Linux?
>



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

From: [EMAIL PROTECTED] (David T. Blake)
Crossposted-To: comp.os.linux.misc
Subject: Re: HP CD-RW Supported by RH 6.0?
Date: 23 Jul 1999 17:52:35 GMT
Reply-To: [EMAIL PROTECTED]

Jack Steen <[EMAIL PROTECTED]> wrote:
> Does anyone know of a
> reference to HP CD-RW support under Linux?

If cdrecord does not support it, it is unsupported.

However, the maintainers of cdrecord are completely insane
when it comes to supporting everything they can get specs
for. To their credit.

See 
http://www.fadden.com/cdrfaq/faq.html

and 

http://www.fokus.gmd.de/nthp/employees/schilling/cdrecord.html 
http://www.fokus.gmd.de/research/cc/glone/employees/\
joerg.schilling/private/cdrecord/hp.html

-- 
Dave Blake
[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