Linux-Development-Sys Digest #448, Volume #8     Sun, 28 Jan 01 16:13:23 EST

Contents:
  Re: Communication between kernel module and user space program ("knightG")
  Re: How to build...? ([EMAIL PROTECTED])
  Re: Communication between kernel module and user space program (Kasper Dupont)
  Re: booting CD, ramfs -> / in 2.4, some issues (Kasper Dupont)
  Re: Sys call for Available Memory? - Attempts to help, but still no answer after 
months.  :-( (Kasper Dupont)
  how to dynamically load any object file into current process's address space (Anil 
Prasad)
  Re: signal (Kasper Dupont)
  PCI errors on 2.4.0 kernel ([EMAIL PROTECTED])
  Re: Communication between kernel module and user space program (Kaelin Colclasure)
  2.4.0 VFS panic on iopener (VIA motherboard) (Tammer Amine Saleh)
  Re: how to dynamically load any object file into current process's address space 
(Mike McDonald)
  Re: Access to beep (echo \a) on embedded system with no console ("Bill Anderson")
  Why max 8 SCSI LUNS/device ("Bill Anderson")
  framebuffer drivers? ("Thomas Raschbacher")
  NIC: loadable module doesn't compile ("Russell de Grove")

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

From: "knightG" <[EMAIL PROTECTED]>
Subject: Re: Communication between kernel module and user space program
Date: Sat, 27 Jan 2001 09:33:09 +0100


Norm Dresner <[EMAIL PROTECTED]> je v sporo�ilu novic
JULc6.11843$[EMAIL PROTECTED] napisal ...
> What's wrong with having a thread devoted to reading from the device and
> communicating with the remained of the program via global variables or the
> usual IPC mechanisms?
>
>     Norm

How would this thread read from the device, like: while {  read } ?
If it is reading all the time it will use too many resources.


Gregor




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

From: [EMAIL PROTECTED]
Subject: Re: How to build...?
Date: Sun, 28 Jan 2001 08:33:32 -0000

On Sun, 28 Jan 2001 01:28:18 +0100 The Linux Fan!!! <[EMAIL PROTECTED]> wrote:

| How to rebuild an earlier created patch?
| I have a patch for 2.2.14 kernel and I would like to rebuild it in order to
| patch the new 2.4.0 kernel.
| How can I do this?

Just apply the patch as is and see if patch finds the context.
It should indicate how many lines off it is.  Look at the code
and see if it appears right.

There's a chance it might not apply.  Perhaps that part of the
code has undergone a redesign.  You might have to hack away.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Communication between kernel module and user space program
Date: Sun, 28 Jan 2001 12:39:56 +0100

knightG wrote:
> 
> Hello, we've been trying to establish somekind of connection between kernel
> and USP(user space programm).
> We've decided to use a character device.
> The problem is that USP has to read from characted device all the time,
> which is stupid.We've tried using SELECT however it doesn't seem to have any
> effect because select seems to check if he MAY read the data not checking
> the changes.
> 
> Does anyone has experience with our program ? Are there any other solutions
> for it ?
> 
> Thank you in advance,
> Gregor Doltar

I think your struct file_operations must contain
a poll methode for select to work. I don't know
the details about how it works.

Some example code can be found in
linux/drivers/char/random.c look for the
differences between random_fops and urandom_fops.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: booting CD, ramfs -> / in 2.4, some issues
Date: Sun, 28 Jan 2001 12:57:38 +0100

[EMAIL PROTECTED] wrote:
> 
> On Sat, 27 Jan 2001 13:35:53 +0100 Kasper Dupont <[EMAIL PROTECTED]> wrote:
> 
> | A quite good way to initialize /etc/mtab is by doing
> | "cp /proc/monts /etc/mtab" somewhere in the bootup after
> | the pivot_root call.
> 
> I could put that in my cdinit program before it hands off to
> init, just in case the rc scripts don't initialize it.

Unfortunately they sometimes does that, and not in the
way you would want them to. This is how it looks in RH7.0
/etc/rc.d/rc.sysinit

# Clear mtab
>/etc/mtab
 
# Remove stale backups
rm -f /etc/mtab~ /etc/mtab~~
 
