Linux-Development-Sys Digest #653, Volume #8     Thu, 19 Apr 01 07:13:12 EDT

Contents:
  makefile dependency graph ("Shiva Shankar Chetan")
  Re: A Linux emulator for Linux, does this exist? (Philip Armstrong)
  Physical memory & hardware access ("John Connic")
  Re: Capturing raw ethernet frames ("Cameron Kerr")
  Printer driver for Olivetti PR50 ("Francis Leong")
  Re: IO system throughput ([EMAIL PROTECTED])
  how to remap the memory on PCI card to a new virtual memory? ("�B�_��")
  Porting from Window to Linux ... C++ programming  problem
  kernel thread list (Massimiliano Caovilla)
  Re: A Linux emulator for Linux, does this exist? (Jonathan Buzzard)
  Re: Porting from Window to Linux ... C++ programming  problem ("wiehllen")
  Re: Porting from Window to Linux ... C++ programming  problem (Carlos Moreno)
  Re: A Linux emulator for Linux, does this exist? ("Peet Grobler")
  Re: how to remap the memory on PCI card to a new virtual memory? 
(=?iso-8859-1?Q?Andr=E9?= David)
  Re: Physical memory & hardware access (=?iso-8859-1?Q?Andr=E9?= David)
  Re: The reason for static... (David)

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

From: "Shiva Shankar Chetan" <[EMAIL PROTECTED]>
Subject: makefile dependency graph
Date: Wed, 18 Apr 2001 15:20:15 -0500

Hi,

Could anybody tell me where I can find the linux kernel makefile dependency
graph or how I can build one ? I need for kernel compilation.

Thanks in advance

Chetan




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

From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: A Linux emulator for Linux, does this exist?
Date: 18 Apr 2001 21:18:23 +0100

In article <vSkD6.164949$[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Philip Armstrong) writes:
>> In article <[EMAIL PROTECTED]>,
>> Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
>> >How much does a 390 cost?
>> How long is a piece of string ?
>The expensive part is that you likely need a staff of a goodly dozen
>people to manage the OS and hardware, a room with serious power and
>air conditioning, and that doesn't buy you the hordes of
>administrators needed to manage DB/2, CICS, and the applications.

I don't doubt the staff, but I believe the newer ibm mainframes have
much lower power requirements than the old ones used to. They're much
smaller as well...so the serious power and aircon doesn't need to be
quite so serious any more.

*surf* *surf* Apparently the spiffiest Z-series draws approx 13kW. So
there you go.

Phil


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


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

From: "John Connic" <[EMAIL PROTECTED]>
Subject: Physical memory & hardware access
Date: Wed, 18 Apr 2001 22:36:31 GMT

Hi:

I am sure this is not a new question, but the answer seems
very confusion. I am trying to setup an embedded system
possibly using PC-104 modules and possibly RTLinux.

My goal is to use a PC-104+ prototype board and mount a
special type of memory device on it. I will then digitially interface the
memory device to the PCI bus on the card. With this done I assume that
the memory device is now in the physical address space of the CPU and
can be access similiar to memory on a PCI expansion board.

The question then is how to access this device from the CPU. From what
I can find the PCI area is on the High end of memory and by placing a "mem"
statement
in lilo.conf it will not be used by the normal O/S. Then to use this address
space
you have to discribe as physical memory corresponding to the physical
address you
use to mount the memory device. You then have to get a virtual address for
it using
ioremap which maps a physical address into what is called the CPU translated
space
so that it can access it.

I have tried several techniques to acccess memory this way but they don't
seem to
work. I am using RTlinux which was  patched into a Linux-2.2.18 kernel. I
have
been able to do other things with this setup (timers,fifo, etc) but physical
memory access does
not seem to work for me. If anybody has tried to physically connect a device
to the PCI
bus and access it through the CPU please let me know how you did it.

Thank you for your time and consideration







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

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: Capturing raw ethernet frames
Date: Thu, 19 Apr 2001 13:13:17 +1200

