Re: [rtl] rtnet

2000-12-06 Thread Rafeeq Ur Rehman

Source code of all these network functions is available from a number of
sites on the internet and there is  nothing magic about it. I am
copying BSD source code for inet_aton(). You can look for other
functions at the following web site:
http://www.ajk.tele.fi/libc/code.html


/*  */
/* inet_aton */
int
inet_aton(cp, addr)
 register const char *cp;
 struct in_addr *addr;
{
 register u_long val;
 register int base, n;
 register char c;
 u_int parts[4];
 register u_int *pp = parts;

 c = *cp;
 for (;;) {
  /*
   * Collect number up to ``.''.
   * Values are specified as for C:
   * 0x=hex, 0=octal, isdigit=decimal.
   */
  if (!isdigit(c))
   return (0);
  val = 0; base = 10;
  if (c == '0') {
   c = *++cp;
   if (c == 'x' || c == 'X')
base = 16, c = *++cp;
   else
base = 8;
  }
  for (;;) {
   if (isascii(c)  isdigit(c)) {
val = (val * base) + (c - '0');
c = *++cp;
   } else if (base == 16  isascii(c)  isxdigit(c)) {
val = (val  4) |
 (c + 10 - (islower(c) ? 'a' : 'A'));
c = *++cp;
   } else
   break;
  }
  if (c == '.') {
   /*
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
   if (pp = parts + 3)
return (0);
   *pp++ = val;
   c = *++cp;
  } else
   break;
 }
 /*
  * Check for trailing characters.
  */
 if (c != '\0'  (!isascii(c) || !isspace(c)))
  return (0);
 /*
  * Concoct the address according to
  * the number of parts specified.
  */
 n = pp - parts + 1;
 switch (n) {

 case 0:
  return (0);  /* initial nondigit */

 case 1:/* a -- 32 bits */
  break;

 case 2:/* a.b -- 8.24 bits */
  if (val  0xff)
   return (0);
  val |= parts[0]  24;
  break;

 case 3:/* a.b.c -- 8.8.16 bits */
  if (val  0x)
   return (0);
  val |= (parts[0]  24) | (parts[1]  16);
  break;

 case 4:/* a.b.c.d -- 8.8.8.8 bits */
  if (val  0xff)
   return (0);
  val |= (parts[0]  24) | (parts[1]  16) | (parts[2]  8);
  break;
 }
 if (addr)
  addr-s_addr = htonl(val);
 return (1);
}

--
Rafeeq Ur Rehman

http://vig.prenhall.com/academic/product/1,3411,0130183741,00.html
--
- Original Message - 
From: Randolph Lee 
To: [EMAIL PROTECTED] 
Sent: Monday, December 04, 2000 12:05 AM
Subject: [rtl] rtnet


Hello,

Currently I'm working on a project using RT Linux for networking. I'm using
Rtnet V0.9.0. I was wondering if there is an RT function that is similar to
inet_addr or inet_aton (in arpa/inet.h).

Thanks,
Randolph
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] c++ and rtl / posix_types.h

2000-12-06 Thread Olaf Petzold

Hallo,

one more with c++. Why are the macros __NFDBITS and __FDMASK redefined
inside linux/posix_types.h. For me it looks the same at first glance.

# make
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../common -I../kcpplib -I/usr/src/linux/include 
-I/usr/rtlinux/include -I/usr/rtlinux/include/compat -I/usr/rtlinux/include/posix
-Wall -Wstrict-prototypes -Winline -m486 -malign-loops=2 -malign-jumps=2 
-malign-functions=2 -fno-exceptions -fno-rtti -pipe -fno-strength-reduce 
-mpreferred-stack-boundary=2 -DCPU=686 -march=i686 -Wall -Wstrict-prototypes -D__RTL__ 
-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -g -DDEBUG  -c DaqCard.cc
In file included from /usr/include/stdio.h:40,
 from 
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../include/g++-3/cstdio:6,
 from DaqCard.cc:44:
/usr/include/bits/types.h:95: warning: `__NFDBITS' redefined
/usr/src/linux/include/linux/posix_types.h:22: warning: this is the location of the 
previous definition
/usr/include/bits/types.h:97: warning: `__FDMASK' redefined
/usr/src/linux/include/linux/posix_types.h:34: warning: this is the location of the 
previous definition  

Next, how was in sucess to mix stl headers and kernel headers ? 
stl_alloc.h fails with PTHREAD_MUTEX_INITIALIZER

Thanks Olaf


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] timer ints