# Enter root and /proc and /proc/bus/usb into mtab.
mount -f /
mount -f /proc
[ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs
/proc/bus/usb     

> 
> | Another solution, which have been claimed not to be good
> | is to let /etc/mtab be a symbolic link to /proc/mounts.
> | I vote for that solution, if there is any problems with
> | that they should be fixed by changing the proc filesystem.
> 
> My concern with that would be mount trying to write to it.
> But if /proc/mounts discards writes, I guess it should work.
> I've always disliked /etc/mtab since it's not assured to
> represent what the kernel actually has mounted.  If mount
> only acts to keep /etc/mtab in sync with /proc/mounts then
> I think all is well (and old programs get to see what they
> expect in /etc/mtab, too).

The mount command calls lstat on /etc/mtab. In the case where
it is a symbolic link to /proc/mounts it does not attempt to
write /etc/mtab. You would have to read the source to find
the exact criteria.

Unfortunately /proc/mounts contains slightly less information
than /etc/mtab. In most cases it does not matter, but I read
somewhere that there is a problem with the loopback device.

Both with /etc/mtab and /proc/mounts has a problem with
filenames. If you give relative filenames to mount then there
will be relative filenames in the list. In that case "umount
-a" might not be able to find neither mountpoint nor block
device inode.

In the case with different root directories it is also a
tricky question what the absolute path is.

> 
> --
> -----------------------------------------------------------------
> | Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
> | [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
> -----------------------------------------------------------------

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Sys call for Available Memory? - Attempts to help, but still no answer 
after months.  :-(
Date: Sun, 28 Jan 2001 13:12:12 +0100

MeekGeek wrote:
> 
> On Sat, 08 Jul 2000 09:15:32 GMT, [EMAIL PROTECTED] wrote:
> 
> >On Sat, 08 Jul 2000 03:44:36 GMT MeekGeek <[EMAIL PROTECTED]> wrote:
> >
> >| Is there any kind of a standard system function that returns how much
> >| memory is available?  I'd like to know what memory is available to my
> >| process -- both the virtual memory available, and the physical memory
> >| installed in the machine.
> >|
> >| I'm particularly interested in Solaris and Linux.  I found
> >| rlimit(RLIMIT_VMEM, ...) for Solaris, but it's not supported under
> >| Linux.
> >|
> >| Is there a system call that returns the available (and total) system
> >| memory under Linux?
> 
> >Use RLIMIT_AS.
> 
> Unfortuntely, that doesn't seem to return either total, or available
> memory,  under either Solaris or Linux.  Instead, it returns the
> available address space (thus "AS"), which tends to be 2.1GB all the
> time.  I want to be able to do some engineering, based on total and
> available memory in the machine at the time of my program starting.
> This is actually fairly critical to my product.
> 
> The only way I have found to get the memory values is to use
> Linux-specific entries in the /proc and then I have to parse those.
> My program must run under several Unix variants.
> 
> Surely there is some (system) way to find out how much memory is
> either installed or available!
> 
> Can someone help to point me at a system call for the free memory
> value?  One that indicates only the free memory available for my
> program is fine, even if that doesn't match what's free in the system.
> 
> What I'd really like is virtual memory *available,* and physical
> memory total (installed memory).
> 
> Anybody?  Is this really such a difficult question?
> 
> Thanks,
> M

Top shows the total amount of memory in the system.
If there exist a single portable implementation of
top you could study that.

Unfortunately I don't think there is one way that
works on all Unix variants. You probably need to
use some #ifdef in your code and write code for
each of the systems your program must run on.

-- 
Kasper Dupont

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

From: Anil Prasad <[EMAIL PROTECTED]>
Subject: how to dynamically load any object file into current process's address space
Date: Sun, 28 Jan 2001 18:09:39 +0530

Hi everybody,
Can somebody tell me how any process can load some object file into its
address space and call any known function. much like apache's
dynamically loadable modules, which are loaded by the apache daemon by
reading the configuration file.
I basically want to write an daemon which on occuring of any event will
load the handler for that event from disk and call the handler function.
These handlers are specified in the configuration file.
Any pointers will be greatly appreciated..
Thanks,
Anil




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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: signal
Date: Sun, 28 Jan 2001 17:50:00 +0100

TataZ wrote:
> 
> hi,
> 
> first, excuse me for my poor english.
> i have to make 2 programs, a client and a server : the client can send a
> string to the server.
> but i must use the signal handlers to do this, for SIGUSR1 and SIGUSR2.
> the client sends a bit and the server acknowledge by killing the client with
> a SIGUSR1
> the client has to transmit its pid bit per bit. we can use sleep or usleep
> for pid transmitting only. then i'm not allowed to use usleep when the pid
> is transmitted.
> 
> when you start the server, it prints its pid :
> $./server
> 1234
> 
> and then you start the client like this :
> $./client 1234 'hello !'
> 
> the first time i lauch the client, there is no problem.
> but then, i kill the server and the client.
> 
> then i lauch the server again :
> $./server
> 1236
> 
> and the same thing for the client :
> $./client 1236 'hello !'
> 
> on the second time, the server receive the pid of the client, but after
> this, the client exit, saying me that he received a SIGUSR1, _which is not
> caught !_
> this is exactly the same binary as the first try, but it's doesn't work any
> longer.
> 
> so does anyone have this king of problem ? and what could be the solution ?
> 
> thanks
> TataZ

Are you doing _all_ comunication using kill()???
Of course that should be possible, but does not
make much sense. What is your reason for not
using sockets/pipes or other usual communication
channels?

How does the server know the clients pid when it
receives the first bit?

Are you sure that the client installs its own
signal handler before sending the first signal
to the server?

Are you sure that the signal handler is not
disabled each time a signal has been received?

Perhaps a little more detail about the
communication protocol you are using would be
helpfull.

-- 
Kasper Dupont

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

From: [EMAIL PROTECTED]
Subject: PCI errors on 2.4.0 kernel
Date: Sun, 28 Jan 2001 16:48:04 GMT

I'm getting severe errors with the new 2.4.0
kernel on an IBM Netfinity 7000.  It won't boot
at all with SMP enabled; gets PCI allocation
errors under UP.  Things work ok on 2.2.16-3smp
from RedHat.  (Is there any way to do a scroll
lock during boot so the messages don't go away?)
Deja news seems to reformat the messages, sorry.
I need to get this thing up on 2.4 to enable
large file support.   Would you please reply to
both me and the list so that I don't miss any
replies?  Thanks -  [EMAIL PROTECTED]
Here's the errors from the UP version:

PCI: Probing PCI hardware
PCI: i440KX/GX host bridge 00:19.0: secondary bus
00
PCI: i440KX/GX host bridge 00:1a.0: secondary bus
01
PCI: Cannot allocate resource region 0 of device
00:0f.0
PCI: Cannot allocate resource region 1 of device
00:0f.0
PCI: Cannot allocate resource region 2 of device
00:0f.0
PCI: Cannot allocate resource region 3 of device
00:0f.0
PCI: Cannot allocate resource region 4 of device
00:0f.0
PCI: Cannot allocate resource region 5 of device
00:0f.0
  got res[80000000:800003ff] for resource 0 of
PCI device 8086:0008 (Intel Corporation)
PCI: Error while updating region 00:0f.0/1
(80000408 != 80000008)
  got res[80000400:800007ff] for resource 1 of
PCI device 8086:0008 (Intel Corporation)
PCI: Error while updating region 00:0f.0/2
(80000808 != 80000008)
  got res[80000800:80000bff] for resource 2 of
PCI device 8086:0008 (Intel Corporation)
PCI: Error while updating region 00:0f.0/3
(80000c08 != 80000008)
  got res[80000c00:80000fff] for resource 3 of
PCI device 8086:0008 (Intel Corporation)
PCI: Error while updating region 00:0f.0/4
(80001008 != 80000008)
  got res[80001000:800013ff] for resource 4 of
PCI device 8086:0008 (Intel Corporation)
PCI: Error while updating region 00:0f.0/5
(80001408 != 80000008)
  got res[80001400:800017ff] for resource 5 of
PCI device 8086:0008 (Intel Corporation)


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

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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Communication between kernel module and user space program
Date: 28 Jan 2001 09:59:09 -0800

"knightG" <[EMAIL PROTECTED]> writes:

> Hello, we've been trying to establish somekind of connection between kernel
> and USP(user space programm).
> We've decided to use a character device.
> The problem is that USP has to read from characted device all the time,
> which is stupid.We've tried using SELECT however it doesn't seem to have any
> effect because select seems to check if he MAY read the data not checking
> the changes.

An alternative to select() that might prove simpler to implement is to use
SIGIO from the kernel to wake the user-space program when there is something
relevant for it to read. See ``Asynchronous Notification'' on pp. 117-121 of
Rubini's ``Linux Device Drivers''.

-- Kaelin

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

From: [EMAIL PROTECTED] (Tammer Amine Saleh)
Subject: 2.4.0 VFS panic on iopener (VIA motherboard)
Reply-To: [EMAIL PROTECTED]
Date: Sun, 28 Jan 2001 20:03:28 GMT

I've been trying to get linux-2.4.0 working on my iopener, but I've
continually gotten a VFS panic upon boot.  
        The kernel recognize the ide controller, and it recognizes the
built-in static-ram disk (which is just another ide device, as far as
Linux is concerned), but it bitches about not being able to find the
second ide device (the hard-drive). 
        I've read in some old linux-kernel-digest message that this was due to
a slightly broken VFS system with respect to VIA motherboards in >2.3.90
kernels.  Does anyone know if this has been addressed at all, or if there
is a known work-around for the problem.  I am interested in running 2.4.0
for the USB support.

Thank you in advance,
Tammer Saleh - [EMAIL PROTECTED]

PS:  The iopener is running Slackware 7.1

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

Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Mike McDonald)
Subject: Re: how to dynamically load any object file into current process's address 
space
Date: Sun, 28 Jan 2001 20:20:04 GMT

In article <[EMAIL PROTECTED]>,
        Anil Prasad <[EMAIL PROTECTED]> writes:
> Hi everybody,
> Can somebody tell me how any process can load some object file into its
> address space and call any known function. much like apache's
> dynamically loadable modules, which are loaded by the apache daemon by
> reading the configuration file.
> I basically want to write an daemon which on occuring of any event will
> load the handler for that event from disk and call the handler function.
> These handlers are specified in the configuration file.
> Any pointers will be greatly appreciated..
> Thanks,
> Anil

  dlopen() is the way to go.

  Mike McDonald
  [EMAIL PROTECTED]

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

From: "Bill Anderson" <[EMAIL PROTECTED]>
Subject: Re: Access to beep (echo \a) on embedded system with no console
Date: Mon, 29 Jan 2001 13:26:44 +0700

In article <94r3le$n$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:

> Folks,
> 
>   I am building an embedded system, and putting together a custom
>   kernel.
> 
>   The hardware is an AMD 486 with 16 meg Flash memory disk, and PCMCIA,
>   where I am running a Lucent wireless card.
> 
>   I am short of space, and wish to have a minimal feature kernel.
> 
>   I wish to have access to the console beep, but I do not need a full
>   console.
> 
>   The hardware has a PC-compatible squeaker, that I want to be able to
>   squeak with 'echo \\a > /dev/console' or something in a shell script.

Well, you will first need to pass echo an option to interpret the \a:
echo -e \\a
otherwise, echo just echoes the text '\a'

Just a thought.

Bill Anderson

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

From: "Bill Anderson" <[EMAIL PROTECTED]>
Subject: Why max 8 SCSI LUNS/device
Date: Mon, 29 Jan 2001 13:32:05 +0700

Is there any (good) reason why the kernel still limits (apparently even
in 2.4) the maximum number of LUNS/SCSI device to 8?

If not, how difficult would it be to modify that?

TIA, Bill

--
Bill Anderson
Linux in Boise Club  
http://www.libc.org

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

From: "Thomas Raschbacher" <[EMAIL PROTECTED]>
Subject: framebuffer drivers?
Date: Sun, 28 Jan 2001 21:31:10 +0100

hi
is there a tutorial/faq about writing (accelerated)
framebuffer drivers for 2.4.0

bye
        ThomasR
-- 
=====BEGIN GEEK CODE BLOCK=====
GCS/CC/E/M/MU/S d- s: a--- C++++(++) UL++++ P+ L++++ E W+++ N+++ o-- K w-- O
M-- V- PS+ PE-- Y++ PGP+++ t+++ 5+ X- R tv b++++ DI- D+ G++ e-->+++++ h-- !r
z- 
======END GEEK CODE BLOCK======

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

From: "Russell de Grove" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.networking
Subject: NIC: loadable module doesn't compile
Date: 28 Jan 2001 20:35:50 GMT

Have a new computer with two KTI KF-330 NICs, they come with a loadable
module that is compiled for the 2.2.9 kernel. I have installed RedHat 7
(2.2.16-22), the source for the module does not compile.

Apparently definitions have changed in linux/netdevice.h and
linux/interrupts.h. It appears that in netdevice.h 

struct device is replaced with struct net_device
struct enet_statistics is replaced with struct net_device_stats

Making these replacements in the driver source leaves me with three
compilation errors.

1) There are two references to tbusy, which is not a member of struct
net_device.
The transmit function tries to set bit 0, and the interrupt function tries
to clear it. Apparently, the module wants to indicate whether it is
transmitting.

2) The interrupt function also tries to set a value of NET_BH. There is an
enum of WHATEVER_BH values in interrupts.h, but NET_BH is not among them.
This is apparently a priority ranking for handling interrupts.

If anyone knows these libraries well enough to suggest what actions and
values I might try to replace the bad params with, I'd be very grateful.
Otherwise, suggesting a cheap NIC that is known to work with RedHat 7
(their hardware FAQ wasn't too helpful, mostly recommends 3COM NICs, which
are a little spendy) would help me out just as much (except I wouldn't get
as big a thrill out of buying a new NIC as I would from fixing a driver...)

Thanks,
        Russell de Grove
        [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 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