Linux-Development-Sys Digest #149, Volume #8     Fri, 15 Sep 00 23:13:09 EDT

Contents:
  Re: dual cpu + 2.2.16 + ata-100 patch +512M ram = no good (Robert Redelmeier)
  two drivers of same device ("Anil Prasad")
  Re: two drivers of same device ("Andy Jeffries")
  Re: two drivers of same device (Josef Moellers)
  Re: two drivers of same device (Josef Moellers)
  Re: dual cpu + 2.2.16 + ata-100 patch +512M ram = no good (Peter Eriksson)
  Re: new windowing system ([EMAIL PROTECTED])
  is a given IP adress local ("Vik Heyndrickx")
  Problem writing to ISA memory hole (again) (Steve Helding)
  Re: Problem writing to ISA memory hole (again) (Steve Helding)
  Re: New problem with writing to ISA hole (Karl Heyes)
  Re: newbie: developping inetd subserver (roger Irwin)
  Re: Problem writing to ISA memory hole (again) (Karl Heyes)
  ld.so? (Sukru Cinar)
  Re: ld.so? (Kaz Kylheku)
  Re: scheduling under Linux not suitable for interactive work? (Tim Smith)
  Re: ld.so? (John Reiser)
  I'm in kernel land now! (Steve Helding)
  Re: I'm in kernel land now! (Pete Zaitcev)

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

From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: dual cpu + 2.2.16 + ata-100 patch +512M ram = no good
Date: Fri, 15 Sep 2000 07:33:08 -0500

Peter Eriksson wrote:
> > Does someone know if its a common problem or is it only me? I have a
> > MSI-694D dual fc-pga motherboard. Running Slackware 7 with 2.2.16 kernel
> > - patched with the IDE patch that supports the ATA-100 interface in the
> > motherboard. But I get problem when I use 512M ram. The machine kernel
> > panics and sutch.
> >
> > Anyone know of this problem?

Yup -- just ask some of the Abit BP6 folks.  I think you have to be very
selective on SDRAM quality -- a recent c't magazine [german] had some very
disturbing results.  More than half the SDRAM purchased failed one or more
tests, albeit some at 133.  This matches my experience.

You might want to try some CPU testing programs I developed, particularly
`burnMMX`, and see if you can keep them running for a few hours.

In short, I think most of the problems are hardware related, not the OS.

-- Robert  author `cpuburn`  http://users.ev1.net/~redelm

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

From: "Anil Prasad" <[EMAIL PROTECTED]>
Subject: two drivers of same device
Date: 15 Sep 2000 14:28:21 GMT

if a write a drive of any device, driver of which is already available
statically in the kernel, how can i make linux to use my this driver
instead of earlier existing one in the kernel


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

From: "Andy Jeffries" <[EMAIL PROTECTED]>
Subject: Re: two drivers of same device
Date: Fri, 15 Sep 2000 16:04:04 +0000

In article <01c01efc$2f019a80$7cd4b809@aprasad>, "Anil Prasad"
<[EMAIL PROTECTED]> wrote:
> if a write a drive of any device, driver of which is already available
> statically in the kernel, how can i make linux to use my this driver
> instead of earlier existing one in the kernel

Disclaimer: I am reasonably new to Kernel driver writing!

The Kernel holds all the details you pass in to register_blkdev in 
global arrays, so can't you just unregister the previous device 
using the values obtained from these arrays and your known 
MAJOR_NR?




-- 
Andy Jeffries
Lead-developer of Scramdisk for Linux
Developer of original Scramdisk Delphi Component


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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: two drivers of same device
Date: Fri, 15 Sep 2000 17:05:27 +0200

Anil Prasad wrote:
> =

> if a write a drive of any device, driver of which is already available
> statically in the kernel, how can i make linux to use my this driver
> instead of earlier existing one in the kernel

You must remove the built-in driver from the kernel.
Usually the built-in drivers are launched first, so your driver module
will find its hardware occupied.
-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: two drivers of same device
Date: Fri, 15 Sep 2000 17:28:05 +0200

Andy Jeffries wrote:
> =

> In article <01c01efc$2f019a80$7cd4b809@aprasad>, "Anil Prasad"
> <[EMAIL PROTECTED]> wrote:
> > if a write a drive of any device, driver of which is already availabl=
e
> > statically in the kernel, how can i make linux to use my this driver
> > instead of earlier existing one in the kernel
> =

> Disclaimer: I am reasonably new to Kernel driver writing!
> =

> The Kernel holds all the details you pass in to register_blkdev in
> global arrays, so can't you just unregister the previous device
> using the values obtained from these arrays and your known
> MAJOR_NR?

