Linux-Development-Sys Digest #997, Volume #7      Wed, 5 Jul 00 22:13:16 EDT

Contents:
  Re: linux shutdown unclean? ([EMAIL PROTECTED])
  Re: Problems with writel in a device driver: please help save lives! (Kaz Kylheku)
  Re: mapping ISA device memory in kernel space ([EMAIL PROTECTED])
  how to implement route (mostly new in network programming!) ("Robichaud, 
Jean-Philippe [BAN:6S33:EXCH]")
  Re: 2.2.16 eepro100 driver problems (Timothy J. Lee)
  Re: How to retreive/change the full MAC address of a network card ? (Thomas Dzubin)
  Re: linux programming help needed ...... (bill davidsen)
  Re: Confirm this bug: CodeWarrior does not support spaces in paths? (Kent Sorensen)
  help on clone() ("Paolo Romano")
  Re: Problems with writel in a device driver: please help save lives! (Pete Zaitcev)
  Re: IOremap question (Pete Zaitcev)
  Accidentally deleted "init "  directory (Hima Parimisetty)
  Interrupts  in Linux ("nick")
  Connecting to a SQL-Server (Jan =?iso-8859-1?Q?R=F6hrich?=)
  Re: copy_from_user ("Dennis Huang")
  Re: copy_from_user ("Dennis Huang")
  Re: Connecting to a SQL-Server (Aravind Sadagopan)
  Re: Interrupts  in Linux (Grant Edwards)

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

From: [EMAIL PROTECTED]
Subject: Re: linux shutdown unclean?
Date: Wed, 05 Jul 2000 18:07:22 GMT

On 5 Jul 2000 16:30:51 GMT Keith Osowski <[EMAIL PROTECTED]> wrote:

| I am working with a linux kernel to have it reload an operating system.  I am 
| successful at reloading linux, but I am not able to reload msdos or NT.
|
| What I am trying to do is boot a linux kernel, image a disk(put an os on it),
| and then load that OS using BIOS int 19.  It works great when I put linux on as
| the OS and reload it, but DOS and NT load part of the way, "Starting MSDOS..." 
| and "...press space bar to get last configuration..." and hangs.  It appears
| that linux maybe changes some stuff that the MS world expects to be there.  Any
| thoughts or help here would be appreciated.

I'm assuming you initially did an install of NT to a partition, capctured
a copy of the partition, sector by sector, and are now restoring it to run
it.  Be sure that the exact original drive geometry is still in effect.
Be sure that partition layout is unchanged from what it was during install,
including the marking of the active partition and the partition types of all
the partitions.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Problems with writel in a device driver: please help save lives!
Reply-To: [EMAIL PROTECTED]
Date: Wed, 05 Jul 2000 18:11:32 GMT

On 05 Jul 2000 18:59:50 +0200, Mathias Waack <[EMAIL PROTECTED]> wrote:
>
>What a dramatic subject;)
>Hope I don't make any mistakes and kill some of your 
>patients. 
>
>[EMAIL PROTECTED] (Nick Bailey) writes:
>> kernel on the development machine.  This is pro bono work, by the way,
>> for a UK heart research charity.
>
>What does "pro bono" mean?

It's a Latin term that means ``for the [public] good''. 

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED]
Subject: Re: mapping ISA device memory in kernel space
Date: Wed, 05 Jul 2000 18:26:45 GMT

If I directly use memcpy_fromio function, will it work for copying data
<=8kb

jeseem


In article <[EMAIL PROTECTED]>,
  Mathias Waack <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
