Linux-Development-Sys Digest #449, Volume #8     Mon, 29 Jan 01 07:13:05 EST

Contents:
  Re: NIC: loadable module doesn't compile (Michael Mueller)
  Re: This time is "df". Please help (unsigned)
  Re: booting CD, ramfs -> / in 2.4, some issues ([EMAIL PROTECTED])
  How can I find base address of a device? ([EMAIL PROTECTED])
  'top' won't run; gives msg 'bad data in /var/run/utmp' (Professor Bruno)
  Newbie to kernel module programming ("Rich C.")
  Re: booting CD, ramfs -> / in 2.4, some issues ("Peter T. Breuer")
  Re: NIC: loadable module doesn't compile (Donald Becker)
  Re: Sys call for Available Memory? - Attempts to help, but still no answer after 
months.  :-( (Philip Armstrong)
  PCI bus access (David Florez)
  how to trace Xlib calls? ([EMAIL PROTECTED])
  Re: Newbie to kernel module programming ("Arno Geissel")
  PCI bus access (David Florez)
  2.4.1pre and 2.4.0ac problem: __buggy_fxsr_alignment undefined (J�rgen Koslowski)
  Re: Why max 8 SCSI LUNS/device (Paul Repacholi)

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

From: Michael Mueller <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.networking
Subject: Re: NIC: loadable module doesn't compile
Date: Sun, 28 Jan 2001 23:08:20 +0100

Hi Russell,

you wrote:
> 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

These changes happened within the Linux 2.3 development tree and due do
not affect Linux 2.2. You are using the kernel headers of Linux 2.3 or
2.4.


Malware

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

From: [EMAIL PROTECTED] (unsigned)
Crossposted-To: comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: This time is "df". Please help
Date: 28 Jan 2001 22:58:32 GMT

"Alan Po" <[EMAIL PROTECTED]> wrote in
<94lnoa$[EMAIL PROTECTED]>: 

>Dear all
>
>Alan Po again. This time the problem is "df". I have tried to read the
>source of "df" but cannot get any idea. Please give me some advices
>again on writing an application which can get the similar result as
>"df". I know it may be the most difficult question. Thanks for any idea.
>
>Thanks again,
>
>Alan Po
>
>

I think you could find what u want on freashmeat or linux box. There are a 
lot of sources there.
I can solve your problem in asm but not in C ... Sorry

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

From: [EMAIL PROTECTED]
Subject: Re: booting CD, ramfs -> / in 2.4, some issues
Date: Mon, 29 Jan 2001 00:10:53 -0000

On Sun, 28 Jan 2001 12:57:38 +0100 Kasper Dupont <[EMAIL PROTECTED]> wrote:
| [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     

Yup, it is often done.  And I've done it myself, too.  So they
discard the data.  At least my code would be putting it there
in the event it does not happen.  Since my CD boot method leaves
ramfs mounted as / and the CDROM mounted as /cdrom (and /usr
symlinked to a subdirectory there), that would have to be put in.

I have, over the past 2-3 years, seen numerous bad things in the
rc scripts of Redhat and other distributions.  In this example
there is an assumption about what is or is not already mounted.
Copying /proc/mounts to /etc/mtab to get it initialized would be
a good way to go, it seems.


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

Good.

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

Here's what I have with my current CD setup:

root@CDrescue:/root 1> cat /proc/mounts
/dev/root /mnt ext2 rw 0 0
ramfs / ramfs rw 0 0
/dev/bootcd /cdrom iso9660 ro 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw 0 0
root@CDrescue:/root 2> cat /etc/mtab
ramfs / ramfs rw,noauto 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,mode=0622 0 0
root@CDrescue:/root 3> df
Filesystem           1k-blocks      Used Available Use% Mounted on
root@CDrescue:/root 4> df /
Filesystem           1k-blocks      Used Available Use% Mounted on
ramfs                        0         0         0   -  /
root@CDrescue:/root 5> df /proc
Filesystem           1k-blocks      Used Available Use% Mounted on
none                         0         0         0   -  /proc
root@CDrescue:/root 6> df /cdrom
Filesystem           1k-blocks      Used Available Use% Mounted on
-                       415986    415986         0 100% /cdrom
root@CDrescue:/root 7> df /dev/pts
Filesystem           1k-blocks      Used Available Use% Mounted on
none                         0         0         0   -  /dev/pts
root@CDrescue:/root 8> df /mnt
Filesystem           1k-blocks      Used Available Use% Mounted on
-                          119        12       107  10% /mnt
root@CDrescue:/root 9> df -i /mnt
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
-                         32      21      11   66% /mnt
root@CDrescue:/root 10>


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

Ideally, I should be able to unmount a directory with a path that
resolves to a directory inode representing the mount point, or the
device code of the device that is mounted, regardless of what is
in /etc/mtab.  And what is in /proc/mounts seems to be strings the
kernel recorded, and umount() may even be matching the strings.
While testing my CD booting, I've run into problems after doing
pivot_root() where umount() didn't work unless I matched the same
string that was originally used.  Maybe pivot_root() still needs
a little work (but I worked around it).

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

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

From: [EMAIL PROTECTED]
Subject: How can I find base address of a device?
Date: Mon, 29 Jan 2001 02:28:17 GMT

Hi.
I am studying device driver.
To observe status of a device, I try to use functions for io port, such
as inb, outb, etc.
However, I can't find the base address of the device.
I guessed the address can be found in main board manual.
But, I can't this. Is there a method to find base address of a device?
I want to find the address of even a mouse.
Thanks in advance


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

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

From: [EMAIL PROTECTED] (Professor Bruno)
Subject: 'top' won't run; gives msg 'bad data in /var/run/utmp'
Date: 29 Jan 2001 03:08:48 GMT

Greetings all, 

Per the subject line.

Any help appreciated.

Thanks!

Max Pyziur
[EMAIL PROTECTED]

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

From: "Rich C." <[EMAIL PROTECTED]>
Subject: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 06:11:13 GMT

Hey all,

I am trying to learn to program kernel modules, so I read the Linux Kernel
Module Programming Guide_.

I followed all the examples exactly, and tried to compile them.  For some
reason, I get errors when I try to compile the lines:

#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif

if I comment these lines out of the hello world example, it compiles fine.
 If I leave them in, I get truckloads of errors.  The same thing happens
when I try to include proc_fs.h using the line:

#include <linux/proc_fs.h>

How could there be errors in the header files themselves? This doesn't
seem to make sense to me.  Has anyone else encountered this problem? Are
my header files out of date?

Thanks for any help!

Rich.

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: booting CD, ramfs -> / in 2.4, some issues
Date: Mon, 29 Jan 2001 08:35:44 GMT

[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.

You need to modify the root entry.

> | Another solution, which have been claimed not to be good
> | is to let /etc/mtab be a symbolic link to /proc/mounts.


Peter

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

From: [EMAIL PROTECTED] (Donald Becker)
Crossposted-To: comp.os.linux.hardware,comp.os.linux.networking
Subject: Re: NIC: loadable module doesn't compile
Date: Mon, 29 Jan 2001 08:42:49 GMT

In article <01c0896a$7d885800$72142cc7@junebugk>,
Russell de Grove <[EMAIL PROTECTED]> wrote:
>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.
...
>Otherwise, suggesting a cheap NIC that is known to work with RedHat 7

Your problem is actually with Red Hat 7.0, and it's broken include
files.  Read
  http://www.scyld.com/network/updates.html#redhat7.0


A precompiled netdriver update RPM for Red Hat 7.0 running the x86
uniprocessor kernel may be installed by running 
  rpm -i ftp://ftp.scyld.com/pub/network/netdrivers-rh70.i386.rpm




-- 
Donald Becker                           [EMAIL PROTECTED]
Scyld Computing Corporation             http://www.scyld.com
410 Severn Ave. Suite 210               Beowulf Clusters / Linux Installations
Annapolis MD 21403

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

From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: Sys call for Available Memory? - Attempts to help, but still no answer 
after months.  :-(
Date: 28 Jan 2001 10:12:38 -0000

In article <[EMAIL PROTECTED]>,
MeekGeek  <[EMAIL PROTECTED]> wrote:
>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?

If it works (I've never tried to use them), then 

sysconf(_SC_PHYS_PAGES);
sysconf(_SC_AVPHYS_PAGES);

may help some.

but not that these aren't standard POSIX sysconf arguments. They exist
in linux and solaris though (according to the manpage for sysconf()
anyway).

Phil
-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


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

From: David Florez <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: PCI bus access
Date: Mon, 29 Jan 2001 10:28:07 +0100

Hi All,
Does anybody know if there is a way of mapping
the physical PCI bus addresses into user memory
space (being user root if needed)?

I need to write an application that will be
accessing the PCI bus VERY often. The only thing
I can think of is adding a module to the kernel
(device driver) that maps the PCI bus to kernel
linear space ( by calling ioremap() ) and
therefore the user app would have to issue a
system call to request a PCI bus data transaction
to the device driver. The idea would be finding a
way of getting rid of these over killing system
calls.

Somebody told me that somebody told him (...) that
this could be done by calling iomap(); (???) from
the user application (providing the user is root)
but I couldn't find this function anywhere.

Many thanks in advance.

David Florez.


-- 
David Florez - R&D Department
InkJet Commercial Division (ICD)
Hewlett-Packard Company
Avda. Graells, 501
08190 St Cugat (Barcelona)
SPAIN

HP-Telnet: 712-2761
e-mail: [EMAIL PROTECTED]
Phone : +34 93 5822761
Fax   : +34 93 5822521

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

From: [EMAIL PROTECTED]
Subject: how to trace Xlib calls?
Date: Mon, 29 Jan 2001 09:32:44 GMT

Hello,


I would like to trace which Xlib calls are performed from Java Virtual
Machine. I need to trace these calls at X server side because this
application is Java based and no one tracing tool (for example 'ltrace' or
'sniffit') can deep to 2nd calls, performed from called Java libs. As I
understand, I need to compile Xlib from sources with corresponded printf(s),
but I don't want to spend time in playing with Xlib sources.

Does anybody know how could I solve this problem? Which tools should I use to
catch Xlib calls at X server side or perhaps there is such a flag in existing
X server environment? Any other suggestions?


Thanks a lot in advance.

Regards,
Vladimir Goutorov


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

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

From: "Arno Geissel" <[EMAIL PROTECTED]>
Subject: Re: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 11:15:47 +0100


Rich C. schrieb in Nachricht
<5Q7d6.17022$[EMAIL PROTECTED]>...
>Hey all,
>
>I am trying to learn to program kernel modules, so I read the Linux Kernel
>Module Programming Guide_.
>
>I followed all the examples exactly, and tried to compile them.  For some
>reason, I get errors when I try to compile the lines:
>
>#if CONFIG_MODVERSIONS==1
>#define MODVERSIONS
>#include <linux/modversions.h>
>#endif
>
>if I comment these lines out of the hello world example, it compiles fine.
> If I leave them in, I get truckloads of errors.  The same thing happens
>when I try to include proc_fs.h using the line:
>
>#include <linux/proc_fs.h>
>
>How could there be errors in the header files themselves? This doesn't
>seem to make sense to me.  Has anyone else encountered this problem? Are
>my header files out of date?
>
>Thanks for any help!
>
>Rich.

What kind of error do you get? I also got lots of errors in headers when
tried to compile
with the C++ instead of the C compiler.

Arno



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

From: David Florez <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.hardware,comp.os.linux.misc
Subject: PCI bus access
Date: Mon, 29 Jan 2001 11:09:52 +0100

Hi All,
Does anybody know if there is a way of mapping
the physical PCI bus addresses into user memory
space (being user root if needed)?

I need to write an application that will be
accessing the PCI bus VERY often. The only thing
I can think of is adding a module to the kernel
(device driver) that maps the PCI bus to kernel
linear space ( by calling ioremap() ) and
therefore the user app would have to issue a
system call to request a PCI bus data transaction
to the device driver. The idea would be finding a
way of getting rid of these overkilling system
calls.

Somebody told me that somebody told him (...) that
this could be done by calling iomap(); (???) from
the user application (providing the user is root)
but I couldn't find this function anywhere.

Many thanks in advance.

David Florez.

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

From: [EMAIL PROTECTED] (J�rgen Koslowski)
Subject: 2.4.1pre and 2.4.0ac problem: __buggy_fxsr_alignment undefined
Date: 29 Jan 2001 11:21:45 GMT

Since nobody has responded to this, let's try it once more:
This happens on an old Pentium 133 using (p)gcc-2.95.2.1.

J�rgen Koslowski ([EMAIL PROTECTED]) wrote:
: Hi,

: When trying to compile the latest 2.4.1pre or 2.4.0ac kernels, I get
: the following error message at the end:

:         -o vmlinux
: init/main.o: In function `check_fpu':
: init/main.o(.text.init+0x53): undefined reference to `__buggy_fxsr_alignment'
: make: *** [vmlinux] Error 1

: The offending function occurs in linux/include/asm-i386/bugs.h. 

and nowhere else in the source tree.

: The 2.4.0 kernel compiled fine and runs ok.  Any ideas?

: -- J�rgen

: --
: J�rgen Koslowski                If I don't see you no more on this world
: ITI, TU Braunschweig               I'll meet you on the next one
: [EMAIL PROTECTED]               and don't be late!
: http://www.iti.cs.tu-bs.de/~koslowj      Jimi Hendrix (Voodoo Child, SR)

--
J�rgen Koslowski                If I don't see you no more on this world
ITI, TU Braunschweig               I'll meet you on the next one
[EMAIL PROTECTED]               and don't be late!
http://www.iti.cs.tu-bs.de/~koslowj      Jimi Hendrix (Voodoo Child, SR)

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

Subject: Re: Why max 8 SCSI LUNS/device
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 29 Jan 2001 07:56:01 +0800

"Bill Anderson" <[EMAIL PROTECTED]> writes:

> Is there any (good) reason why the kernel still limits (apparently even
> in 2.4) the maximum number of LUNS/SCSI device to 8?
Wire :) The SCSI protocol requires the units a assert bit N
of the data bus to signal selections etc.

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

Just add more wire. And all the stuff to support it. It's
called wide SCSI.

-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.

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


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