Linux-Development-Sys Digest #936, Volume #7      Tue, 6 Jun 00 12:13:16 EDT

Contents:
  <defuct> and linuxthread ( a bit long) ([EMAIL PROTECTED])
  Binary file formats. ([EMAIL PROTECTED])
  Opening in a file in Kernel Mode??? ([EMAIL PROTECTED])
  Re: Increase the priority of a thread... how? (Tom Thorne)
  Re: Opening in a file in Kernel Mode??? (Nick Andrew)
  Looking for Linux system trace utility (David Wootton)
  Question on /dev/cpu/* in Linux 2.4.0 and /proc (David Wootton)
  How to write to series port in Linux environment? ("qsun")
  (syscall vs reading /dev) Re: Question on /dev/cpu/* in Linux 2.4.0 and /proc 
(Basile STARYNKEVITCH)
  Re: Opening in a file in Kernel Mode??? (Stefaan A Eeckels)
  Re: How to write to series port in Linux environment? (Josef Moellers)
  Re: awful performance of Linux shared memory (Marc SCHAEFER)
  Re: Newsgroup for make. (Paul D. Smith)
  Re: Opening in a file in Kernel Mode??? ([EMAIL PROTECTED])
  Re: Question on /dev/cpu/* in Linux 2.4.0 and /proc (Ian D Romanick)
  SPARC Linux Serial Port (Jason Naughton)
  Re: Opening in a file in Kernel Mode??? (Tom Roberts)
  Re: RS-485 (Grant Edwards)
  include problem (Olaf Petzold)

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

From: [EMAIL PROTECTED]
Subject: <defuct> and linuxthread ( a bit long)
Date: Tue, 06 Jun 2000 08:38:30 GMT

Hi,recently,I found linuxthread a bit fuzzy to me.
I am testing a piece of software not written by myself.
The program just hangs when I give it a heavy load.
The program is a multithreaded one.The pstree output
before the program hangs looks as follows:(a is the
programs name,the number in braket is the process id
or thread id)

        |-a(27731)---a(27734)-+-a(27737)
        |                     `-a(27738)

In fact,in this process tree,only a(27737) and a(27738)
are created by pthread_create(), a(27734) is created by
linux itself when the first pthread_create() is called.
I don't know why linux must create a(27734),
just let a(27737) and a(27738) have parent?(This is my
first question).

Then, for a reason I havn't found out yet,a hangs.Now,
the process tree looks like this:

        |-a(27731)---a(27734)<defunct>
        |-a(27737)
        |-a(27738)
As I knows, <defunct> is caused by a call of exit().
I've checked there were many exit() in the source of
a.But,it seems a call in every thread will terminate
the process,am I right? Then why there is the fuzzy
<defunct>? Or, is it caused by signal? (This is my
second question.)

Thanks.





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

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

From: [EMAIL PROTECTED]
Subject: Binary file formats.
Date: Tue, 06 Jun 2000 08:46:46 GMT

Greeting:

   I need the detail documents about the format
of a.outobject file, a.out executable file, ELF
files. Does anyone know the location of them?

Thanks a lot.


                               Allen


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

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

From: [EMAIL PROTECTED]
Subject: Opening in a file in Kernel Mode???
Date: Tue, 06 Jun 2000 09:41:54 GMT

Hi,
I am facing a problem. I have to open a file in the Kernel Mode module
(the name of the file is passed by the user mode app). Is it possible
to open a file (a normal .txt or .dat file) in the Kernel Mode? If yes,
how do i go about doing it? Please help me with this.
Any clues/tricks are most welcome.

[[ Basically, I am writing a driver module which takes the filename as
the input, opens the file, read the data and writes it to my card
memory which sits on a PCI Bus (with a PLX 9080 and ADSP SHARC
processor). I am able to write the data reading it from a buffer (an
array), but struck up with this file reading problem]].

with advance thanks,
Vittal.


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

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

From: [EMAIL PROTECTED] (Tom Thorne)
Subject: Re: Increase the priority of a thread... how?
Date: Tue, 06 Jun 2000 10:12:06 GMT

>>>What problems are you seeing in your app to need a priority change.
>> 
>> I am porting a win32 app over to linux.  It has an ip message handler
>> thread that runs (on win32) at a higher priority than other threads in
>> the app.
>You should really consider what your Win32 application does, as the
>methods to get best performance out of each OS (UNIX and WinNT/2K)
>differ considerably.
>The only way to get decent performance out of a WinNT server
>is to be multi-threaded, with each thread serving several
>connections, and to use completion ports. Because this results in
>oodles of messages, you need to raise the priority on the
>message handler thread.

Fortunately I only need one thread for all the connections: my app
needs reliable multicast; as a result, my message handler makes do
with listening on 2 udp sockets rather than a multitude of tcp
sockets.


Tom Thorne <tomt at flyingpig dot com>

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

From: [EMAIL PROTECTED] (Nick Andrew)
Subject: Re: Opening in a file in Kernel Mode???
Date: 6 Jun 2000 22:45:23 +1000

[EMAIL PROTECTED] writes:

>[[ Basically, I am writing a driver module which takes the filename as
>the input, opens the file, read the data and writes it to my card
>memory which sits on a PCI Bus (with a PLX 9080 and ADSP SHARC
>processor). I am able to write the data reading it from a buffer (an
>array), but struck up with this file reading problem]].

Sounds like a usermode problem. If you provide read and write functions
in your driver, a usermode process can do the high-level stuff.

Nick.
-- 
Pacific Internet                  SP4   Fax: +61-2-9233-6545 Voice: 9253-5762
G.P.O. Box 3400, Sydney NSW 1043        http://www.zeta.org.au/

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

From: David Wootton <[EMAIL PROTECTED]>
Subject: Looking for Linux system trace utility
Date: Tue, 06 Jun 2000 08:54:40 -0400

I'm looking for a system trace utility for Linux that ideally would
record a trace file containing process dispatch events, and also allows
a user process to record events in the same trace file.

I'm aware of the Linux Trace Toolkit package
(http://www.opersys.com/LTT/) which does record process dispatch events.
I'm also aware of strace, which is not what I need, since it only
records system calls and signals.

If you know of other alternatives, please respond to the newsgroup.

Thanks - Dave

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

From: David Wootton <[EMAIL PROTECTED]>
Subject: Question on /dev/cpu/* in Linux 2.4.0 and /proc
Date: Tue, 06 Jun 2000 09:02:48 -0400

I noticed new support in the 2.4.0 kernel for /dev/cpu/*/msr,
/dev/cpu/microcode, and /dev/cpu/*/cpuid. I'm trying to understand why
the support is added by means of a device entry, rather than a system
call.

Also, I'm trying to understand why system info is obtained by reading
from /proc instead of system calls.

Finally, in both cases, if I issue any kind of I/O to these, is the
request processed sychronously, as I would expect a system call to be
processsed?

Please reply to newsgroup

Thanks - Dave

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

From: "qsun" <[EMAIL PROTECTED]>
Subject: How to write to series port in Linux environment?
Date: Tue, 6 Jun 2000 08:56:39 -0400

I want to write charicters to series port in linux using
AOIs like outp in DOS environment. What's the APIs ?

Thank you





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

From: Basile STARYNKEVITCH <[EMAIL PROTECTED]>
Subject: (syscall vs reading /dev) Re: Question on /dev/cpu/* in Linux 2.4.0 and /proc
Date: 06 Jun 2000 15:26:41 +0200


Nota: please remove antispam device in reply address - Basile.

>>>>> "David" == David Wootton <[EMAIL PROTECTED]> writes:

    David> I noticed new support in the 2.4.0 kernel for
    David> /dev/cpu/*/msr, /dev/cpu/microcode, and
    David> /dev/cpu/*/cpuid. I'm trying to understand why the support
    David> is added by means of a device entry, rather than a system
    David> call.

I am not a Linux kernel expert, but I remember having read that Linus
(and other kernel hackers) dislike the idea of adding new system
calls, in particular adding non Posix system calls (by system call, I
mean an INT 0x80 trap to the kernel, ie a <asm/unistd.h> new number).


    David> Also, I'm trying to understand why system info is obtained
    David> by reading from /proc instead of system calls.

See above.


My opinion is that, since Linux is now the dominant Unix
implementation (in terms of number of systems), it should be able to
enhance Posix and unix standards by adding new system calls (or
functionalities). I believe that since Linux is now an important OS,
any good new Linux system call will gradually be added to other
(commercial) Unices and/or to future Posix standards. I understand the
initial position of Linux kernel authors (stick to Posix standard),
but now that Linux is mainstream it could change (since Linux
evolution has a real influence of Unix today)

In particular, I am dreaming of a process persistance call, or a call
dumping a restartable (checkpointed) image of a process into a file,
or even a MAP_INHERIT flag to mmap. Yes I do know these are difficult
to implement (mostly because some process state -eg socket
connections- are not checkpointable). Another useful new syscall might
be a new execve with support for separation of options vs arguments
flags to programs (this also means a new main() interface...)

Regards.

Nota: if replying by email remove my antispam device in reply address (Basile).


N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

=====================================================================
Basile STARYNKEVITCH   ----  Commissariat � l Energie Atomique 
DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France
phone: 1,69.08.60.55; fax: 1.69.08.83.95 home: 1,46.65.45.53
email: Basile point Starynkevitch at cea point fr 


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

From: [EMAIL PROTECTED] (Stefaan A Eeckels)
Subject: Re: Opening in a file in Kernel Mode???
Date: Tue, 6 Jun 2000 12:18:23 +0200

In article <8hih0v$l69$[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] writes:
> 
> [[ Basically, I am writing a driver module which takes the filename as
> the input, opens the file, read the data and writes it to my card
> memory which sits on a PCI Bus (with a PLX 9080 and ADSP SHARC
> processor). I am able to write the data reading it from a buffer (an
> array), but struck up with this file reading problem]].
Put the data into a module, load it, send the data to your
card, and then unload the module. 

Take care,

-- 
Stefaan
-- 
--PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)--
Ninety-Ninety Rule of Project Schedules:
        The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: How to write to series port in Linux environment?
Date: Tue, 06 Jun 2000 16:07:53 +0200

qsun wrote:
> =

> I want to write charicters to series port in linux using
> AOIs like outp in DOS environment. What's the APIs ?

If all you want to do is write to a serial port to communicate with a
device, you should use open()/write()/close() on the /dev/ttyS* devices.
You might need to use the tcgetattr()/tcsetattr() functions to configure
the ports as far as baud rate and framing is concerned.

There are inb()/outb() functions that need ioperm()-calls to enable
access, but these are low-level and will probably interfere with the
serial driver already taking care of the ports.

More in the finely printed manuals.

-- =

Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1

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

From: Marc SCHAEFER <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,yu.os.unix
Subject: Re: awful performance of Linux shared memory
Date: 5 Jun 2000 13:05:57 GMT

Mladen Adamovic <[EMAIL PROTECTED]> wrote:
: Q: Why my program using shared memory runs to slow?

Infact, it is not slow, its throughput is quite good. What is bad is
the latency. To diminush the latency, your options:

   - augment TZ  (bad)
   - make so that the process is not all the time active. If it starts
     to sleep (e.g. on semaphores), the task switch will happen sooner.

Or do not depend on any latency altogether. After all, if the process
is busy, it's because it has something to do.


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

From: [EMAIL PROTECTED] (Paul D. Smith)
Subject: Re: Newsgroup for make.
Date: 06 Jun 2000 10:47:53 -0400
Reply-To: [EMAIL PROTECTED]

%% Erik Max Francis <[EMAIL PROTECTED]> writes:

  emf> Thaddeus L Olczyk wrote:

  >> Does anyone know what newsgroup you are supposed to use for
  >> the "make" utility?

  emf> comp.unix.programmer or comp.unix.questions would probably be the
  emf> typical place.

The former is probably better (I, at least, never read
comp.unix.questions).

If you're asking about GNU make in particular, you can also use
gnu.utils.help or gnu.utils.bug.

-- 
===============================================================================
 Paul D. Smith <[EMAIL PROTECTED]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
===============================================================================
   These are my opinions---Nortel Networks takes no responsibility for them.

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

From: [EMAIL PROTECTED]
Subject: Re: Opening in a file in Kernel Mode???
Date: Tue, 06 Jun 2000 14:42:23 GMT

[EMAIL PROTECTED] wrote:

> I am facing a problem. I have to open a file in the Kernel Mode module
> (the name of the file is passed by the user mode app). Is it possible
> to open a file (a normal .txt or .dat file) in the Kernel Mode? If
> yes, how do i go about doing it? Please help me with this.
> Any clues/tricks are most welcome.

You should use the read/write methods of your driver to pass the data
from an arbitrary buffer, then you can use your device as a file with
read/write, cat, etc. If this is not your device's principle data, use
an ioctl that receives a buffer. You shouldn't be opening the file in
the kernel though.

> [[ Basically, I am writing a driver module which takes the filename as
> the input, opens the file, read the data and writes it to my card
> memory which sits on a PCI Bus (with a PLX 9080 and ADSP SHARC
> processor). I am able to write the data reading it from a buffer (an
> array), but struck up with this file reading problem]].

Funnily enough we also are using the PLX9080 and are currently running
into problems with DMA interrupts. Have you got through that bit yet? :-
)

cheers,

alan


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

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

From: [EMAIL PROTECTED] (Ian D Romanick)
Subject: Re: Question on /dev/cpu/* in Linux 2.4.0 and /proc
Date: 6 Jun 2000 08:24:09 -0700

David Wootton <[EMAIL PROTECTED]> writes:

>I noticed new support in the 2.4.0 kernel for /dev/cpu/*/msr,
>/dev/cpu/microcode, and /dev/cpu/*/cpuid. I'm trying to understand why
>the support is added by means of a device entry, rather than a system
>call.

>Also, I'm trying to understand why system info is obtained by reading
>from /proc instead of system calls.

That's an easy one.  They do it like that because they don't want to have to
write a bunch of special user-mode utilities for querying that data.  Why
write a special program when cat will do.  I also think that a bunch of the
kernel people have been influence somewhat by Plan-9 (which does stuff a lot
like this).
-- 
I was actually quite pleased to see the Sonics win   http://www.cs.pdx.edu/~idr
game four of the 1996 NBA Finals...until I saw the 
USA Today headline that read, "Sweepless In Seattle."

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

From: Jason Naughton <[EMAIL PROTECTED]>
Subject: SPARC Linux Serial Port
Date: 6 Jun 2000 15:23:40 GMT

Hi all,

        I looking for information regarding the sparc serial port
Zilog8530.  A professor wishes to develop write a device driver which
interfaces with the Zilog8530 hardware.  Only concern here is that he
has linux source which compiles on a PC.  If you have the base
address, interrupt, (obtained from dmesg) can you use the header
definitions for offsets to all the control registers regardless to the
specific uart used?

-- 
                Cheers
                     Jason 

--
                           
| Jason Naughton, B. Eng, M.E. Sc., P.Eng | email: [EMAIL PROTECTED] |
| Lead Engineer,                          | Office:  (416)-979-5000 x7168 |
| Department of Electrical Engineering,   | FAX:     (416)-979-5280       |
| Ryerson Polytechnic University          | Home:    (905)-839-8161       |


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

From: Tom Roberts <[EMAIL PROTECTED]>
Subject: Re: Opening in a file in Kernel Mode???
Date: Tue, 06 Jun 2000 10:33:01 -0500

[EMAIL PROTECTED] wrote:
> I am facing a problem. I have to open a file in the Kernel Mode module
> (the name of the file is passed by the user mode app). Is it possible
> to open a file (a normal .txt or .dat file) in the Kernel Mode? If yes,
> how do i go about doing it? Please help me with this.
> Any clues/tricks are most welcome.

I think a better plan is to design your driver with an ioctl() which
gives a user program the ability to read/write the on-board memory.
Then the user program can open and read the file, and write it to
the board. We do this for several custom boards and it works well --
we have a boot program which boots and then monitors the board(s);
ultimately it goes into the inittab so the boards are rebooted 
automatically. We also have a dump program which can dump on-board
memory -- that's essential for debugging.

The ioctl arg we use is a pointer to this structure:
        struct LSPS_ioctl {
                __u32 cpu;      // for RESETCPU and RUNCPU only
                __u32 addr;     // board address
                __u32 size;     // size (in bytes)
                __u32 mode;     // LONGS or BYTES
                void *data;     // user data
        };
And the ioctl cmd-s we use are: RESETBOARD, RESETCPU, RUNCPU, MEMREAD,
MEMWRITE, and STARTIO. mode is needed because the board is big-endian
and the host is little-endian.


I don't think a module can easily do file I/O. At least I have
not seen any module which does so. I suspect you need to call VFS
functions directly, rather than open/close/read/write (or their 
sys_* incarnations); remember the filename of open and the data for 
read/write are in user space, and your module has no user space....


Tom Roberts     [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: RS-485
Date: Tue, 06 Jun 2000 15:59:02 GMT

In article <[EMAIL PROTECTED]>, Clayton Haapala wrote:
>
>> RS-485 specifies voltage levels etc.  It has nothing to do with
>> software except for the possible need to manually control the
>> "direction" of the line driver/receiver by toggling RTS.
>
>Yeah -- what is it +- 13 volts rather than +- 5?  Much better
>to snake RS-485 cables around the DC Arc welder in the shop...

RS-485 is differential 0-5V differential.  RS-232 is
single-endied +/-<something> (where <something> is allowed to
be anywhere between 3 and 15 volts).  RS-485, when run through
good twisted pair wiring will go several kilometers and decent
baud rates.  RS-232 is only speced up to a few meters.

>When I last dealt with RS-485, back in the misty dawn of time,
>we had ISA serial cards that looked to the PC just like their
>RS-232 cousins, so there were no software differences that I
>had to deal with.

Exactly.

>It could be, though, that there were RS-485 features I just
>didn't know about, or didn't need to use.

If you're doing half-duplex communication over a single pair of
wires, you _may_ have to control the line direction (typically
done with RTS).  Decent RS-485 boards will do this in hardware
if you want them to.

-- 
Grant Edwards                   grante             Yow!  Remember, in 2039,
                                  at               MOUSSE & PASTA will
                               visi.com            be available ONLY by
                                                   prescription!!

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

From: Olaf Petzold <[EMAIL PROTECTED]>
Subject: include problem
Date: Tue, 06 Jun 2000 04:44:36 +0200

Hallo,

I wrote an include file for use inside a module and user space. This
include
uses only vmalloc/vfree inside kernel space therefore I wrote:

#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#else
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stdbool.h>
#include <assert.h>
#endif

In user space all is working, with
# gcc -Wall -O3 rbuf.c -D__KERNEL__ -o rbuf

I get mass of errors, see below. Why ??

Thanks    Olaf


gcc -Wall -O3 rbuf.c -D__KERNEL__ -o rbuf
In file included from /usr/include/linux/affs_fs_i.h:5,
                 from /usr/include/linux/fs.h:269,
                 from /usr/include/linux/capability.h:13,
                 from /usr/include/linux/binfmts.h:5,
                 from /usr/include/linux/sched.h:8,
                 from /usr/include/linux/vmalloc.h:4,
                 from rbuf.h:20,
                 from rbuf.c:16:
/usr/include/linux/time.h:69: warning: `FD_SET' redefined
/usr/include/sys/select.h:63: warning: this is the location of the
previous definition
/usr/include/linux/time.h:70: warning: `FD_CLR' redefined
/usr/include/sys/select.h:64: warning: this is the location of the
previous definition
/usr/include/linux/time.h:71: warning: `FD_ISSET' redefined
/usr/include/sys/select.h:65: warning: this is the location of the
previous definition
/usr/include/linux/time.h:72: warning: `FD_ZERO' redefined
/usr/include/sys/select.h:66: warning: this is the location of the
previous definition
In file included from /usr/include/linux/affs_fs_i.h:5,
[...]
/usr/include/linux/time.h:9: redefinition of `struct timespec'
/usr/include/linux/time.h:51: parse error before `suseconds_t'
/usr/include/linux/time.h:51: warning: no semicolon at end of struct or
union
/usr/include/linux/time.h:88: field `it_interval' has incomplete type
/usr/include/linux/time.h:89: field `it_value' has incomplete type
In file included from /usr/include/linux/fs.h:269,
[.........]
In file included from rbuf.c:16:
rbuf.h: In function `rbuf_init':
rbuf.h:50: `INFO' undeclared (first use in this function)
rbuf.h:50: (Each undeclared identifier is reported only once
rbuf.h:50: for each function it appears in.)
rbuf.h:50: parse error before string constant
rbuf.h: In function `rbuf_resize':
rbuf.h:121: `INFO' undeclared (first use in this function)
rbuf.h:121: parse error before string constant



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


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