You must also tell the other driver to release all other resources it
holds, /proc entries etc.

Better remove the driver from the kernel code entirely.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)

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

From: Peter Eriksson <[EMAIL PROTECTED]>
Subject: Re: dual cpu + 2.2.16 + ata-100 patch +512M ram = no good
Date: Fri, 15 Sep 2000 18:32:45 +0200



Robert Redelmeier wrote:
> 
> Peter Eriksson wrote:
> > > Does someone know if its a common problem or is it only me? I have a
> > > MSI-694D dual fc-pga motherboard. Running Slackware 7 with 2.2.16 kernel
> > > - patched with the IDE patch that supports the ATA-100 interface in the
> > > motherboard. But I get problem when I use 512M ram. The machine kernel
> > > panics and sutch.
> > >
> > > Anyone know of this problem?
> 
> Yup -- just ask some of the Abit BP6 folks.  I think you have to be very
> selective on SDRAM quality -- a recent c't magazine [german] had some very
> disturbing results.  More than half the SDRAM purchased failed one or more
> tests, albeit some at 133.  This matches my experience.
> 
> You might want to try some CPU testing programs I developed, particularly
> `burnMMX`, and see if you can keep them running for a few hours.
> 
> In short, I think most of the problems are hardware related, not the OS.
> 
> -- Robert  author `cpuburn`  http://users.ev1.net/~redelm


Hmmm, yes that is disturbing. I got original pc133 ram. I have also
exchanged one of the dimm's to see if that was the problem. That was not
the case at all. 

I compiled and tried you program for a few minutes. I will try to find
some time next week to run it for longer period of time. Problem is, its
a production machine so the researchers are running long matlab
calculations etc. so. =) Tough cookie. 

Peter Eriksson

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

ResearchEngineer, Computergraphics

Linkoping University, Campus Norrkoping

e-mail: [EMAIL PROTECTED]

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

============================================================

To understand recursion, we must first understand recursion.

============================================================

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.x,comp.windows.x
Subject: Re: new windowing system
Date: Fri, 15 Sep 2000 18:58:47 GMT



> >Modicum? You have to be joking. I went to your link and found
> >research, yes, but hardly anything I'd find outside some
> >computer science departent's limited-access library. Sheesh.
>
> Read the manual page for X, commonly found via "man X".

Chris, quit being a twerp. You were talking firstly about
serious research, then you pretend you were talking about
something that can be found in a man page.

You're giving Unix people a bad name by pretending to be
a know it all.


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

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

From: "Vik Heyndrickx" <[EMAIL PROTECTED]>
Subject: is a given IP adress local
Date: Fri, 15 Sep 2000 19:14:32 GMT

Hi,

Don't know whether this is the most appriopriate forum to ask, but I'll risk
it :)

I'm developping a linux networking app. (kernel 2.2.0+), using the default
sockets implementation offered by linux. I'm using C, and TCP/IP.

Two questions (somewhat overlapping, but I'm not sure if it is necessary to
know all of 2 to know 1):
1. how can I (=what is the best way to) know if a given IPv4 address is the
IP address of one of the local network interfaces (, or that is is not a
local IP address).
To get this information I do not want to make a TCP connection to any remote
machine (because I am not necessarily able to do so at the time I want this
to know), I do not want to peek in '/proc', and I do not want to run a
program from my program (like ifconfig).

2. how can I create a list of all local IP addresses.

Thanks,

--
Vik




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

From: Steve Helding <[EMAIL PROTECTED]>
Subject: Problem writing to ISA memory hole (again)
Date: 15 Sep 2000 21:28:28 GMT
Reply-To: [EMAIL PROTECTED]

I'm now successfully reading from an ISA board.  I know I'm reading it
because the hardware people told me what value I should see, but when I
write to the board I get:

do_wp_page: bogus page at address 40132082 (C0F00000)
Bus error

It seems like some kind of protection error but I'm running it as root
so what gives?

The code goes like this the beginning of which is borrowed from Rubini's

mapper.c