2000-12-06 Thread Gordon McNutt

[EMAIL PROTECTED] wrote:

 On Tue, Dec 05, 2000 at 11:13:26AM -0700, Gordon McNutt wrote:
  Hi,
 
  On an x86 (for example), if an RT task programs a clock timer does it
  conflict with the regular system timer interrupts? They both appear to
  use IRQ 0.

 Where RTL uses the same timer as Linux, we fake interrupts down to the Linux
 layer. See rtl_timer code.

I was just wondering if programming the timer in one-shot mode might cause the
normal system timer interrupt to be called at an unusual interval (thus
affecting the jiffie count, etc). Seems that the linux layer will get its fake
timer interrupt when (and only when) the one-shot fires.

--Gordon


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] Re: c++ and rtl / posix_types.h

2000-12-06 Thread Olaf Petzold

  
 Next, how was in sucess to mix stl headers and kernel headers ? 
 stl_alloc.h fails with PTHREAD_MUTEX_INITIALIZER

template bool __threads, int __inst
pthread_mutex_t
__default_alloc_template__threads, __inst::_S_node_allocator_lock
= PTHREAD_MUTEX_INITIALIZER;

Well, this expands in kernel to:


template bool __threads, int __inst
pthread_mutex_t
__default_alloc_template__threads, __inst::_S_node_allocator_lock
= { 0,0,1, (spinlock_t) { } , PTHREAD_MUTEX_DEFAULT, { 0  } , 
PTHREAD_PRIO_NONE } ;


and in user space to:

template bool __threads, int __inst
pthread_mutex_t
__default_alloc_template__threads, __inst::_S_node_allocator_lock
= {0, 0, 0, PTHREAD_MUTEX_FAST_NP, {0, 0}} ;

Should posix not be same ?

Thanks  Olaf
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] It's Psos me off !

2000-12-06 Thread GREG
Hi there,
I am working under PSOS, in C (Diab Compiler), for a Power PC 403, and this environment is not stable...
Question : is it easy to migrate from PSOS+Diab C Compiler PPC to RTLinux+Compiler (...this POSIX is it ok ?)
GREG
Do You Yahoo!?
Yahoo! Shopping - 
Thousands of Stores. Millions of Products.

Re: [rtl] timer ints

2000-12-06 Thread Cort Dougan

} I was just wondering if programming the timer in one-shot mode might cause the
} normal system timer interrupt to be called at an unusual interval (thus
} affecting the jiffie count, etc). Seems that the linux layer will get its fake
} timer interrupt when (and only when) the one-shot fires.

We make certain that the Linux timer is monotonically increasing.  If you
take a look at arch/i386/kernel/time.c you'll see changes to gettimeofday
that cooperate with RTLinux.

When we have a RT task with a deadline at X and Linux expects a timer tick
in X/2 we deliver the Linux tick without delay and still don't miss the RT
task deadline.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] RTAI: lockcpu

2000-12-06 Thread Christopher D. Carothers

Hi all -- I just tried to patch the 2.4.0 test11 kernel with the
RTL 3.0 kernel 2.4 patch and it fails -- how did you get the patch to go
thru?? I am assume from the message below you are running RTL 3.0 under
kernel 2.4.0 test 11 kernel

Below is a trace of the patches output?