The code to do this is very short, I did it last night.
Now I can read raw ethernet frames (it doesn't give you
the preamble or the start of frame delimeter, but you get
everything else. (whatever the device driver passed up
the layer.

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/if_ether.h>
#include <netinet/in.h> /* for htons() */

#define MAX_BUFFER 1500

int main( int argc, char *argv[] )
{
  int sockfd = 0;
  int bread = 0;
  char buffer[MAX_BUFFER];
  unsigned int i = 0;

  if( (sockfd = socket( AF_PACKET, SOCK_RAW, htons(ETH_P_ALL) )) < 0 )
  {
    perror( "Creating raw ethernet socket" );
    return(-1);
  }

  /* We only want to sniff, not send, unfortunately, this operation is not
   * supported on this kind of socket. */

  /* We shall assume that we want to listen on eth0, for the moment */

  while(1)
  {
    if( (bread = read( sockfd, buffer, MAX_BUFFER )) < 0 )
      perror( "Transferring data from eth0 to stdout" );
    else
      write( fileno(stdout), buffer, bread );
  }    

  return(0);
}

Just send the output of this to a file (if you see the
output on screen you'll have to type "reset" at the terminal
to fix it.

Then open it in a hex editor (I recommend elvis for this)
and you'll see output very similar to ethereal's lower
pane.

Hint: the first part of each frame should be the MAC address
of the destination, followed by the source.

Oh, one question. When you see a UDP (for instance) packet,
you know that its a IP packet, since the ethernet frame
tells you, and you know that it's a UDP packet, since the
IP packet tell you. How are you supposed to figure out that
the data inside the UDP packet is meant for, say NIS, or
DNS, etc? The port numbers won't usually give you a direct
answer. Do I need to call out to fuser, with something like

fuser -n udp 2049

then see what process is using that port? What if that
process uses more than one port with different protocols?

It would appear that this is an important thing to know,
since the frame check sequence is at the end of the frame
(actually, I don't you get that bit either).

Perhaps I should put a newline after each frame received
by my program above.

Have fun,
-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

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

From: "Francis Leong" <[EMAIL PROTECTED]>
Subject: Printer driver for Olivetti PR50
Date: Thu, 19 Apr 2001 09:41:33 +0800

Greetings

Olivetti does not provide a Linux printer driver for the PR50  printer.
Does anyone know whether someone is developing one?
I'm trying to find the driver.

Many thanks.

Francis




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

From: [EMAIL PROTECTED]
Subject: Re: IO system throughput
Date: Thu, 19 Apr 2001 04:13:31 GMT

Greg Copeland <[EMAIL PROTECTED]> writes:
> There was recently an article in Open mag., whereby, they seems to
> of founds lots of issues with fiber controllers and Linux.  It seems
> that Linux currently has pretty poor support.  I don't remember the
> other items, but it seems there may be several issues here.  The
> article that I'm talking about was specifically a SAN article, but
> it addressed trying to use fiber to talk to the SAN (using several
> approaches).  At any rate, you may want to look for it and see what
> you can find.  I've also read elsewhere that there seems to be some
> stability issues with Linux's fiber drivers.  I'm not sure if this
> is specific to fiber type SAN implementations or not, but again, it
> may be worth looking into.

The issues with FibreChannel are pretty clear:

a) It's expensive hardware, so there aren't vast numbers of Linux
   users toying with it

b) Solaris seems to be the platform of choise for SAN

Put those together and you get the point that most of the effort goes
into Solaris drivers, what with vendor support and such, whilst Linux
gets support from people that have hardware and want to use it with
Linux.

Now, if we're talking about a $50 IDE controller, a $250 SCSI
controller, or a $200 motherboard, there's certainly going to be lots
of people that can easily afford to pick up hardware on the basis that
it _should_, _eventually_, be supported.  Put together 20 people that
do that, and work on drivers, and decent support can come quickly.
Even if it doesn't, it's not a _real_ big deal to write off $50 worth
of hardware.

In contrast, I'm not going to be buying an $80K SAN device on the
basis that it _might_ _eventually_ be supported.
-- 
(concatenate 'string "cbbrowne" "@acm.org")
http://vip.hex.net/~cbbrowne/resume.html
Would-be National Mottos:
Switzerland: "You wouldn't hit a country that's neutral, would you?"

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

From: "�B�_��" <[EMAIL PROTECTED]>
Subject: how to remap the memory on PCI card to a new virtual memory?
Date: Thu, 19 Apr 2001 12:50:56 +0800

I have a PCI device which have extra memory on it.
I want to use the ioremap() function to get a virtual address
so that I can access the memory.
But when I try to load the module,  it fails and tells me ioremap() and
readb() are unresolved symbols.
I use 2.2.14 linux kernel.
Is there anybody who knows what's wrong?
or can you send me a simple example code to teach me how to use ioremap()
correctly?

best regards,
yu-chen



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

From: <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Porting from Window to Linux ... C++ programming  problem
Date: Thu, 19 Apr 2001 14:22:41 +0800

I'm porting my module from windows to linux. It compile & runs well in
windows but in linux  environment - failed ... some errors. Frankly
speaking, I'm just a Linux beginner. What's the possible reasons? Any good
recomendation of books or website? I compiled using g++. Is this prob
something to do with C and C++ compatibility? I also have addressed this Q
to linux newsgroup. Kindly help, TIA.

ps: Am I posting to the right newsgroup?



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

From: Massimiliano Caovilla <[EMAIL PROTECTED]>
Subject: kernel thread list
Date: Thu, 19 Apr 2001 07:23:19 GMT

        Hi to all
I'm trying to debug a module I have ported to linux from Solaris. I need
a debugger or another way to see a detailed thread list, such as the one
I can see on Solaris with Sun's kernel debugger adb. I need this to
track down some lock problems I have wich are very difficult to track
down with printk! My module makes really wide use of kernel threads. Any
ideas?
Is there a way to get a kernel thread list detailed enought to see wich
thread is doing what?   
        Thanks to all

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

From: [EMAIL PROTECTED] (Jonathan Buzzard)
Subject: Re: A Linux emulator for Linux, does this exist?
Date: Thu, 19 Apr 2001 09:18:03 +0100

In article <9bksqf$129$[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] (Philip Armstrong) writes:
> In article <vSkD6.164949$[EMAIL PROTECTED]>,
>  <[EMAIL PROTECTED]> wrote:
>>[EMAIL PROTECTED] (Philip Armstrong) writes:
>>> In article <[EMAIL PROTECTED]>,
>>> Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
>>> >How much does a 390 cost?
>>> How long is a piece of string ?
>>The expensive part is that you likely need a staff of a goodly dozen
>>people to manage the OS and hardware, a room with serious power and
>>air conditioning, and that doesn't buy you the hordes of
>>administrators needed to manage DB/2, CICS, and the applications.
> 
> I don't doubt the staff, but I believe the newer ibm mainframes have
> much lower power requirements than the old ones used to. They're much
> smaller as well...so the serious power and aircon doesn't need to be
> quite so serious any more.
> 
> *surf* *surf* Apparently the spiffiest Z-series draws approx 13kW. So
> there you go.
> 

You can't draw this from a 13amp socket though. I would suspect you
need a three phase supply for this beasty. At the very least you are
going to need specialist wiring as this is 56A at 230VAC.

JAB.

-- 
Jonathan A. Buzzard                 Email: [EMAIL PROTECTED]
Northumberland, United Kingdom.       Tel: +44(0)1661-832195

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

From: "wiehllen" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Porting from Window to Linux ... C++ programming  problem
Date: Thu, 19 Apr 2001 10:21:39 +0200

The standard C or C++ libs under Linux are similar to those under Win. But
there are differences in file handling, and some other things.
GUI-apps are completly different, because I think you are using Win-Api, MFC
or the Borland libs, not Qt for Windows. Post the errors with code or look
in the documentation, often in /usr/doc/glibc or /usr/share/doc/glibc.

Lennart



<[EMAIL PROTECTED]> wrote in message news:9bm09o$1k7$[EMAIL PROTECTED]...
> I'm porting my module from windows to linux. It compile & runs well in
> windows but in linux  environment - failed ... some errors. Frankly
> speaking, I'm just a Linux beginner. What's the possible reasons? Any good
> recomendation of books or website? I compiled using g++. Is this prob
> something to do with C and C++ compatibility? I also have addressed this Q
> to linux newsgroup. Kindly help, TIA.
>
> ps: Am I posting to the right newsgroup?
>
>



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

From: Carlos Moreno <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Porting from Window to Linux ... C++ programming  problem
Date: Thu, 19 Apr 2001 05:23:39 -0400

[EMAIL PROTECTED] wrote:
> 
> I'm porting my module from windows to linux. It compile & runs well in
> windows but in linux  environment - failed ... some errors. Frankly
> speaking, I'm just a Linux beginner. What's the possible reasons? Any good
> recomendation of books or website? I compiled using g++. Is this prob
> something to do with C and C++ compatibility? I also have addressed this Q
> to linux newsgroup. Kindly help, TIA.


Without knowing what you're trying to do, there's not much we 
can do to help. 

A couple of things that come to mind:

1) You're trying to port a GUI application that uses MFC or WinAPIs, 
   or some other NON-C/C++ elements.

2) You're using compiler-specific extensions

If you show us part of the code that gives you the errors, or 
the list of errors, maybe someone could point you in the right 
directions. 

More in general, as for advice on books to get you started, I 
would recommend "Beginning Linux Programming" by Stone & Richards 
(Wrox).

HTH,

Carlos
--

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

From: "Peet Grobler" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: Re: A Linux emulator for Linux, does this exist?
Date: Thu, 19 Apr 2001 11:23:30 +0200

<SNIP>
>happen. According to folklore, you can pretty much replace an
>entire 390 one piece at a time without ever rebooting -- I
>imagine that's a bit exagerated.

Yes, I believe you can. If everything in the system is hot-swappable, why
not?

>But, since the OP was talking about something to use in place
>of two run-of-the-mill desktop machines, I'm pretty sure that a
>390 isn't a financially viable solutions.
>
>--
>Grant Edwards                   grante             Yow!  QUIET!! I'm being
>                                  at               CREATIVE!! Is it GREAT
>                               visi.com            yet? It's s'posed to
SMOKEY
>                                                   THE BEAR...



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

From: =?iso-8859-1?Q?Andr=E9?= David <[EMAIL PROTECTED]>
Subject: Re: how to remap the memory on PCI card to a new virtual memory?
Date: Thu, 19 Apr 2001 11:52:36 +0200

This is a multi-part message in MIME format.
==============530E5EF9AD421D0E53E00A38
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

"�B�_��" wrote:
> 
> I have a PCI device which have extra memory on it.
> I want to use the ioremap() function to get a virtual address
> so that I can access the memory.
> But when I try to load the module,  it fails and tells me ioremap() and
> readb() are unresolved symbols.
> I use 2.2.14 linux kernel.
> Is there anybody who knows what's wrong?
> or can you send me a simple example code to teach me how to use ioremap()
> correctly?

Are you including the rigth stuff?

I'm using ioremap ok and I'm including these:

#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif

#define __NO_VERSION__
#include <linux/module.h>
#include <linux/version.h>

char kernel_version [] = UTS_RELEASE;

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/types.h>
#include <linux/malloc.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <asm/io.h>
#include <asm/string.h>


Hope it helps,

Andre

ps - If you measure read speed from the PCI board to memory, please tell
me the numbers. Thanks

-- 

 "Share the code. If you hide it ain't good."
                                                Popular knowledge
==============530E5EF9AD421D0E53E00A38
Content-Type: text/x-vcard; charset=us-ascii;
 name="Andre.David.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Andr� David
Content-Disposition: attachment;
 filename="Andre.David.vcf"

begin:vcard 
n:David;Andr�
tel;work:+41792013849
x-mozilla-html:FALSE
org:CERN - Centre Europeen de Recherche Nucleaire;Experimental Physics Division - NA60 
Experiment
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
note:Geneva, Switzerland
x-mozilla-cpt:;-11552
fn:Andr� David
end:vcard

==============530E5EF9AD421D0E53E00A38==


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

From: =?iso-8859-1?Q?Andr=E9?= David <[EMAIL PROTECTED]>
Subject: Re: Physical memory & hardware access
Date: Thu, 19 Apr 2001 11:58:49 +0200

This is a multi-part message in MIME format.
==============21F1713CECCC6B35E628876F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi!

> My goal is to use a PC-104+ prototype board and mount a
> special type of memory device on it. I will then digitially interface the
> memory device to the PCI bus on the card. With this done I assume that
> the memory device is now in the physical address space of the CPU and
> can be access similiar to memory on a PCI expansion board.
> 
> The question then is how to access this device from the CPU. From what
> I can find the PCI area is on the High end of memory and by placing a "mem"
> statement

Ok. Let's stop here. You want to access the PCI memory as normal memory?
If so you just need to ioremap() it:
        
        pointer = ioremap(pciaddr, PCIMEMLEN);

(inside the kernel, of course).
Another way of doing this is by mmap()'ing /dev/mem at the pciaddr (you
need root previleges):

         fd = open ("/dev/mem",O_RDWR);
        pointer = (char *) mmap(0, PCIMEMLEN, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, (off_t) pci_addr);

                
