Linux-Development-Sys Digest #332, Volume #8      Fri, 8 Dec 00 16:13:15 EST

Contents:
  Am I seeing IPv5, or am I hallucinating? ([EMAIL PROTECTED])
  IPv5 follow-up: OOPS, never mind ([EMAIL PROTECTED])
  Re: How to access PCI configuration registers (Arne Driescher)
  Re: A faster memcpy and bzero for x86 (Boris Gjenero)
  Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for  (Boris 
Gjenero)
  Re: Toronto, Kylix is coming! ("Steffen K�hler")
  Loading kernel module debug symbols to gdb ("amir")
  using stat from sys/stat.h (Brian Weston)
  Re: A faster memcpy and bzero for x86 (Robert Krawitz)
  Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for  (Maciej 
Golebiewski)
  Re: Status of linuxthreads (Matthew Palmer)
  Re: Loading kernel module debug symbols to gdb (Andi Kleen)
  64 bit access in a driver on MPC8240 PortX interface (Claire Troussier)
  File system cache questions ([EMAIL PROTECTED])
  Re: File system cache questions (Andi Kleen)
  Compile NIC driver? ("Matt")
  syslog and variable arguments? ("Daniel Lenski")

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

From: [EMAIL PROTECTED]
Subject: Am I seeing IPv5, or am I hallucinating?
Date: Fri, 08 Dec 2000 07:11:52 GMT

Hello,
I am looking at IP headers of packets delivered to my GigaBit Ethernet
driver.  I can't believe my eyes, because apparently they have IP
version 5!!  This happens on both kernels I use:  2.2.14, 2.2.16.
Besides that, they are perfectly fine headers sent over to private-use
IP addresses.  Here is a printout to a kernel log file:

Dec  7 22:39:02 zeus kernel: IP header, packet 1:
Dec  7 22:39:02 zeus kernel:  69   0   0  60
Dec  7 22:39:02 zeus kernel: 203 244  64   0
Dec  7 22:39:02 zeus kernel:  64   6 234 167
Dec  7 22:39:02 zeus kernel: 192 168   1 104
Dec  7 22:39:02 zeus kernel: 192 168   1 103
Dec  7 22:39:02 zeus kernel:
Dec  7 22:39:02 zeus kernel: IP header, packet 2:
Dec  7 22:39:02 zeus kernel:  69   0   0  52
Dec  7 22:39:02 zeus kernel: 203 245  64   0
Dec  7 22:39:02 zeus kernel:  64   6 234 174
Dec  7 22:39:02 zeus kernel: 192 168   1 104
Dec  7 22:39:02 zeus kernel: 192 168   1 103

Am I hallucinating?

I grepped through the kernel source and what I found was expected, in
file "\net\ipv4\ip_output.c":

iph=(struct iphdr *)skb_push(skb,sizeof(struct iphdr));

        iph->version  = 4;

What in the world is going on????