int main(int argc, char **argv)
{
    char *fname = "/dev/mem";
    FILE *f;
    unsigned int offset = 0xf00000;
    unsigned int len = 0x100000;
    void *mappedAddr;
    int i, j;
    int numArgs;
    char op[4];
    unsigned int size, addr, data;
    char *buf;

    if (!(f=fopen(fname,"r"))) {
        fprintf(stderr, "%s: %s: %s\n", argv[0], fname,
strerror(errno));
        exit(1);
    }

    mappedAddr = mmap(0, len, PROT_READ | PROT_WRITE, MAP_FILE |
                                       MAP_PRIVATE, fileno(f), offset);

    if (mappedAddr == (void *)-1) {
        fprintf(stderr,"%s: mmap(): %s\n",argv[0],strerror(errno));
        exit(1);
    }


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

From: Steve Helding <[EMAIL PROTECTED]>
Subject: Re: Problem writing to ISA memory hole (again)
Date: 15 Sep 2000 22:09:10 GMT
Reply-To: [EMAIL PROTECTED]


I thought I found the problem when I saw the permission on fopen set to
"r".  Unfortunately, when I changed this to "r+" or "w" I still get a bus
error.


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

From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: New problem with writing to ISA hole
Date: Fri, 15 Sep 2000 23:15:43 +0000

In article <[EMAIL PROTECTED]>, Steve Helding
<[EMAIL PROTECTED]> wrote:
> I'm now successfully reading from an ISA board.  I know I'm reading it
> because the hardware people told me what value I should see, but when I write
> to the board I get:
> 
> do_wp_page: bogus page at address 40132082 (C0F00000) Bus error
> 
> The code goes like this the beginning of which is borrowed from Rubini's
> mapper.c
> 
> int main(int argc, char **argv)
> {
>     char *fname = "/dev/mem"; FILE *f; unsigned int offset = 0xf00000;
>     unsigned int len = 0x100000; void *mappedAddr; int i, j; int numArgs;
>     char op[4]; unsigned int size, addr, data; char *buf;
> 
>     if (!(f=fopen(fname,"r"))) {
>         fprintf(stderr, "%s: %s: %s\n", argv[0], fname,
> strerror(errno));
>         exit(1);
>     }
> 
>     mappedAddr=mmap(0, len, PROT_READ | PROT_WRITE, MAP_FILE |
> MAP_PRIVATE,

MAP_SHARED surely


> 
>     if (mappedAddr == (void *)-1) {
>         fprintf(stderr,"%s: mmap(): %s\n",argv[0],strerror(errno)); exit(1);
>     }
>     while(1)
>     {
>        if ((buf = readline("Enter command: ")) == NULL)
>           continue;
> 
>        add_history(buf);
> 
>        numArgs = sscanf(buf, "%s %d %x %x", op, &size, &addr, &data);
> 
>        if ((op[0] = toupper(op[0])) == 'Q')
>           break;
> 
>        if (toupper(op[0]) != 'R' && op[0] != 'W' && op[0] != 'I' &&
>                    op[0] != 'O')
>        {
>           printf("Unrecognized operation, must be r, w, i or o\n");
>           free(buf); continue;
>        }
> 
>        if (size != 1 && size != 2 && size != 4)
>        {
>           printf("Invalid data size, must be 2 or 4\n"); free(buf); continue;
>        }
> 
>       if (op[0] == 'R' || op[0] == 'W')
>       {
>          if (addr < 0xf00000 || addr > 0x1000000)
>          {
>             printf("Invalid address, must be between 0xf00000 and
> 0x1000000\n");
>             free(buf); continue;
>          }
>       }
> 
>       if (op[0] == 'R')
>       {
>          if (size == 1)
>          {
>             data = *(unsigned char *)(mappedAddr + (addr - offset));
>          }
>          else if (size == 2)
>          {
>             data = *(short *)(mappedAddr + (addr - offset));
>          }
>          else
>          {
>             data = *(int *)(mappedAddr + (addr - offset));
>          }
>          printf("Read %x from address %x\n", data, addr);
>       }
>       else if (op[0] == 'W')
>       {
>          if (size == 1)
>          {
>             *(unsigned char *)(mappedAddr + (addr - offset)) = data;
>          }
>          else if (size == 2)
>          {
>             *(short *)(mappedAddr + (addr - offset)) = data;
>          }
>          else
>          {
>             *(int *)(mappedAddr + (addr - offset)) = data;
>          }


It may not be an issue but be careful of little/big endian issues.


karl

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

From: roger Irwin <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: newbie: developping inetd subserver
Date: Fri, 15 Sep 2000 22:18:21 GMT



Pierre Wieser wrote:

> Hi,
>
> - how can my server get informations about the client which is sending
> the message ? (or how can I get a socket when the connection is handled
> by inetd ?)
>
> - how can my server response to the client ? Should it open a new
> connection or can it response via inetd ?
>

You can simply read and write to stdin and stdout, but it has limitations.
File descriptors are more versatile. I do this kind of work with Python,
and I simply request the file descriptors for stdin and stdout file
handles. These are socket file descriptors so then I can use them as such.


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

From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: Problem writing to ISA memory hole (again)
Date: Fri, 15 Sep 2000 23:22:39 +0000

In article <[EMAIL PROTECTED]>, Steve Helding
<[EMAIL PROTECTED]> wrote:
> I'm now successfully reading from an ISA board.  I know I'm reading it
> because the hardware people told me what value I should see, but when I write
> to the board I get:
> 
> do_wp_page: bogus page at address 40132082 (C0F00000) Bus error
> 
> It seems like some kind of protection error but I'm running it as root so
> what gives?
> 
> The code goes like this the beginning of which is borrowed from Rubini's
> 
> mapper.c
> 
> int main(int argc, char **argv)
> {
>     char *fname = "/dev/mem"; FILE *f; unsigned int offset = 0xf00000;
>     unsigned int len = 0x100000; void *mappedAddr; int i, j; int numArgs;
>     char op[4]; unsigned int size, addr, data; char *buf;
> 
>     if (!(f=fopen(fname,"r"))
                                     ^^ 

are you opening a file and wanting to mmap a writeable section.

karl.


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

From: Sukru Cinar <[EMAIL PROTECTED]>
Subject: ld.so?
Date: Fri, 15 Sep 2000 18:59:02 -0400


Hi,

I have to write a binary interpreter for linux and I want to know
how kernel passes the address of the mmap()'ed executable to the
interpreter. 

thanks for your help.


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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: ld.so?
Reply-To: [EMAIL PROTECTED]
Date: Fri, 15 Sep 2000 23:01:40 GMT

On Fri, 15 Sep 2000 18:59:02 -0400, Sukru Cinar <[EMAIL PROTECTED]>
wrote:
>
>Hi,
>
>I have to write a binary interpreter for linux and I want to know
>how kernel passes the address of the mmap()'ed executable to the
>interpreter. 

It doesn't. The program to be interpreted has, as its first line:

        #!/path/of/interpreter

This tells the kernel to invoke the interpreter and pass it the name of the
program file. The interpreter must open that file and read it or map it, taking
care to skip the #! stuff (many popular interpreters achieve this simply
because the # mark is their comment character---that is why it's chosen as the
first byte of the magic number).

If you want to do it it differently, then you have to write your own binfmt
module for the kernel to handle your own binary format more directly.

-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

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

From: [EMAIL PROTECTED] (Tim Smith)
Subject: Re: scheduling under Linux not suitable for interactive work?
Date: 15 Sep 2000 16:44:58 -0700
Reply-To: Tim Smith <[EMAIL PROTECTED]>

You've got IDE drives, I bet.  Linux often gets very unresponsive during
IDE disk I/O.

--Tim Smith

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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: ld.so?
Date: Fri, 15 Sep 2000 17:40:12 -0700

Look at /usr/src/linux/fs/binfmt_elf.c, function create_elf_tables()
calls to macro NEW_AUX_ENT, and symbols AT_* from /usr/include/elf.h .

-- 
John Reiser, [EMAIL PROTECTED]

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

From: Steve Helding <[EMAIL PROTECTED]>
Subject: I'm in kernel land now!
Date: 16 Sep 2000 00:59:15 GMT
Reply-To: [EMAIL PROTECTED]

Gave up on trying to write to the ISA board at 15 M in user mode.  Got a
crude device driver writing to the board.  Flashing the lights so I know
it's talking to it.  Gettin' in deep now.  Talk about a clusterf* having
to patch the kernel to do this.  I'm using a bzdisk/floppy with the
Linux kernel patch so I don't screw up my development system but soon
I'll need to make it a permanent patch to the hard drive.  Sheesh, what
a pain.  I need to ask my boss for a raise.


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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: I'm in kernel land now!
Date: Sat, 16 Sep 2000 02:32:05 GMT

On 16 Sep 2000 00:59:15 GMT, Steve Helding <[EMAIL PROTECTED]> wrote:
> Gave up on trying to write to the ISA board at 15 M in user mode.  Got a
> crude device driver writing to the board.  Flashing the lights so I know
> it's talking to it.  Gettin' in deep now.  Talk about a clusterf* having
> to patch the kernel to do this.  I'm using a bzdisk/floppy with the
> Linux kernel patch so I don't screw up my development system but soon
> I'll need to make it a permanent patch to the hard drive.  Sheesh, what
> a pain.  I need to ask my boss for a raise.

Do not touch the original kernel, just add one more to /etc/lilo.conf

Also, most shipping kernels have CONFIG_MODULES enabled.
You do not need even reboot to debug your driver
(well, most of the time :).

--Pete

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


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