[root@czpc8 linux-2.4.0-test11]# patch -p1  ../kernel_patch-2.4
patching file `Documentation/Configure.help'
Hunk #1 succeeded at 1592 (offset 22 lines).
Hunk #2 succeeded at 17227 (offset 1193 lines).
patching file `Makefile'
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to Makefile.rej
patching file `arch/alpha/config.in'
Hunk #1 FAILED at 52.
1 out of 1 hunk FAILED -- saving rejects to arch/alpha/config.in.rej
patching file `arch/alpha/kernel/alpha_ksyms.c'
Hunk #4 succeeded at 237 (offset 2 lines).
patching file `arch/alpha/kernel/entry.S'
Hunk #1 succeeded at 152 (offset 2 lines).
Hunk #3 succeeded at 215 (offset 2 lines).
Hunk #5 succeeded at 484 (offset 2 lines).
Hunk #7 FAILED at 694.
Hunk #8 succeeded at 724 (offset 2 lines).
1 out of 8 hunks FAILED -- saving rejects to arch/alpha/kernel/entry.S.rej
patching file `arch/alpha/kernel/irq.c'
Hunk #1 succeeded at 567 (offset 4 lines).
Hunk #3 succeeded at 666 (offset 4 lines).
patching file `arch/alpha/kernel/irq_impl.h'
patching file `arch/alpha/kernel/proto.h'
Hunk #1 succeeded at 92 (offset 17 lines).
patching file `arch/alpha/kernel/smp.c'
Hunk #1 succeeded at 623 with fuzz 2 (offset 9 lines).
Hunk #2 succeeded at 641 (offset -19 lines).
Hunk #3 succeeded at 750 (offset 9 lines).
Hunk #4 succeeded at 792 (offset -17 lines).
patching file `arch/alpha/kernel/traps.c'
Hunk #2 succeeded at 318 (offset 209 lines).
patching file `arch/i386/config.in'
Hunk #1 succeeded at 2 with fuzz 2.
patching file `arch/i386/kernel/Makefile'
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to arch/i386/kernel/Makefile.rej
patching file `arch/i386/kernel/acpi.c'
Hunk #1 succeeded at 1184 with fuzz 2 (offset 88 lines).
Hunk #2 succeeded at 1108 (offset 1 line).

Any suggestion would be most appreciated.

Thanks,
Chris

On Tue, 5 Dec 2000, huib wrote:
 At 09:56 PM 12/4/00 GMT, you wrote:
  Just was an idea so you could check if (no realtime linux needed) you
  have
  those APIC errors, but it seems not needed when you already know that
  :-)
 Well you shouldn't recieve any apic error if you are running with 66MHz
 bus.
 I'm starting to get them with 75MHz 
 I tried 2.4.0-test11 kernel, no apic errors at all.
 
  could those APIC errors be the problem ?
 
 No at all - many kernel developer try to find some excuses for their
 bugs :)
 Well, this is an unmodified RTAI example...
 Did you ever try RTAI on your bp6?
  
 huib
 
 
 email : [EMAIL PROTECTED]
 
 Tagline for Tuesday, December 05, 2000
 A single fact can spoil a good argument.
 
 
 -- [rtl] ---
 To unsubscribe:
 echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
 echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
 ---
 For more information on Real-Time Linux see:
 http://www.rtlinux.org/rtlinux/
 
 

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] uninterruptable sequence of instructions with rtl3.0

2000-12-06 Thread Ralf Ramrath

hi folks,

I have the following problem:

I must ensure, that a rt-process will execute a sequence of instructions
without being interrupted by e.g. an isr ( with higher priority ). I have
not found any function calls in rtl3.0 that performs a kind of
cpu_(un)locking?

:
lock_cpu(); // no other process is able to get the cpu
foo();
:
bar();
unlock_cpu(); // from now, each other process is able to obtain the cpu

Are there any functions ( I called them here lock_cpu and unlock_cpu )
implemented in rtl3.0 or do I have to implement these functions myself ?


Thanks a lot in advance to all of you !

best regards
  ralf

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] setitimer() equivalent...

2000-12-06 Thread Kiran Garimella

Hello everyone,
I am currently working on a program that I think could make use of some
of the things the rtlinux project provides.
I've written a small program (an accuracy test to see how accurate
linux will deliver signals to me).  It records the current time (t0),
sets a timer via setitimer() for a random amount of time (t1, anywhere
from 0 to 1 second), waits for the signal to arrive, and compares when
the time SHOULD have arrived (by adding t0 and t1) to when they DID
arrive (tf).
This test works great with the normal linux kernel under low-load
circumstances.  There is accuracy sufficient for what I'm doing (a music
program, so accuracy counts).  However, whenever there is disk I/O, or
program loading, or anything interrupt driven (IDE disk I/O is interrupt
driven, right?  Now I might just be talking out of my arse... this gets
into details which I don't understand yet)... there are SIGNIFICANT
delays.  I am under the impression that the rtlinux project offers a
solution to this problem.
Right now all I want to do is translate my program into the appropriate
rtlinux calls.  However, I haven't found the equivalent of setitimer()
in the man pages.  Is there one, or is there an entirely different
mechanism for all this?  And is there some tutorial where I can learn
about all this?

Many thanks in advance,
-Kiran Garimella
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




RE: [rtl] RTL: Lost 2 Jiffies ---

2000-12-06 Thread Estabridis, Janet P

 ANYBOBY OUT THERE ???

-Original Message-
From: Estabridis, Janet P
To: 'RT Linux Group'
Sent: 12/5/00 4:51 PM
Subject: [rtl] RTL: Lost 2 Jiffies---

Hi,

I am running RTLV2.3Kernel 2.2.14  

I've had some code that has run with no problem before but today I got
this
error ---

"RTL:  Lost 2 Jiffies"

What the heck does that mean?  THe message is continuous, but I can
"rmmod"
my module

I have recently updated my code from RTLV0.9J to the new RTL,
Thanks --


Janet Estabridis
Electrical Engineer
NAWC Code 472E40D
Building 31440 Room 1017
China Lake, CA 93555
[EMAIL PROTECTED]
(760) 939-2896  FAX (760) 939 -3075

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] RTL: Lost 2 Jiffies ---

2000-12-06 Thread Cort Dougan

It looks as though a task over-ran the Linux clock and ended up stealing a
couple timer ticks from Linux.  Can you give a bit more detail of what the
system was doing, what tasks you were running and any other info that might
be useful?

}  ANYBOBY OUT THERE ???
} 
} -Original Message-
} From: Estabridis, Janet P
} To: 'RT Linux Group'
} Sent: 12/5/00 4:51 PM
} Subject: [rtl] RTL: Lost 2 Jiffies---
} 
} Hi,
} 
} I am running RTLV2.3Kernel 2.2.14  
} 
} I've had some code that has run with no problem before but today I got
} this
} error ---
} 
} "RTL:  Lost 2 Jiffies"
} 
} What the heck does that mean?  THe message is continuous, but I can
} "rmmod"
} my module
} 
} I have recently updated my code from RTLV0.9J to the new RTL,
} Thanks --
} 
} 
} Janet Estabridis
} Electrical Engineer
} NAWC Code 472E40D
} Building 31440 Room 1017
} China Lake, CA 93555
} [EMAIL PROTECTED]
} (760) 939-2896  FAX (760) 939 -3075
} 
} -- [rtl] ---
} To unsubscribe:
} echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
} echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
} ---
} For more information on Real-Time Linux see:
} http://www.rtlinux.org/rtlinux/
} -- [rtl] ---
} To unsubscribe:
} echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
} echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
} ---
} For more information on Real-Time Linux see:
} http://www.rtlinux.org/rtlinux/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl Your_email" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/