Mark Galecki
P.S.  I think the backslashes gave me away.  Yes, folks, I confess I
have committed the gravest sin:  I had Linux kernel sources ftp'd to
Windblows and, instead of religiously grepping them, I find what I need
with the powerful Microsoft Visual Studio editor.  :(


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

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

From: [EMAIL PROTECTED]
Subject: IPv5 follow-up: OOPS, never mind
Date: Fri, 08 Dec 2000 07:24:24 GMT

OOPS!  never mind, it is this little-endian-bitfield thing.  I am
sorry, I should have checked the layout of struct iphdr


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

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

From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: How to access PCI configuration registers
Date: Fri, 08 Dec 2000 09:02:17 +0100

[EMAIL PROTECTED] wrote:
> 
> New to PCI programming...
> 
> How can I read the SMBus Base register which is a PCI configuration
> register (function 3, address 90-93) according to Intel's 82371AB spec?

Hi,
I think the documentation provided by the kernel should help you:
/usr/src/linux/Documentation/pci.txt

-Arne

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

From: Boris Gjenero <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86
Date: Fri, 08 Dec 2000 02:37:12 -0500

Tim Roberts wrote:
> Why do you use fildq/fsistpq, instead of just fld/fst?  You can load any
> arbitrary 8-byte value into a floating point register, as long as you don't
> try to use it in a computation.  Do you do an finit before you start?

Well, I can't load any random pattern.  Just replacing the fildq with
fldl and fistpq with fstpl causes a compare afterwards to fail.

> It would be interesting to try interleaving your fildq's with mov's to see
> if you can exploit parallelism between the integer unit and the floating
> point unit.

That's a really interesting idea!

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

From: Boris Gjenero <[EMAIL PROTECTED]>
Subject: Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for 
Date: Fri, 08 Dec 2000 02:44:38 -0500

Ken Whaley wrote:
> 
> Here's Intel's paper on block copy using the SSE
> instructions.   rep movsb is still king for small (< 48 byte)
> copies!
> 
> http://developer.intel.com/software/idap/media/pdf/copy.htm

Well, okay, but the performance of the Intel string instructions is
pathetic.  If I do the same thing using individual instructions it runs
at the same speed.  With some other complex instructions, replacing them
with simple instructions actually speeds things up.

It's as if I'm using a RISC processor and assembler macros.  Well, okay,
I suppose I am in a way... it's just that the macros are microcode. 
Still, I'd expect that doing something in microcode should be faster
than doing it using actual instructions.

BTW.  Of course, this "RISC" processor also has a very small number of
general purpose registers and a lot of restrictions on how the registers
are used in some instructions.

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

From: "Steffen K�hler" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Toronto, Kylix is coming!
Date: Fri, 8 Dec 2000 10:57:47 +0100


"bgeer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:90lqbb$djl$[EMAIL PROTECTED]...
> Nix <$}xinix{[email protected]> writes:
>
>  >"TDUG" <[EMAIL PROTECTED]> writes:
>
>  >> ...No such application development tool
>  >> exists for Linux today,
>
>  >... because we don't like to reinvent the wheel. Why combine an IDE with
>  >a compiler, of all things? Why not throw in a debugger, a shell, a
>  >filesystems checker and a kitchen sink, all tightly integrated so you
>  >can't use one without being forced to use all the rest as well, and all
>  >nicely closed-source.

You are right

> Hmmmmm...let's think about this a little bit...I run 2 xterms & emacs,
> I edit in one window, move the mouse a little bit & type "make", move
> the mouse a little more & run gdb.  Ok, tell me again how an IDE makes
> this so much easier?


If you can control your graphics library, your makesystem and your utility -
subroutine-sources also with 2 x xterm and a few mousemoves, than an IDE
again makes no difference.


> ...  Will the latest version of the IDE even
> load  old project material???

Load certainly, but mostly you've to spend some work to make it run again...


>
> Now, port your project to Solaris or Digital Unix - does the IDE even
> work there???


Kylix - no, I don't think so


So why using Kylix ? - it's not because to learn again another tool - but
the BIG advantage is that with this tool it should be possible to transfer
approx. 30% of all windows programs to Linux - also if you stroke out all
the programs which only exist to solve windows problems (and which so are
not needed under Linux), you open a big box of sources, which can be used
1:1(.73)

- and thats my reason to use Kylix, because so I can use my old wonderful
stuff now also on a wonderful OS instead to be forced to use Windows (I
hope... :-)


Steffen



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

From: "amir" <[EMAIL PROTECTED]>
Subject: Loading kernel module debug symbols to gdb
Date: Sat, 9 Dec 2000 00:58:51 +0200

Hi,

How can I load the kernel module debug symbol to gdb?

I am running the kernel under gdb from remote (serial port, kernel-2.2.16
with patch to enable remote debug).

After loading the kernel symbol I want to load symbols for all the kernel
modules with were loaded after boot.

What I did was to load the modules like that...

insmod -m modulename.o > filename.map

Then from the information from filename.map I try to load the module symbols
to gdb

add-symbol-file filename.o section1 = section1 address section2 = section2
address....

But when I looked at the symbol address in the debugger the address was
wrong (compered to the address of file created by the insmod)

info address function

So how can I load the kernel module debug symbol to gdb?

Thanks.






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

From: Brian Weston <[EMAIL PROTECTED]>
Subject: using stat from sys/stat.h
Reply-To: [EMAIL PROTECTED]
Date: Fri, 8 Dec 2000 12:59:10 +0000

I have the following problem I need to output the smallest and largest file in a 
directory, the 
number of directories in a given directory and total size of all files in the 
directory.  I am 
getting very wierd outputs.  I have 2 classes one called directory and one called 
file, the 
following is the snippets of code.

In the file.h header i have the following functions that are part of the file class

float file::filesize()
{
        return details.st_size;  //return size of file
}

bool file::isregularfile()
{
        if ((details.st_mode & S_IFMT) == S_IFREG)
                return true; //return true this is a regular file
        else
                return false; //return false this is not a regular file
}

bool file::isdirectory()
{
        if ((details.st_mode & S_IFMT) == S_IFDIR)
                return true; //return true this is a directory
        else
                return false; //return false this is not a directory
}


In the directory.h header i have the following function that makes use of the file 
class and 
outputs the results

void directory::displaydiskusage()
{
        directoryptr = opendir(dirname);
        dir_entry = readdir(directoryptr);
        while(dir_entry !=NULL)
        {

                file tempfile(dir_entry->d_name);
                tempfile.displayfilename();
                if(tempfile.isregularfile()) //check if the file is regular
                {
                        if (sizeofsmallestfile && sizeoflargestfile == 0 ) //if the 
this is the 
first loop set the smallest and largest file size, to the first files size
                                sizeofsmallestfile = sizeoflargestfile = 
tempfile.filesize();
                        else if (tempfile.filesize() < sizeofsmallestfile)
                             {
                                sizeofsmallestfile = tempfile.filesize(); //set this 
file to 
smallest
                                //smallfile = direntry->d_name;
                             }
                             else if ( tempfile.filesize() > sizeoflargestfile)
                                  {
                                        sizeoflargestfile = tempfile.filesize(); //set 
this file to 
largest
                                        //largfile = direntry->d_name;
                                  }
                        totalsize = totalsize + tempfile.filesize(); //add this files 
size to the 
accumulating total

                }
                else if (tempfile.isdirectory()) // check is directory
                     {
                        noofsubdirectories++; // add 1 to the count of directories
                     }
                dir_entry=readdir(directoryptr);
        }
        closedir(directoryptr);
        cout<<"Total number of Bytes used by directory:- "<<totalsize<<" bytes\n";
        cout<<"Largest File in directory occupies "<<sizeoflargestfile<<" bytes\n";
        cout<<"Smallest File in directory occupies "<<sizeofsmallestfile<<" bytes\n";
        cout<<"Number of sub-directories:- "<<noofsubdirectories<<"\n";
}

As i have said this is spitting out garbage in some directories.  Any help or pointers 
appreciated. 
Or if anyone is willing i can send them the full program to look at, only 3 files 
totalling 14K.

Thanks

Brian

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

From: Robert Krawitz <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86
Date: 08 Dec 2000 08:52:22 -0500

I did this several years ago, as a kernel patch.  It helps a lot on
older Pentiums; hurts considerably on K6's (because they allocate a
cache line on write, and therefore don't actually get any benefit from
8-byte writes), and helps to a much smaller degree on Pentium Pro's
and II's.  The web page for this is
http://www.tiac.net/users/rlk/linux.html.  I haven't touched it in
over 18 months, and the mailing list at the bottom is no longer
operational.