>
> >  i have a ISA device having 8 kb of physical mem(start address
> > D000:0000). How can I map it to virtual memory for access in my
> > driver.  Please help.
>
> First register a dma channel by calling request_dma().
> After that setup the dma controller with set_dma_{mode|addr|count}.
> Check if all is ok by calling get_dma_residue().
>
> For cleanup use disable_dma() and free_dma().
>
> Read asm/dma.h for more infos and look at drivers like the
soundblaster
> driver in drivers/sound/dmabuf.c or sscape.c
>
> If there are still questions, run (don't walk!) to your next book
store
> and by A. Rubini: Linux Device Drivers.
>
> Mathias
>
>


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

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

From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: how to implement route (mostly new in network programming!)
Date: Wed, 05 Jul 2000 14:31:34 -0400

Hi, I'm must implement a routing routine.  I've have look at the source
of "route" in the nettools package but I can't understand what is
happening, even if I follow the program with xxdbg.  Can someone tell me
where can I get a simple example or good documentation about
implementing routing ?  

What I have to do is to save the actual routing table and restore it
later.  Any suggestion?

        Thanks
-- 
        Jean-Philippe Robichaud
        [EMAIL PROTECTED]
        (514) 818-7750
        (ESN) 888-7750
        St-Laurent, Quebec, Canada

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

From: [EMAIL PROTECTED] (Timothy J. Lee)
Crossposted-To: comp.os.linux.misc
Subject: Re: 2.2.16 eepro100 driver problems
Reply-To: [EMAIL PROTECTED] (Valid for a limited time)
Date: Wed, 05 Jul 2000 19:24:23 GMT

In article <[EMAIL PROTECTED]>,
Eric Lamarque  <[EMAIL PROTECTED]> wrote:
>"Timothy J. Lee" wrote:
>> 
>> With kernel 2.2.16, compiling the eepro100 into the kernel (not as
>> a module) does not seem to work.  The following messages appear in
>> the dmesg:
>> 
>>         eepro100: wait_for_cmd_done timeout!
>
>It seems that eepro100 in 2.2.16 driver has a problem:
>
>here, on a very standard configuration, and the driver compiled
>as kernel module, I obtain periodically:
>
>eth0:Printing Rx ring (next to receive into 503127).
>  Rx ring entry 0  00000001.
>[...]
>  PHY index 1 register 4 is 05e1.
>  PHY index 1 register 5 is 0021.
>  PHY index 1 register 21 is 0000.
>eth0: Trying to restart the transmitter...
>
>The same machine ran happilly for a long time with a kernel 2.2.13
>and the driver as a module.
>
>Any solution or fixes?

The one that I know of is to copy eepro100.c from 2.2.13.  But that
may not work after 2.4.

-- 
========================================================================
Timothy J. Lee
Unsolicited bulk or commercial email is not welcome.
No warranty of any kind is provided with this message.

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

From: Thomas Dzubin <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to retreive/change the full MAC address of a network card ?
Date: Wed, 05 Jul 2000 14:29:06 -0600

[...no line-eater bug anymore...]

Matthew Dare ([EMAIL PROTECTED]) wrote:
> Theoretically you shouldn't be able to modify any of it.  The first four digits are 
>the
...
> What I can't understand is why you would want to change the MAC address for anyway.
> If two or more cards chare the same mac address your network won't work anyway.
Um,
Because some protocols require it.

Running a DECNET network REQUIRES that you be able to change the default
MAC address
of the NIC.  The MAC address is directly related to your DECNET node
address.
All DECNET phase IV network addresses look like: AA-00-04-00-xx-yy

And this works just fine with TCP/IP in addition just as long as you
load DECNET
first...the router (or other TCP/IP devices) "see" the AA-00-04-00-xx-yy
address
just fine and sticks it in its ARP table.

I haven't found many network cards that do not support changing the MAC
address.
Certainly all the 3Com and Intel cards & chipsets that I've used
recently allow it.

Thomas Dzubin

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: linux programming help needed ......
Date: 5 Jul 2000 21:02:54 GMT

In article <8jgt4a$9f9$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:

| I am developing a webmail system on linux. I need to add a user into the
| system by cgi(written in GNU C), of course, I executed useradd program
| and passwd, the problem occurred when I tried to send the password to
| passwd using a pipe.  my program goes like this
| 
|   pipe_out = popen ("passwd username", "w");
|   fprintf (pipe_out, "password\npassword\n");
|   pclose(pipe_out);
| 
| but passwd said "conversation error". anoy way it doesn't work.  So
| anyone know how to handle this kind of problem? or in an alternative
| way to work the task out.

  See the 'expect' program for this. You need to be using a pty, and
that's a simple way to get there from here. Part of tk, tcl, some
package I don't remember off the top of my head.

-- 
bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
  "Doing interesting things with little computers since 1979"(tm)
It doesn't bother me that people make flavored yogurt with fruits. It doesn't
bother me that someone makes caramel broccoli yogurt. It doesn't even bother
me that people buy it to rub on each other's naked bodies.
What DOES bother me is that people buy it to EAT!

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

From: Kent Sorensen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Confirm this bug: CodeWarrior does not support spaces in paths?
Date: Wed, 05 Jul 2000 16:13:49 -0500



Roger Shawl wrote:

> Can someone please confirm that CodeWarrior for Linux is sensitive to
> spaces in paths?
>
> I had a mysterious compiler error that disappeared when I removed the
> space from a path and re-added the file. I don't want to change
> all my directories capriciously, since it will break all the other
> platforms and ports for the product.

Strictly speaking this is not a CodeWarrior bug. CodeWarrior for Linux
uses the native Linux compilers and linkers - not Metrowerks own
compilers and linkers that the Mac or Windows versions of CodeWarrior
uses. These certainly have no trouble with spaces in the filenames.

The problems with spaces in the filename must be in the native tools.

Kent Sorensen



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

From: "Paolo Romano" <[EMAIL PROTECTED]>
Subject: help on clone()
Date: Wed, 5 Jul 2000 23:23:03 +0200

I need to write a program to test a new system call I've inserted.
I should create (with "clone") 2 processes which share the file opened and
to switch beetween them to show a "race condition".
I've never done something like this, if some of you has ever tried or if you
know how to handle cloned processes can you explain me how to do?

Paolo Romano



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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Problems with writel in a device driver: please help save lives!
Date: Wed, 05 Jul 2000 21:57:01 GMT

On 05 Jul 2000 18:59:50 +0200, Mathias Waack <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Nick Bailey) writes:

> > cat /proc/pci) records).  We then map the memory using
> > ioremap_nocache() and hit it with the configuration bit twiddling.
> 
> You cannot use writel on mapped regions. Ether you map the region 
> or you access per PIO using the writeX family. 
> If your memory on the PCI card is mappable, then you should
> instead of 
>       writel(SamplingFrequency,
>          PEGASUS_ECL_CONTROL_REG(pegasus_base));
> better use
>       *(pegasus_base + PEGASUS_ECL_CONTROL_REG) = SamplingFrequency;
> 
> (assuming the pointer arithmetic is correct and the macro above simply 
> adds an offset). 
> 
> Try both: first eleminate the ioremap, then the writel should work. 
> Or use ioremap and change the writel to simply pointer accesses. 
> 
> Mathias

I strongly disagree with Mathias. ioremap() and writel() are supposed
to be used together, e.g.

    unsigned long virt;

    bus = pci_dev->resource[0].addr;
    size = DRIVER_KNOWN_SIZE;
    virt = ioremap(bus, size);
    writel(SOME_RESET_VALUE, virt + SOME_CONTROL_OFFSET);
    iounmap(virt);

This usage should be obvious from Documentation/IO-mapping.txt.

--Pete

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: IOremap question
Date: Wed, 05 Jul 2000 22:05:39 GMT

> I know that I have to used if ever I want to access the pci memory I want to
> have access to. (in my case 0xe0a00000). But why a simple pointer
> referencing to that address does not work ? What the ioremap function really
> does?
> 
> Thanks and regards
> Andres

The file /usr/src/linux/Documentation/IO-mapping.txt explains a lot of
it even if it is somewhat terse. I am afrain that whatever I explain
here would be either a duplication or confusing.

With that in mind, ioremap() sets up MMU translation tables in such
a way that a later call readb()/writeb() would produce a required
bus transaction.

On some architectures either ioremap() or readb/writeb may be trivial
operations, made up with #define's. For a non-trivial implementation
I would suggest to look at arch/sparc/kernel/ioport.c and
include/asm-sparc/io.h. The ioremap() is not empty on old 32 bits sparc
because sparc CPU has an MMU and has no easy way to setup a universal
bypass mapping. The writel() is not empty because it does byte swapping.

Read the implementation for different CPUs and you'll be enlightened.

--Pete

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

From: Hima Parimisetty <[EMAIL PROTECTED]>
Subject: Accidentally deleted "init "  directory
Date: Wed, 05 Jul 2000 22:30:04 GMT

Hi all,
  I have accidentally deleted "init"  and "lib"   directories I have both 
Windows NT and Linux installed on my workstation.I had some important data 
on the linux partition,so i can't reinstall linux .Can anyone please tell 
me what i should do? 

Thanks and regards,
Hima.

--
Posted via CNET Help.com
http://www.help.com/

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

From: "nick" <[EMAIL PROTECTED]>
Subject: Interrupts  in Linux
Date: Wed, 5 Jul 2000 17:23:52 -0600

I am kind of a newcomer to Linux development, at least as far as Interrupt
handling is concerned, so here is my question:  Is there a Linux equivalent
to the getvect(...) call?  I had this appear in a program that I was working
on doing a port with from Windows to Linux, but I couldn't  find any header
files on my system (even in windows) that contained this call or the similar
setvect(...) call.  I think this was due to a difference in developer
environments (Borland vs VC++).  I haven't been able to find much
documentation on interrupt handling in general, so if you know of any links
where I could find such info, let me know.  Thanks!!


Nick



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

From: Jan =?iso-8859-1?Q?R=F6hrich?= <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Connecting to a SQL-Server
Date: Thu, 06 Jul 2000 00:10:54 +0200

How do I connect to a SQL-Server using C++? Any libraries? In this case,
the SQL-Server is the local one with mySQL.

Jan R�hrich


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

From: "Dennis Huang" <[EMAIL PROTECTED]>
Subject: Re: copy_from_user
Date: Thu, 6 Jul 2000 09:44:56 +0800

