Linux-Development-Sys Digest #696, Volume #7 Wed, 22 Mar 00 15:13:19 EST
Contents:
Re: 2.2.x->2.3.x DKI changes (Robert Lynch)
Problem getting mmap region to work correctly.... Please help... (Robert Nickel)
Re: Problem getting mmap region to work correctly.... Please help... (Anders Larsen)
Re: sock_sendmsg() (James Emil Avery)
Re: sock_sendmsg() (James Emil Avery)
Re: UART overrun errors (Tony R. Bennett)
Re: pthread library not found (Alan McLean)
what do i wrong with skb_copy()? (root)
QUESTION: time stampinig in user programs (Christian Langis)
kernel 2.2.14 and Software Raid... (John Burton)
Re: Absolute failure of Linux dead ahead? (Ronald Cole)
Re: tampering with masq module for Netmeeting (Ronald Cole)
Re: QUESTION: time stampinig in user programs (Andreas Kahari)
Loader question... ([EMAIL PROTECTED])
Is there a way to boot linux off a Server (another linux box) containing a proper
image ("Wai Wu")
Re: Absolute failure of Linux dead ahead? ("SetMeUp")
Re: Problem getting mmap region to work correctly.... Please help... (Robert Nickel)
----------------------------------------------------------------------------
Date: Wed, 22 Mar 2000 08:13:06 -0800
From: Robert Lynch <[EMAIL PROTECTED]>
Subject: Re: 2.2.x->2.3.x DKI changes
Bill Waddington wrote:
>
> Hello,
>
> I there somewhere a list of driver/kernel interface changes between 2.2
> & 2.3? I think someone is working on Rubini II, but for now it would be
> sufficient to just have a list of the names of kernel functions and
> driver-related structures that have changed.
>
> I am trying to port a 2.2 chaining DMA driver to 2.3.51 and get it
> running before adding the kiobuf stuff. So far I have tripped over
> pci_dev and notice that something has changed w/wait queues, but I
> suspect that there is more.
>
> Thanks to all,
> Bill
>
> --
> Bill Waddington
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Richard Gooch's page:
http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.3.html
may (or may not) prove helpful.
Cheers, Bob L.
--
Robert Lynch-Berkeley CA [EMAIL PROTECTED]
------------------------------
From: Robert Nickel <[EMAIL PROTECTED]>
Subject: Problem getting mmap region to work correctly.... Please help...
Date: Wed, 22 Mar 2000 08:40:32 -0800
I'm trying to write a user space loader program that loads control rom from a disk
file into volatile rom on the card. This is done via i/o ports and the memory range
from 0xd0000-0xd7fff.
The i/o ports part was really simple and I've got it under control. The part that's
keeping me up nights is the mmap portion. I can't get it to work for me, and I'm
curious as to why.
The card is supposed to switch 16k banks of the memory to and from the beginning of
the memory range. The problem I'm having is that the banks aren't switching. I'm
wondering if it is the MAP_PRIVATE flag in my call to mmap.
Here's my code, boiled down to the part that is giving me grief:
==================================================
//The variables in question are defined as follows
unsigned char *cardmem;
int memptr;
if ((memptr=open("/dev/mem", O_RDWR))<0) {
choke_and_die("Couldn't get memory"); //My death function
exit(1);
}
if ((cardmem=(unsigned char *)
mmap(0,0x7fff,PROT_READ|PROT_WRITE,MAP_PRIVATE,0xd0000))<0) {
choke_and_die("Couldn't map memory");
exit(1);
}
*cardmem=0xf3;
//outb to switch banks
*cardmem=0xff;
//outb to switch banks back to original
if (*cardmem!=0xf3) {
choke_and_die("Memory banks didn't switch");
exit(1);
}
=============================================================================
That's it. It always dies on switching the banks.
Thanks in advance.
--Robert
p.s. I posted another message last night, but didn't see it on the group this
morning. Sorry if this is a dup.
------------------------------
From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: Problem getting mmap region to work correctly.... Please help...
Date: Wed, 22 Mar 2000 18:08:55 +0100
Robert Nickel wrote:
>
> I'm trying to write a user space loader program that loads control rom from a disk
>file into volatile rom on the card. This is done via i/o ports and the memory range
>from 0xd0000-0xd7fff.
>
> The i/o ports part was really simple and I've got it under control. The part that's
>keeping me up nights is the mmap portion. I can't get it to work for me, and I'm
>curious as to why.
>
> The card is supposed to switch 16k banks of the memory to and from the beginning of
>the memory range. The problem I'm having is that the banks aren't switching. I'm
>wondering if it is the MAP_PRIVATE flag in my call to mmap.
>
> Here's my code, boiled down to the part that is giving me grief:
>
> --------------------------------------------------
>
> //The variables in question are defined as follows
> unsigned char *cardmem;
> int memptr;
>
> if ((memptr=open("/dev/mem", O_RDWR))<0) {
> choke_and_die("Couldn't get memory"); //My death function
> exit(1);
> }
>
> if ((cardmem=(unsigned char *)
>mmap(0,0x7fff,PROT_READ|PROT_WRITE,MAP_PRIVATE,0xd0000))<0) {
> choke_and_die("Couldn't map memory");
> exit(1);
> }
>
> *cardmem=0xf3;
>
> //outb to switch banks
>
> *cardmem=0xff;
>
> //outb to switch banks back to original
>
> if (*cardmem!=0xf3) {
> choke_and_die("Memory banks didn't switch");
> exit(1);
> }
>
> -----------------------------------------------------------------------------
>
> That's it. It always dies on switching the banks.
Could you change the line *cardmem=0xff; to write another value and then see
what you get back in your test, that is, check if you can write to the memory
at all?
My guess is you can, otherwise your task would probably have been killed; that
is, the memory is indeed mapped.
Are you 100% sure your bank-switching outb are correct?
BTW, the 2.nd parameter to mmap (length) should be 0x8000, not 0x7fff.
--
Anders Larsen
------------------------------
From: James Emil Avery <[EMAIL PROTECTED]>
Subject: Re: sock_sendmsg()
Date: Wed, 22 Mar 2000 18:29:06 +0100
On 19 Mar 2000, David Wragg wrote:
> sock_sendmsg() expects the data to be in user-space. Becuase your data
> is in kernel-space, the access checks fail, hence EFAULT. Empty
> messages are an exception since they don't have any data.
>
> To avoid this you need to do a set_fs(get_ds()) before the
> sock_sendmessage(), and then restore fs afterwards. See other places
> in the kernel that call sock_sendmsg (e.g. in net/sunrpc/) for
> examples.
Thank you - that was the exact solution. :)
--
Med venlig hilsen,
James Avery <[EMAIL PROTECTED]>
------------------------------
From: James Emil Avery <[EMAIL PROTECTED]>
Subject: Re: sock_sendmsg()
Date: Wed, 22 Mar 2000 18:30:01 +0100
On Tue, 21 Mar 2000, Dan McGuirk wrote:
> > But how does one usually do 'loose' communication between kernel modules
> > and user-processes, then?
>
> Another poster already gave a better answer than mine. See his post,
> which describes doing a set_fs(KERNEL_DS), and suggests checking out the
> calls to sock_sendmsg() in net/sunrpc/svcsock.c as an example.
I missed that post the first time around - but yes, that seems to be the
way to do it.
--
Med venlig hilsen,
James Avery <[EMAIL PROTECTED]>
------------------------------
From: [EMAIL PROTECTED] (Tony R. Bennett)
Subject: Re: UART overrun errors
Date: 22 Mar 2000 09:31:25 -0800
In article <[EMAIL PROTECTED]>,
Mats Byggmastar <[EMAIL PROTECTED]> wrote:
>Hello,
>
>I'm working with some serial port code and (again) run into problems.
>I open a port (/dev/ttyS0) at 115200 bps. Data is sent/received over
>the port at a steady 64 kbit/s. I've also tried using lower speeds.
>However, the port don't seem to be very reliable. As soon as there is
>some disk activity, I immediately receive errors in my data stream.
>Either bytes are lost or random bytes are inserted into the received data
>stream. Checking in /proc/tty/driver/serial I see that a 16550A UART is
>used. I can also see that the errors are registered as overrrun errors.
>
>Does this mean that the interrupt that the 16550A issues isn't served by
>the driver in time and the FIFO gets overwritten?
>
>To eliminate the possibility that I could be picking up external noise
>on the null-modem cable I tested the port in loopback, TX pin connected
>to RX pin, with a very short wire. The problem was still there.
>
>Anyone has some ideas what is going on?
>
>I am using Red Hat 6.1
>
>
>Mats
>-------------------------------------------
>Mats Byggmastar, B.Sc., SW Design Engineer
>GSM/GPRS/D-AMPS cellular data testequipment
>Moesarc Technology AS, Oslo Norway
>[EMAIL PROTECTED], tel: (+47)22516974
First let me preface this with "I'M NOT AN EXPERT"
A couple of things:
- the UART generates an interrupt when data is ready...
(Possibly, when there are certain number of bytes in
its FIFO buffer)...the OS prioritizes the interrupts
so a DISK interrupt may have priority over a serial port
interrupt... but we can't control that...
- An overrun error usually means:
- bytes not being pulled out fast enough...
...i.e. the system is VERY BUSY
or
- peer on the serial port is not obeying flow control
(RTS/CTS...or XON/XOFF)
HTH,
Tony
--
Anti-spam filter: I am not root@localhost
trb@teleport dot com COM Public Access User --- Not affiliated with Teleport
------------------------------
From: [EMAIL PROTECTED] (Alan McLean)
Subject: Re: pthread library not found
Date: Wed, 22 Mar 2000 18:04:28 GMT
Kaz Kylheku <[EMAIL PROTECTED]> wrote:
>
> If you are using a recent gcc, just try the -pthread option. This option
> sets up the correct compiler options for making a threaded program.
>
> That is to say, it adds -D_REENTRANT as well as -lpthread . If you are
> curious, you can see the effect if you also specify -v .
I'll second that. Not all systems put POSIX thread functions in
libpthread; FreeBSD for example puts them in libc_r. Using -pthread
will make this part of the build more portable.
-amcl
------------------------------
From: root <[EMAIL PROTECTED]>
Subject: what do i wrong with skb_copy()?
Date: Wed, 22 Mar 2000 20:00:11 +0100
Hello world,
my problem: I have 2 computers connected via ethernet-crosslink cable,
running with 3com Boomerang NICs (driver 3c59x.c). One machine is
connected to the internet via a no-name ne2000 PCI NIC. I have set up
the ip-forwarding mechanism after the description in the appropriate
HOW-TO and it runs well.
Now I want to modify the data, that is exchanged by the both computers
to simulate some other protocoll-stuff (a little gprs-mac-examination).
Therefore I started very little: I replaced in the device structur the
dev->hard_start_xmit entry with my own function: gprs_entry.
It calls the sndcp_tx() which should create a new sk_buff and send it
with the original (untouched) boomerang_start_xmit(). After that, the
temporarily allocated sk_buff is freed. In a later version the new skb2
should carry the "old" skb with the IP-Packet plus some of my own data.
The gateway to the internet freezes immediately after the slave wants to
access it (http, ftp, telnet).
Can anyone give me clou, what went wrong or tell me how i can send data
without reprogramming the upper network-layers?
I am running SUSE-Linux 6.1 with the 2.2.5 kernel, if it is interesting.
Here is the code:
static int gprs_entry(struct sk_buff *skb, struct device *dev)
{
int ret;
ret = sndcp_tx(skb, dev);
return ret;
}
static int sndcp_tx(struct sk_buff *skb, struct device *dev)
{
int ret;
struct sk_buff *skb2;
skb2 = skb_copy(skb, GFP_ATOMIC);
ret = boomerang_start_xmit(skb2, dev);
dev_kfree_skb(skb2);
return ret;
}
thanks in advance
hardy
------------------------------
From: Christian Langis <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps,comp.os.linux.help,comp.os.linux.misc,comp.os.linux.questions
Subject: QUESTION: time stampinig in user programs
Date: Wed, 22 Mar 2000 18:19:35 +0000
Hi there.
I am programming scientific applications for which I
need very sharp time stamping functions. First I used GETTIMEOFDAY which
return time stamp information precise to the micro second. But the since
our programs did not behave in time as we expected, we suspected that
system execution time might have something to do with the time
discrepancies of our program. Therefore, we wanted to use usertime time
stamps only. Therefore, we switched to TIMES.
Our system is set up on RedHat 5.2. And with the simple test:
#include <sys/times.h>
#include <stdio.h>
void main(void)
{
struct tms buffer[1];
clock_t res;
res = times(buffer);
printf("res = %ld\n", res);
printf("tms_utime=%ld\n", buffer->tms_utime);
printf("tms_stime=%ld\n", buffer->tms_stime);
printf("tms_cutime=%ld\n", buffer->tms_cutime);
printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
sleep(1); //sleep for 1 second
res = times(buffer);
printf("res = %ld\n", res);
printf("tms_utime=%ld\n", buffer->tms_utime);
printf("tms_stime=%ld\n", buffer->tms_stime);
printf("tms_cutime=%ld\n", buffer->tms_cutime);
printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
}
we get the execution:
res = 78324562
tms_utime=0
tms_stime=0
tms_cutime=0
tms_cstime=0
res = 78324663
tms_utime=0
tms_stime=0
tms_cutime=0
tms_cstime=0
which shows that TIMES doesn't work (it does not fill the TMS
strcuture).
Does anybody knows what is the problem? Or does anybody knows other
useful timestamp functions (preferably usertime only)?
thanks
--
Christian Langis NRC, building M-50, room 343
NRC researcher 1500 Montreal road
[EMAIL PROTECTED] Ottawa, Canada
(613)993-8558 K1A 0R6
------------------------------
From: John Burton <[EMAIL PROTECTED]>
Subject: kernel 2.2.14 and Software Raid...
Date: Wed, 22 Mar 2000 18:23:10 GMT
Greetings!
I have a RedHat 6.1 system which utilizes the "md" driver for a RAID-0
array. I tried to compile and run a stock 2.2.14 kernel and ran into
some problems. The kernel compiled fine, but when I went to run it it
didn't like the "persistent-superblock" for the two partitions that make
up the RAID-0 array. I don't have the exact message because it dropped
me to single user mode and I rebooted back to my original kernel. My
question is, is there a raid kernel patch for the 2.2.14 kernel that
would work with an array created on a RedHat 6.1 2.2.12-20 kernel? If
so, where could I find it? I found patches for kernels upto 2.2.11, but
no higher...
John
------------------------------
From: Ronald Cole <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy
Subject: Re: Absolute failure of Linux dead ahead?
Date: 22 Mar 2000 10:21:29 -0800
[EMAIL PROTECTED] (The Ghost In The Machine) writes:
> Would you rather we rewrite the kernel in Fortran or COBOL? :-)
What's wrong with Modula-3? ;)
--
Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412
Ronald Cole <[EMAIL PROTECTED]> Phone: (760) 499-9142
President, CEO Fax: (760) 499-9152
My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084 4A88 8851 E6C8 69E3 B00B
------------------------------
From: Ronald Cole <[EMAIL PROTECTED]>
Subject: Re: tampering with masq module for Netmeeting
Date: 22 Mar 2000 10:25:47 -0800
Damon Register <[EMAIL PROTECTED]> writes:
> Some months ago a programmer wrote and posted a masq module for
> Netmeeting that has actually worked but it is only for 2.0.x kernels.
> So far no one has updated the module to work with 2.2.x kernels.
> Is there anyone who would be willing to try? I am only starting in
> the Linux world and don't have the experience for this yet.
Yow! Do you know who that was? I've been intentioning to throw a few
hundred dollars at such a project (provided it gets merged into the
kernel).
--
Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412
Ronald Cole <[EMAIL PROTECTED]> Phone: (760) 499-9142
President, CEO Fax: (760) 499-9152
My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084 4A88 8851 E6C8 69E3 B00B
------------------------------
From: Andreas Kahari <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: QUESTION: time stampinig in user programs
Date: Wed, 22 Mar 2000 19:02:16 GMT
Does the program use any sys/usr time while it is suspended in 'sleep'?
It doesn't look as if it did. I replaced your sleep call with a large
empty loop and it worked fine.
for (i = 0; i < 100000000; i++) { }
With no optimization, I got
res = 129605319
tms_utime=1
tms_stime=0
tms_cutime=0
tms_cstime=0
res = 129605739
tms_utime=403
tms_stime=0
tms_cutime=0
tms_cstime=0
...running on an Sun Ultra 5 (Solaris). I also incorporated the
following changes...
Style: You should use "struct tms buffer;" instead of an array of length
1. Call 'times' with '&buffer' and access the struct data using '.'
instead of '->'. The 'main' routine should return a 0 after successful
execution.
/A
In article <[EMAIL PROTECTED]>,
Christian Langis <[EMAIL PROTECTED]> wrote:
> Hi there.
> I am programming scientific applications for which I
> need very sharp time stamping functions. First I used GETTIMEOFDAY
which
> return time stamp information precise to the micro second. But the
since
> our programs did not behave in time as we expected, we suspected that
> system execution time might have something to do with the time
> discrepancies of our program. Therefore, we wanted to use usertime
time
> stamps only. Therefore, we switched to TIMES.
>
> Our system is set up on RedHat 5.2. And with the simple test:
>
> #include <sys/times.h>
> #include <stdio.h>
> void main(void)
> {
> struct tms buffer[1];
> clock_t res;
>
> res = times(buffer);
> printf("res = %ld\n", res);
> printf("tms_utime=%ld\n", buffer->tms_utime);
> printf("tms_stime=%ld\n", buffer->tms_stime);
> printf("tms_cutime=%ld\n", buffer->tms_cutime);
> printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
>
> sleep(1); //sleep for 1 second
>
> res = times(buffer);
> printf("res = %ld\n", res);
> printf("tms_utime=%ld\n", buffer->tms_utime);
> printf("tms_stime=%ld\n", buffer->tms_stime);
> printf("tms_cutime=%ld\n", buffer->tms_cutime);
> printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
> }
>
> we get the execution:
>
> res = 78324562
> tms_utime=0
> tms_stime=0
> tms_cutime=0
> tms_cstime=0
>
> res = 78324663
> tms_utime=0
> tms_stime=0
> tms_cutime=0
> tms_cstime=0
>
> which shows that TIMES doesn't work (it does not fill the TMS
> strcuture).
>
> Does anybody knows what is the problem? Or does anybody knows other
> useful timestamp functions (preferably usertime only)?
>
> thanks
>
> --
> Christian Langis NRC, building M-50, room 343
> NRC researcher 1500 Montreal road
> [EMAIL PROTECTED] Ottawa, Canada
> (613)993-8558 K1A 0R6
>
>
--
# Andreas K�h�ri
# Brought to you from Uppsala, Sweden
# http://hello.to/andkaha
# Remember, an e-mail is as secure as a postcard
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED]
Subject: Loader question...
Date: Wed, 22 Mar 2000 19:10:10 GMT
I have an Intel StrongArm processor on a Network board from Intel.I need
to load the linux kernel onto the processor, which I create by
cross-compilation from the Redhat 6 release.
For the StrongArm processor,is there a loader ?? There might be no
console or keyboard, only a serial port on the board. Is there a loader
written for such a processor that would allow me to load the
kernel(maybe from a floppy) onto the processor ?? Or do I need to write
one ???
Thanks,
Krishna
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: "Wai Wu" <[EMAIL PROTECTED]>
Subject: Is there a way to boot linux off a Server (another linux box) containing a
proper image
Date: Wed, 22 Mar 2000 14:05:24 -0500
------------------------------
From: "SetMeUp" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy
Subject: Re: Absolute failure of Linux dead ahead?
Date: Wed, 22 Mar 2000 19:43:06 GMT
> What's wrong with Modula-3? ;)
It's wrong that it is not C.
------------------------------
From: Robert Nickel <[EMAIL PROTECTED]>
Subject: Re: Problem getting mmap region to work correctly.... Please help...
Date: Wed, 22 Mar 2000 11:59:08 -0800
In article <[EMAIL PROTECTED]>, Anders Larsen
<[EMAIL PROTECTED]> wrote:
> Robert Nickel wrote:
>>
>> I'm trying to write a user space loader program that loads control rom
>> from a disk file into volatile rom on the card. This is done via i/o
>> ports and the memory range from 0xd0000-0xd7fff.
>>
>> The i/o ports part was really simple and I've got it under control.
>> The part that's keeping me up nights is the mmap portion. I can't get
>> it to work for me, and I'm curious as to why.
>>
>> The card is supposed to switch 16k banks of the memory to and from the
>> beginning of the memory range. The problem I'm having is that the
>> banks aren't switching. I'm wondering if it is the MAP_PRIVATE flag in
>> my call to mmap.
>>
>> Here's my code, boiled down to the part that is giving me grief:
>>
>> --------------------------------------------------
>>
>> //The variables in question are defined as follows
>> unsigned char *cardmem; int memptr;
>>
>> if ((memptr=open("/dev/mem", O_RDWR))<0) {
>> choke_and_die("Couldn't get memory"); //My death function
>> exit(1);
>> }
>>
>> if ((cardmem=(unsigned char *)
>> mmap(0,0x7fff,PROT_READ|PROT_WRITE,MAP_PRIVATE,0xd0000))<0) {
>> choke_and_die("Couldn't map memory"); exit(1);
>> }
>>
>> *cardmem=0xf3;
>>
>> //outb to switch banks
>>
>> *cardmem=0xff;
>>
>> //outb to switch banks back to original
>>
>> if (*cardmem!=0xf3) {
>> choke_and_die("Memory banks didn't switch"); exit(1);
>> }
>>
>> -----------------------------------------------------------------------------
>>
>> That's it. It always dies on switching the banks.
>
> Could you change the line *cardmem=0xff; to write another value and then
> see what you get back in your test, that is, check if you can write to
> the memory at all? My guess is you can, otherwise your task would
> probably have been killed; that is, the memory is indeed mapped. Are you
> 100% sure your bank-switching outb are correct?
>
> BTW, the 2.nd parameter to mmap (length) should be 0x8000, not 0x7fff.
>
> --
> Anders Larsen
Yes. I'm sure that the outb is correct (given to me from the card vendor).
Yeah. The memory read when I do it gets back the second value written, not the first
which is what it should get back if
the banks had switched (thereby preserving the first value).
Thanks on the 0x8000.
--Robert
------------------------------
** 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
******************************