-- 
Robert Krawitz <[EMAIL PROTECTED]>      http://www.tiac.net/users/rlk/

Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]
Project lead for The Gimp Print --  http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton

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

From: Maciej Golebiewski <[EMAIL PROTECTED]>
Subject: Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for 
Date: Fri, 08 Dec 2000 14:47:14 +0100

Boris Gjenero wrote:
> 
> Ken Whaley wrote:
> >
> > Here's Intel's paper on block copy using the SSE
> > instructions.   rep movsb is still king for small (< 48 byte)
> > copies!
> >
> > http://developer.intel.com/software/idap/media/pdf/copy.htm

I tried to compile the code, both the C and asm versions, but my
gcc/as do not support SSE :( I tried a few other assemblers I
found on freshmeat but none of them would accept SSE mnemonics.
Anyone knows where I can find one that can do that?

> Well, okay, but the performance of the Intel string instructions is
> pathetic.  If I do the same thing using individual instructions it runs
> at the same speed.  With some other complex instructions, replacing them
> with simple instructions actually speeds things up.

Boris, can you share the source for your optimizations? I have code
which could benefit from such optimizations (and the concerns expressed
by others in this thread do not apply in my case, as all the apps
that are going to use will use FPU anyway).

Thanks in advance,

Maciej

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

From: [EMAIL PROTECTED] (Matthew Palmer)
Subject: Re: Status of linuxthreads
Reply-To: [EMAIL PROTECTED]
Date: 8 Dec 2000 12:54:43 +1100

Uma Nelluri is of the opinion:
>I am trying to port a POSIX complaint multithreaded application to
>Linux. Can anyone please let me know the status of Linux Threads. What
>is the present version of Linix Threads? What is the status of
>CLONE_PID? What is the status of Signal Handling?

OK, I'm no authority on threads under Linux (or anywhere for that
matter...), but from what I've gathered from the docs:

Signals: Not POSIX compliant, need kernel support.  Signal will get to one
random thread, and there's no way of knowing which one.

CLONE_PID: Ungh?  No experience.

Latest Version: It comes with glibc now, and that's up to 2.2.


-- 
=======================================================================
#include <disclaimer.h>
Matthew Palmer
[EMAIL PROTECTED]

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: Loading kernel module debug symbols to gdb
Date: 08 Dec 2000 15:07:12 +0100

"amir" <[EMAIL PROTECTED]> writes:
> 
> So how can I load the kernel module debug symbol to gdb?

Newer versions of the kgdb remote patch from ftp.gcom.com include a gdbinit file
that contain gdb macros that do the job.

-Andi

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

From: Claire Troussier <[EMAIL PROTECTED]>
Subject: 64 bit access in a driver on MPC8240 PortX interface
Date: Fri, 08 Dec 2000 16:14:49 +0100

Il s'agit d'un message multivolet au format MIME.
==============255878966AA04386512E89A4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am currently writing a Linux driver to drive IO using the MPC8240
PortX interface. Our output device can only be accessed using 64 bit
transfer. I use s64 variable type and when the code is compiled it uses
floating point instruction as it is the only way for a MPC8240 to do 64
bit wide access. The code executes correctly but each time a floating
point operation occurs the following message appears on the console :
    "floating point used in kernel "

How can I remove this message ?

Thanks

Claire Troussier

==============255878966AA04386512E89A4
Content-Type: text/x-vcard; charset=us-ascii;
 name="troussier.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Carte pour Claire Troussier
Content-Disposition: attachment;
 filename="troussier.vcf"

begin:vcard 
n:Troussier;Claire
tel;fax:+33 (0)4 76 52 18 44
tel;work:+33 (0)4 76 52 47 47 
x-mozilla-html:FALSE
org:DIGIGRAM
adr:;;Parc de Pr� Milliet;Montbonnot;;38330;France
version:2.1
email;internet:[EMAIL PROTECTED]
title:software engineer
fn:Claire Troussier
end:vcard

==============255878966AA04386512E89A4==


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

From: [EMAIL PROTECTED]
Subject: File system cache questions
Date: Fri, 08 Dec 2000 17:01:39 GMT

Hi all

Can anyone shed some light on two things:

1. How can I get statistics for file system cache hit rates?
   sar on other Unixes gives me this info

2. How can I force the cache to be empty without
   deleting files I have been reading?

I am trying to do some performance testing, and it would be
nice to be able to start each run with a clean cache and to
see the hit rates

Any info appreciated

Ed Friedman


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

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: File system cache questions
Date: 08 Dec 2000 18:16:52 +0100

[EMAIL PROTECTED] writes:

> Hi all
> 
> Can anyone shed some light on two things:
> 
> 1. How can I get statistics for file system cache hit rates?
>    sar on other Unixes gives me this info

There are no such statistics in Standard Linux. You would need to change the
kernel and add them.

> 
> 2. How can I force the cache to be empty without
>    deleting files I have been reading?

You cannot. Data is usually cached in the page cache, which also contains
the program text pages. Emptying the cache would mean that you have no programs
running anymore. 




-Andi

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

From: "Matt" <[EMAIL PROTECTED]>
Subject: Compile NIC driver?
Date: Fri, 8 Dec 2000 13:48:35 -0500

My network card is an old SMC 8013 EWC (ISA).  SMC has a generic Linux
driver for it available only as C source code.  I don't know what to do with
this driver to install it.  Am I going to be recompiling my kernel with this
file added?

Any help and advice is appreciated.

Matt




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

From: "Daniel Lenski" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: syslog and variable arguments?
Date: Fri, 08 Dec 2000 15:41:50 +0500

Hi,

I'm wondering if there's a way to get syslog(3) to work with a variable
argument list, like vfprintf or something of that sort.  I've written a
fair-sized program using my wrapper function debuglog, which takes a
printf-style format list.  Now I want to make it work with syslog, but I
can't pass it a variable argument list.  Is there an easy way to do this,
or does anybody know of a good logging library that will hide the gory
details?

Thanks in advance!

-- 
Daniel Lenski
[EMAIL PROTECTED]

"If we couldn't laugh at things that didn't make sense,
we couldn't react to a lot of the world around us."
   --Calvin and Hobbes

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


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