Thanks for your help.
The copy_from_user() will expand to two functions.
One is an inline __instant_copy_from_user if the third argument is an
constant and less than 128.
The other is best_copy_from_user otherwise. (with -O compilitation option)
You may check them in asm/uaccess.h. or 'cat /proc/ksyms | grep
best_copy_from_user'

The compilitation option I use is
"-D__KERNEL -DMODULE -Wall -I/usr/include -g -O"
And I define __SMP__, MODVERSIONS, include modversions.h, kernel.h,
module.h,uaccess.h, etc in my source.

I would like to know which gcc version I should use.  I didn't change the
kernel(original from RedHat.)  And uaccess.h contains no RedHat copyright.
But it's optimized for i386.

yours, Dennis

"Mathias Waack" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Dennis Huang" <[EMAIL PROTECTED]> writes:
>
> > I am new to Linux and met a problem.  I used copy_from_user() in my
> > IOCTL function.  But the kernel refused to load my module.  It can't
> > find the symbol best_copy_from_user().
> >
> > I have checked the /proc/ksyms, there is only a best_copy_from_user()
> > function with version CRC code.  And my precompiled code has a barely
> > best_copy_from_user() function without version CRC.  I think that's
> > why the kernel refused to load the module.  Other functions like
> > printk() work.
> >
> > Enviroment: RedHat 6.2 smp kernel.  Linux kernel 2.2.14smp with gcc
> > egcs-2.91.66.
>
> Are you really sure that you've used the right headers and command-line
> switches for the compilitation of your module?
>
> My 2.2.14 kernel doesn't contain a function or macro named
> best_copy_from_user. Where is this function defined? Does RedHat
> changes the standard kernel?
>
> IIRC there is a problem with the egcs. It shouldn't be used for kernel
> compilation. You should upgrade the compiler.
>
> Not much help, I know:(
>
> Mathias



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

From: "Dennis Huang" <[EMAIL PROTECTED]>
Subject: Re: copy_from_user
Date: Thu, 6 Jul 2000 09:46:17 +0800

Villy,

Thanks for your help.  I have defined them in my Makefile or source already.
Other functions work like printk.  I think it's not the problem of that.

yours, Dennis

"Villy Kruse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Wed, 5 Jul 2000 17:35:13 +0800,
>        Dennis Huang <[EMAIL PROTECTED]> wrote:
>
>
>
> >I am new to Linux and met a problem.
> >I used copy_from_user() in my IOCTL function.
> >But the kernel refused to load my module.
> >It can't find the symbol best_copy_from_user().
> >
> >I have checked the /proc/ksyms, there is only a best_copy_from_user()
> >function with version CRC code.  And my precompiled code has a barely
> >best_copy_from_user() function without version CRC.  I think that's why
the
> >kernel refused to load the module.
> >Other functions like printk() work.
> >
> >Enviroment:
> >RedHat 6.2 smp kernel.
> >Linux kernel 2.2.14smp with gcc egcs-2.91.66.
> >
>
>
> Compile with -DMODVERSIONS and -DMODULE
>      and -include /usr/src/linux/include/linux/modversions.h
>
> plus whatever compile flags you already have.
>
>
>
> Villy



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

From: Aravind Sadagopan <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Connecting to a SQL-Server
Date: Wed, 05 Jul 2000 21:39:09 +0800
Reply-To: [EMAIL PROTECTED]

Jan R�hrich wrote:

> How do I connect to a SQL-Server using C++? Any libraries? In this case,
> the SQL-Server is the local one with mySQL.
>
> Jan R�hrich

I think you should have a copy of the mysql manual..There are a whole lot
of API's in C for mySQL.
Also dont forget to get the MySQL-devel rpm. You will need the
libmysqlclient libraries for this purpose

aravind


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

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Interrupts  in Linux
Date: Thu, 06 Jul 2000 02:05:59 GMT

On Wed, 5 Jul 2000 17:23:52 -0600, nick <[EMAIL PROTECTED]> wrote:

>I am kind of a newcomer to Linux development, at least as far as Interrupt
>handling is concerned, so here is my question:  Is there a Linux equivalent
>to the getvect(...) call?

Not for user programs.  

All interrupt handling is done in the kernel.  There _is_ a
kernel module somewhere that can be told by a user-function to
wait for an particular interrupt to occur -- that way
interrupts can be handle by user-space programs in a manner.

If you're writing a device driver or kernel module, then there
are calls to register a routine as an interrupt service handler.

-- 
Grant Edwards                   grante             Yow!  Are you selling NYLON
                                  at               OIL WELLS?? If so, we can
                               visi.com            use TWO DOZEN!!

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


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