Now beware that from my experience the writing speed is higly dependent
on the chipset used (from 100MB/s to 120MB/s) and the read speed is
lousy (from 6MB/s to 9MB/s).

Cheers,

Andre

ps - If you measure transfer speeds from the PCI memory, please let me
know the values.
-- 

 "Share the code. If you hide it ain't good."
                                                Popular knowledge
==============21F1713CECCC6B35E628876F
Content-Type: text/x-vcard; charset=us-ascii;
 name="Andre.David.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Andr� David
Content-Disposition: attachment;
 filename="Andre.David.vcf"

begin:vcard 
n:David;Andr�
tel;work:+41792013849
x-mozilla-html:FALSE
org:CERN - Centre Europeen de Recherche Nucleaire;Experimental Physics Division - NA60 
Experiment
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
note:Geneva, Switzerland
x-mozilla-cpt:;-11552
fn:Andr� David
end:vcard

==============21F1713CECCC6B35E628876F==


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

From: [EMAIL PROTECTED] (David)
Subject: Re: The reason for static...
Date: Wed, 18 Apr 2001 01:08:07 GMT

Thanks for all the explanation. I understand the necessity for
"static" now. I just found out that my C programming book does mention
that. But it did not mention that usage at the first encounter of
"static". Rather, it directs the reader to some advanced topic chapter
before mentioning abt this limitation of scope. :) (I haven't have the
time to read those chapters yet.) Linux is advanced, isn't it? :)

Regards,
David

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


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