Re: [rtl] using vsnprintf in rtl

2000-04-05 Thread Kulwinder Atwal

Place a printk before and after the function to isolate the cause.  Then
you will know.

- Kal.

Klaus Keppler wrote:
> 
> Has anyone successfully used vsnprintf() and/or snprintf() without any
> problems inside rtlinux tasks ?
> My rtlinux-box crashes somtimes, so it would be great to know that the
> usage of vsnprintf() is NOT the reason for my problem.
> thanks in advance
> klaus
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Parallel port problem

2000-04-02 Thread Kulwinder Atwal



Stuart Hughes wrote:

> Another stragegy, and much simpler is simply to turn swap off with the
> command swapoff -a. To disable networking, use the command ifdown eth0.
> 

If you want X then, like Stuart said it is too big for a floppy.  Try
downloading the rtlinux V3 and install it on your 2.2.14 kernel, and
follow Stuart's above suggestions:

If you are still experiencing a non-constant time interval, after you 
disable interrupts you may want to wait in a delay loop while you wait
for some device to finish using the bus.  This delay for your system
setup if it exists will be in the range of 1-3 uSec.

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




Re: [Fwd: [rtl] Parallel port problem]

2000-04-02 Thread Kulwinder Atwal

Bart Vandewoestyne wrote:
> 
> 
> which is ok for the moment, but let's say that the bin on pin 11 gets
> low and i get 0XX then normally i should leave the while loop, but
> it is not sure if that will happen, because one of the X's could be
> non-zero and that means i will stay in the while loop.

If you are planning to connect other pins then this maybe better:

 void count(int time)
 {
   int value = 0;
   while (value < time) {
 while (inb(BASEPORT+1) & 0x80);
 while (inb(BASEPORT+1) | 0x7F)) ;
 value++;
   }
 }
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Parallel port problem

2000-04-02 Thread Kulwinder Atwal

Use miniRTlinux from: www.fsmlabs.com.

Disable interrupts before and after the counting.

Since miniRTlinux runs from a RAM disk and has networking disabled as a
default, it is the only version of real time linux that can achieve
these high data rates.  

Turning interrupts off for this length of time may cause the real time
clock to be off by this amount of time.  If you kept track of how much
time you count for (value/109kHz) and add this value to the clock after
you finish counting, then this clock drift can be corrected by your
software.

- Kal.

Bart Vandewoestyne wrote:
> So, I would like to know if Real Time Linux is the easiest solution for
> my problem.  I don't want to make things too complicated anymore, i just
> want this thing going in linux so i can integrate it in my GTK+ GUI.
> 
> Any further suggestions on the best/shortes/easiest solutions are
> welcome.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Parallel port problem

2000-04-01 Thread Kulwinder Atwal

Also, this may be simpler/faster:

void count(int time)
  {
int value = 0;
while (value < time) {
  while (inb(BASEPORT+1) & 0x80)); 
  while (inb(BASEPORT+1) ^ 0x80));
  value++;
}
  }

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




Re: [rtl] Parallel port problem

2000-04-01 Thread Kulwinder Atwal

Try downloading miniRTLinux from: www.fsmlabs.com.

It runs Linux from a series of ram disks instead of the hard disk.  This
means that no jitter will be introduced into your measurements from the
hard disk.  By default the networking is disabled so the network card in
your machine will not introduce any additional jitter.

Read the documentation.

Installing it on a floppy involves the following steps:

download it
move to floppy using 'dd' as stated in the documentation
boot from the floppy

Read the documentation on how to put your own code on the same floppy.

- Kal.

Bart Vandewoestyne wrote:
> 
> I have built a PCB to read the value of an analog voltage by using the
> parallel port.  The circuitry uses a Dual Slope A/D conversion.  In
> order to make that conversion, I have to count how long a certain
> time-interval is.  Therefore I generate a square wave of 109 kHz and try
> to count that with the parallel port, this is what I do:
> 
> --> I set one bit of the parallel port, say A, high (for visualisation
> on an oscilloscope)
> 
> --> then I need to count 1 pulses, i do it with the following
> C-routine:
> 
> void count(int time)
> {
>   int value = 0;
>   int clock
> 
>   while (value < time) {
> do
>   {
>clock = inb(BASEPORT+1) & 0x80;
>   }
> while (clock == 0);
> 
> do
>   {
>clock = inb(BASEPORT+1) & 0x80;
>   }
> while (clock == 0x80);
> 
> waarde++;
>   }
> }
> 
> --> Then I set the bit A back to zero.
> 
> So, that means that every time i call the function count(1) I should
> always see the same HIGH-time for bit A, and that's not what happening!
> The HIGH-time for A isn't a constant.  I have also written a similar
> program for the DOS environment and there it works just fine.  My
> question is: how should I solve this problem in order to have the same
> HIGH-time every time i invoke the count(1) function?  How can i make
> my analog voltage measurements more reliable?  Is real time linux the
> solution or do there exist shorter and easier ways?
> 
> I would like to mention that I'm a student and Real Time Linux is
> totally new for me, so if there are easier ways to achieve my goal then
> i would like to know.  If Real Time Linux is the only solution for my
> problem then please explain me how I should change my program or how i
> should set things up.
> 
> Thanks a lot!
> Bart Vandewoestyne, engineer electronics student.
> 
> --
> Bart Vandewoestyne  http://hello.to/MC303
> Hugo Verrieststraat 48  [EMAIL PROTECTED]
> 8550 ZWEVEGEM   ICQ# 21275340
> BELGIUM - EUROPEnick: MC303
> Phone: +32(0)56/75.48.11
> -
> "Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das
> nennen sie ihren Standpunkt."
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Segment/Offset - Typo

2000-03-30 Thread Kulwinder Atwal

A correction.  Should be shifting 12 bits not 16.

Kulwinder Atwal wrote:
> segment = (cpu_address & 0x - DPM_OFFSET) << 16;

Correct: segment = (cpu_address & 0x - DPM_OFFSET) << 12;

> device_address = cpu_address & 0x + segment;
> 
> segment = device_address >> 16 + DPM_OFFSET;

Correct: segment = device_address >> 12 + DPM_OFFSET;

> cpu_address = device_address & 0x + segment;

 - Kal.

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




Re: [rtl] Segment/Offset - pointer conversion for accessing an ISA board

2000-03-30 Thread Kulwinder Atwal

"Dresner, Norman A." wrote:
> 
> Let me try to clarify the situation a little.
> to use the segment that the 80188 sees that data at.  In this
> example we need to take 0x000D3478 and transform it into 0x1000:3478.

#define DPM_OFFSET 0xC000

register int segment,cpu_address,device_address;

segment = (cpu_address & 0x - DPM_OFFSET) << 16;
device_address = cpu_address & 0x + segment;

segment = device_address >> 16 + DPM_OFFSET;
cpu_address = device_address & 0x + segment;

Although this looks complicated in C it gets translated into some really
fast asm.  It uses some of the fastest asm instructions: 

shift,
bitwise-and ( bit masking),
add,
subtract.

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




Re: [rtl] Segment/Offset - pointer conversion for accessing an ISA board

2000-03-30 Thread Kulwinder Atwal

ioremap is only needed on the linux side for portability with non x86
PCs for PCI devices not in 640k-1MB (Linux kernel I/O space).  It causes
Linux to create a table of memory offsets and regions (a map) for
translating between the two.  ioremap will ignore attempts to remap
lower PCI/ISA space (640k-1MB) by returning the virtual address when
given the physical address.

On the RTL side find out the physical address and in x86 use
inb/inw/outb/outw directly for low level single memory accesses.  To do
large transfers setup a DMA channel by using linux/kernel/dma.c.  dma.c
is only four pages long so the porting effort to RTL should be minimal. 

- Kal.

Tomasz Motylewski wrote:
> 
> Depending on the version of the kernel ioremap function may be involved as
> well (question to all: is ioremap required/allowed for low ISA memory
> mapped?).
> 
> --
> Tomek
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Segment/Offset - pointer conversion for accessing an ISA board

2000-03-29 Thread Kulwinder Atwal

Kulwinder Atwal wrote:
> 
> To translate DPM memory is a straight forward procedure:
> 
> #define DPM_OFFSET 0xC000

Change this to:

#define DPM_OFFSET 0xC000

and you can use the 32 bit flat memory model like RTL and not worry
about segments and offsets in 4 GB space. 

- Kal.

> 
> #define DPM_TO_CPU (addr) (addr += DPM_OFFSET)
> 
> #define CPU_TO_DPM (addr) (addr -= DPM_OFFSET)
> 
> - Kal.
> 
> Norm Dresner wrote:
> >
> > Back in MS-DOS days, we had functions provided with the compiler to do the
> > conversions between a pointer and a segment:offset description of an address:
> > void*MK_FP( ushort seg , ushort off );
> > unsigned short  FP_SEG( void *pointer );
> > unsigned short  FP_OFF( void *pointer );
> >
> > I have the need to do computation like this when accessing an ISA board
> > (1st 1M of memory) and when translating the addresses from the dual-ported
> > RAM from what's seen by the CPU on the board to what's seen by the PC (On
> > the board, the DPM looks like it starts at  0x1000:0 while on the PC it's
> > at 0xD000:0).
> >
> > Obviously I could roll my own replacements but before I start doing that I
> > was wondering if it had already been done -- and probably more elegantly
> > (and even more correctly) than I could do (at least the first time I do it).
> >
> > Thanks
> > Norm
> >
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > echo "unsubscribe rtl " | 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 " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Segment/Offset - pointer conversion for accessing an ISA board

2000-03-29 Thread Kulwinder Atwal

The segment and offset are stored in two separate registers in the CPU. 
Therefore, to move the contents of the two registers to memory to store
them as a single full pointer ('far pointer') can be done with a single
asm instruction, but depending on the memory bus word size, two or more
memory accesses.  They can also be accessed (moved) independently of
each other in memory, or the CPU.  These C functions provide a way in C
to re-unite the two parts into contiguous memory or register space so
that the single asm instructions that use both of them can still work. 
Conversely, these functions provide a way to move the two parts
separately in a C friendly way if needed.

To translate DPM memory is a straight forward procedure:

#define DPM_OFFSET 0xC000 

#define DPM_TO_CPU (addr) (addr += DPM_OFFSET)

#define CPU_TO_DPM (addr) (addr -= DPM_OFFSET)  

- Kal.

Norm Dresner wrote:
> 
> Back in MS-DOS days, we had functions provided with the compiler to do the
> conversions between a pointer and a segment:offset description of an address:
> void*MK_FP( ushort seg , ushort off );
> unsigned short  FP_SEG( void *pointer );
> unsigned short  FP_OFF( void *pointer );
> 
> I have the need to do computation like this when accessing an ISA board
> (1st 1M of memory) and when translating the addresses from the dual-ported
> RAM from what's seen by the CPU on the board to what's seen by the PC (On
> the board, the DPM looks like it starts at  0x1000:0 while on the PC it's
> at 0xD000:0).
> 
> Obviously I could roll my own replacements but before I start doing that I
> was wondering if it had already been done -- and probably more elegantly
> (and even more correctly) than I could do (at least the first time I do it).
> 
> Thanks
> Norm
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] the performance of linux run on MPC860

2000-03-29 Thread Kulwinder Atwal

Does not a lower time mean it runs faster?
It sounds like linux is running faster than pSOS and VxWorks.

Maybe I am mistaken by your test, but it sounds like Linux is faster.

- Kal.

shaolin zhang wrote:
> 
>Part 1.1Type: Plain Text (text/plain)
>Encoding: base64
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] booting from eprom/flash

2000-03-29 Thread Kulwinder Atwal

The ide module in 2.2.14 and thus mini-rtl supports flash cards.  To ide
they are just another type of ide drive.  If you want to use flash cards
then it is a no-brainer.  

Just mount it and use it like any other drive.  The ide-probe.c code in
the ide module will set it up correctly.  Look in ide.c for a list of
compatible flash cards.

For eprom check out the article on the Linux Journal site "Booting Linux
from Eprom".  Complete source files are located on the on the site. 
Just do a search for the keywords in the title.

- Kal.

Rich Bryant wrote:
> 
> I am currently working on an embedded systems project in which I want to
> put minirtl on an eprom/flash device and boot directly too it rather than a
> disk drive or network connection.
> 
> If anyone has any information on targeting the kernel to an eprom/flash
> I would appriciate a few hints.  :)
> 
> Tips on creating a bare minimum kernel would also be helpful.  I don't need
> disk support, graphics, mouse, or anything like that since it is not
> intended to be a true PC, but rather a small 486 system connected to a
> tty terminal.  I can give more specifics if needed.
> 
> Thanks in advance,
> 
> Rich
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Trying RTN Ethernet Driver

2000-03-28 Thread Kulwinder Atwal



[EMAIL PROTECTED] wrote:
> 
> Hello :
> Anyone could successfully run applications that are part of
> RTN Ethernet package (written by Alex Bernal) ?
> You can obtain the package from the RT Linux web site.
> My questions are :
> 1. Do I need to "ifup" the network interface that is my tulip
> driver on both hosts?
> (my guess would be __no__, but I am still willing to ask)

You need a fully functional RT tulip driver on every machine you wish to
communicate with.

> 2. Now, some of the user applications have names:
>  rtt_tx_app (sender)  and  rtt_rcv_app (receiver)
> rtt_tx_rvc (sender) and rtt_tcv_tx (receiver)
> Do I envoke on one end, and other on the other end ? I have
> 2 workstations running RT 2.2.13-RTL2.0 . The workstations are
> connected to each other via a hub

These are examples on how to write your own code to use the RT tulip
driver.  If each host is to transmit and receive then you will need to
write code similar to what appears in these examples.  If you want to
send and receive files then the functions RTN_snd_file and RTN_rcv_file 
in rtt_tx_rvc can be used in your app.  

All the functions you need are in rtt_tx_rvc.c.  Remember to #include
.  If you just want to send and receive buffers, then just
remove the file stuff.  Use the 'ioctl' function to change the address
and send/receive an acknowledgment message to make sure that you have
the right address before sending/receiving data.

And that's it.

> 3. Now, I had to add some lines to the Makefile to compile
> the packages
> rtt_rndtrip_rcv_tx
> and rtt_rndtrip_tx_rcv

This is just an example of how to use the RT tulip driver.  You don't
need to put this in your makefile.  

> 4. daddr[6] is a hardware address of the card. It is unclear
> if it is a sender/receiver address since there is no documentation
> that indicates that

A single ethernet address is normally used to send and receive.  The
daddr[6] is the address of the other machine you are currently
communicating with.

> 5. File rtt_rndtrip_tx_rcv does not compile since there
> is some code missing at the end (file got truncated)

You don't need it.

A lot of things in these examples are 'hard coded' like the daddr[6]. 
Just use the functions in the file rtt_rcv_tx.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] Failed in atoi & sprintf

2000-03-28 Thread Kulwinder Atwal

Huang Qiang wrote:
> 
> I am using RTL 2.2 now .
> I need atoi and sprintf function in my RT task, but failed.
> 
> I test it by insert some code into RTL2.2 example frank .
> 
>  1. include the stdlib.h
>  2. insert follow lines into thread_code
> 
>  /*==*/
>  char test_sprintf[16];
>  int  test_atoi;
> 
>  sprintf(test_sprintf, "%d", fifo);
>  rtl_printf("test_sprintf is %s\n", test_sprintf);
> 

Instead of:

>  test_atoi = (int)atoi(test_sprintf);

Try:

  test_atoi = atoi(test_sprintf);

Casting to int is not neccessary. 'atoi' means "Ascii TO Integer". 
Therefore, its reason for existing is to get an ASCII string and
returning an int.  Casting an int to an int is redundant.

- Cheers, Kal.

>  rtl_printf("test_atoi =%d\n", test_atoi);
>  /*==*/
> 
>  3. do make then insmod frank_module.o , but failed in
> 
>  frank_module.o: unresolved symbol __strtol_internal
> 
>  4.  so I did  "ld -r -o mod.o frank_module.o -L/usr/lib -lc"
>  then insmod mod.o , but failed , too .
> 
> What's wrong , can someone point me.
> 
> Thanks
> 
> 
> -- [EMAIL PROTECTED]
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] rtl_printf problem

2000-03-24 Thread Kulwinder Atwal


cd to the top of the Linux source code directory
grep -r 'sscanf*{' * | more

'man grep' is your friend.

- Kal.

"Herbel, Rick" wrote:
> 
> Sorry if this is a repeat but does any one remember the library to link in
> to use sscanf in a realtime app -l?
> 
> Thaanks,
> 
> Rick
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] virtual memory in RTL

2000-03-23 Thread Kulwinder Atwal



David Olofson wrote:
> 
> Wed, 22 Mar 2000 [EMAIL PROTECTED] wrote:
> > (BTW: from the Linux man page:
> > As SCHED_FIFO and SCHED_RR processes can preempt
> >other processes forever, only root processes are allowed to activate these
> >policies under Linux.
> > )
> 
> Yep, you have to have *some* kind of adrenaline rush left with protected memory
> and all! ;-) If you want to be completely safe, you could always throw in a
> watchdog thread or something...

The watchdog thread would be preempted as well.  If Linux does
SCHED_FIFO and SCHED_RR by turning off interrupts, then even setting a
timer interrupt will not work.  The only option may be to have a
hardware COP watchdog card in the PC.

 I was thinking Magic SysRq key to kill the
> current (SCHED_FIFO or SCHED_RR) thread as another alternative, but I might be
> missing something that already exists.
> 
> And as for the root privileges requirement, it has been discussed adding a
> "real time" user group capability instead. (I'm not up to date with this,
> though.) Running RT apps as root just for the scheduling is not all that nice in
> production systems, especially not if they are going to run user installed
> third-party plugins in those threads...

Only your scheduler has to be root.  Your scheduler is responsible for
changing the policy for a process.  Only that process will have its
policy changed.  Any processes that your scheduler controls can be in
user space.

Read the man page for sched_setscheduler.

- Kal.

> 
> Regards,
> 
> //David
> 
>  P r o f e s s i o n a l   L i n u x   A u d i o
> · ··-·· ·
>  MuCoS - http://www.linuxdj.com/mucos
>  Audiality - http://www.angelfire.com/or/audiality
>  David Olofson - [EMAIL PROTECTED]
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] bugs???

2000-03-22 Thread Kulwinder Atwal

Ed Martini wrote:
> 
> Sorry if the crosspost is wrong.  Please gently tell me which group would be proper
> for this type of inquiry.
> 
> I have ported a large (350k footprint) embedded system from vxworks to rtlinux.
> I'm using 2.2.12 and rtlinux 2.2.  It is a PCI driver application.
> 
> It typically has 6-10 threads running which communicate via the semaphores
> package semaphores and message queues.  While it it mostly working, there are
> several problems on the user side that happen when my system is running.
> 
> 1.  Linux' concept of time is broken.  When my app is running, time stands still.
> date returns the same date/time.  It resumes when I unload my module.  I have seen
> the screensaver activate immediately.  The keyboard bell will turn on for "a long 
>time".
> 
> 2.  Keystrokes in vi seem to be buffered for "a long time".

In my expert opinion it looks like your computer is experiencing the
effects of relativistic time while approaching the event horizon of a
black hole.  I suggest you take a step back, if the problem worsens,
then I suggest you run before you get sucked in too! :)

Another, although much less likely, cause could be that you are turning 
interrupts off for too long.  The common factor in the real time clock,
screensaver timer, keyboard buffer, speaker/bell (system timer 3), and X
is interrupts.

Does the screensaver activate immediately after you unload the module,
or after time starts to stand still?

How long do you turn off interrupts at any one time?
How long does your longest RTL interval run for?
How many different length RTL intervals do you have?
Do you use any of the system timers directly?

And last, but not least what does your RTL code do?

- Kal.

> 
> 3.  Programs under X cause X to hang.  The two I have tried are gimp and mahjongg.
> ctl-alt-bkspc kills X ok.
> 
> Any help would be greatly appreciated.
> 
> Ed Martini
> 
> MailCity. Secure Email Anywhere, Anytime!
> http://www.mailcity.lycos.com
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] High Frequency Interrupts Lock Computer.

2000-03-18 Thread Kulwinder Atwal

At what high frequency do you start to notice the problem?

- Kal.

Richard Hasty wrote:
> 
> I just started playing with RTL v2.2 and ran into a problem I don't
> understand.  I was using the parallel port IRQ and it appears that a high
> interrupt rate causes the computer to lock up, even after the interrupts
> cease.  I don't actually need high interrupt rates, they occurred
> accidentally because of the poorly designed sensor.  All I'm doing in the
> interrupt service routine is writing to the parallel port, incrementing a
> counter, printing the counter using rtl_printf, and re-enabling the IRQ. I
> solved the problem by re-enabling the IRQ in another process a short time
> later.
> 
> Should I always limit the interrupt rate artificially like this?  Why
> does this problem occur?
> 
> Thanks,
> Richard Hasty
> [EMAIL PROTECTED]
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/



Re: [rtl] generate squares

2000-03-15 Thread Kulwinder Atwal



Paolo Mantegazza wrote:
> 
> Hi Kulwinder,
> 
> What about disk IO? I suspect that testing while you run something of
> the type: while "true"; do ls -aR /; done, as I often do is going to
> send you jitter up whatever ethercard you are using.

John Storrs actually tried something similar.  He did a loop where he
pinged some location over his ethernet card while running the tests. 
These results include this heavy ethernet load.  

Also, the IDE disk interface is located on the South PCI Bus Bridge. 
Therefore, the disk must make its transfers over the PCI bus just like
the ethernet card.  The disk then, is treated just like any other PCI
device.  In the South Bridge the IDE interface has its own set of
standard PCI configuration registers, as well as IDE specific
registers.  Therefore, the access time of the IDE is also limited by its
own PCI Master Latency Timer Register value, and its master/slave bit
setting.  Further, an access in progress can be detected in the IDE
specific registers to allow one to find a safe time to change a disk
from being a master to being a slave device.
 
> I always refered to jitter with the PC being used by combining real time
> and normal use. When we want to avoid jitter we just setup a single user
> mode and kill all the non needed deamons, getting to an operating
> condition close to the old DOS, and the jitter is far lower. But that is
> just for the more demanding conditions.

I think it is important to consider what kind of setup more demanding
applications may need.  Because, people interested in fast hard real
time are also usually willing to use dedicated machines that are
optimally configured, maybe even as embedded systems.

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



Re: [rtl] generate squares

2000-03-15 Thread Kulwinder Atwal

Paolo Mantegazza wrote:
> 
> Hi,
> 
> > > I never cared of tracking the source, but just checked with the machine
> > > configured the way I needed for my control experiments, generally a
> > > single ADC/DAC+DIO board, either ISA or PCI. Never mixed the twos.
> >
> > Did you configure the PCI board as a master or slave?
> 
> It was muster, If I remember well.
> 
> > What is the manufacturer, make, and model number of the PCI ADC/DAC+DI0?
> 
> There were two: Bluechip Technologu and National Instruments.
> 
> > Did you have any other types PCI/ISA boards plugged into the PC at the
> > same time like maybe a network board?
> 
> I think there was an ISA NE2000 compatible ethernet card. As I told you
> it was sometime ago and I worked with the installation as it was. The PC
> was used by different people and it was unpractical to plug in and out
> at any particular moment.

I think this configuration shows why you were getting such low useable
rates.  John Storrs has done some jitter testing with an ISA NE2000.  He
first ran his tests with the card running under Linux while taking five
samples in RTL with his PLD-based fast data acquisition board.  He
consistently recorded a 17 uSec jitter resulting in about a 60 kHZ
period (1/17 uS = 60 kHZ).  He then re-ran the tests with a PCI ethernet
card and recorded a 3 uSec jitter resulting in about in about a 333 kHZ
period.

If you are getting reliable rates at 30 kHZ then by considering aliasing
effects this correlates strongly with John Storrs jitter period of 60
kHz for a ISA NE2000 device.

>From this data we can say that by just switching from ISA devices to PCI
devices, in general, one should expect to see a five times improvement
in useable hard real time data rates.

Further, since Linux can start a bus access just prior to the start of
an RTL interval.  The response from the device can occur during an RTL
interval.  The simple work-around for this problem is to wait at least
the time setting configured in the Master Latency Timer Register of each
device queued in the PCI North Bridge plus bus access and arbitration
delays.  This waiting must be done by successive reading of a
clock/timer value within an RTL interval, and not by using a function
like pthread_make_periodic_np.

The Master Latency Timer setting for each device may also be reduced.

Then there are PCI devices configured as bus masters.  By setting the
device as a slave at the beginning of the RTL interval and returning it
to a master at the end of the RTL interval this problem can be fixed.

This leaves PCI devices that may have been permanently configured as
masters by the manufacturer.  These devices require an RTL driver that
is capable of routing data between Linux and RTL while minimizing the
impact on high data rates.  The other option is not to use such devices
during times that they may interfere with RTL data rates.

If it possible to run some new tests using these suggestions I would be
very interested in the results.

- Kal.

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



Re: [rtl] generate squares

2000-03-13 Thread Kulwinder Atwal

Paolo Mantegazza wrote:
> 
> I gave up the illusion of rates in that range long time ago. It is not a
> matter of aliasing (3 times the sampling rate). You cannot obtain a
> steady 120 Khz rate on PC motherboards, AS THEY ARE NOW.
> 

What sources of jitter did you identify?

Did you try with a PCI bus machine with no ISA cards plugged in?

What sources of jitter did you identify on the PCI card only machine?

With no PCI cards plugged in?

What sources of jitter did you identify on the PCI only machine?

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



Re: [rtl] generate squares

2000-03-13 Thread Kulwinder Atwal

Paolo Mantegazza wrote:
> 
> Hi,
> 
> > I want to generate squares from parallel in the highest frequency and
> > stable needed. pthread_create() and pthread_make_periodic_np() only give me
> > the stable square wave about 30k HZ. I need 120k HZ or more.
> 
> Forget about that. On whatever PC, with whatever real time OS, you'll
> have jitters greater than the period you want.

He is using it for a stepper motor where jitter is less important than 
pulse speed.

> So while you can use that
> rate without jamming your machine the square wave seen on a memory scope
> will be just a thick black strip.

What do you mean by 'thick black strip'.  Change the 'time/div' knob to
a  higher setting.  Check your other scope settings.  Use a scope with a
rated frequency that is at least three times the desired sample rate
(for analog scope).  What scope are you using.  At what settings?

> Hands on experience.

What code did you use for this experience?  You need to wait at least 17
uSec in RTL before doing your tests to account for Linux ISA bus
accesses over the PCI bus to stop (a large source of jitter).

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



Re: [rtl] generate squares

2000-03-12 Thread Kulwinder Atwal


Use rtl_hard_disable_irq(0) to disable the rtl timer interrupt.

To get the higher rates polling is required of the 8254 timers.
Some similar sample code is contained in rtl_time.c and the measurements
example (rt_irq_gen.c).

Also, read the datasheet on the intel 82C54, and sections 3.7, 2.5.2
of the intel 82371 datasheet.

Use a counter set to mode 2 (square wave).

Write a define for a 'read-back' command similar to the 'latch' command
(i.e.. LATCH_CNO).  

Write a define for using the Control Word Register to select and setup a
counter (mode 2): SETUP_COUNTER_ZERO.

Write or use defines similar to WRITE_COUNTER_ZERO16 and
WRITE_COUNTER_ZERO8 to write to the upper and lower byte of the counter.

Do an inline function something like below with pulse_count, and
pulse_state as variables of type 'register'.

#define OUT_STATE 0x80 /* bit 7 is the output pin status bit */

register short int pulse1_count;
register char pulse1_state;
register short int pulse2_count;
register char pulse2_state;

SETUP_COUNTER_ZERO;
WRITE_COUNTER_ZERO8;
WRITE_COUNTER_ZERO16;

I haven't compilied it or checked it for typos, but this is the basic
idea for two motors:

/* set pulse_count1 and pulse_count2 equal to how many steps each motor
should step. */

while (pulse_count1 || pulse_count2){

oldpulse1_state = pulse1_state;
oldpulse2_state = pulse2_state;

READ_BACK_CNT0;
READ_CNT0(pulse1_state);
pulse1_state ^= OUT_STATE;
if ((pulse1_state != oldpulse1_state) && pulse_count1)
pulse_count1--;
READ_BACK_CNT1;
READ_CNT1(pulse2_state);
pulse2_state ^= OUT_STATE;

if ((pulse2_state != oldpulse2_state) && pulse_count2)
pulse_count2--;
pulse2_state = pulse2_state << 1;
motor_output = pulse2_state + pulse1_state;
outb(motor_output,LPT_PORT);

LATCH_CNT0;
READ_CNT0(pulse_count1);
LATCH_CNT1;
READ_CNT1(pulse_count2);
}


- Kal.


dding wrote:
> 
> -Original Message-
> From: Kulwinder Atwal <[EMAIL PROTECTED]>
> To: dding <[EMAIL PROTECTED]>
> Date: 2000Äê3ÔÂ13ÈÕ 10:00
> Subject: Re: [rtl] generate squares
> 
> >You will able to use RTlinux with no extra hardware for motor control.
> >
> >Does each motor require 120 kHZ stepping speed at the same time?
> Yes ! a motor control the x direction the other control the z direction,then
> the knife can
> move along any trace! when the motor require 120Khz the knife (on machine
> tool) only move but do nothing!
> 
> >
> >Does your software also handle some kind of user input and output?
> 
> yes ,but when handling input or output ,the frequency is slow down to
> 30Khz,the RTlinux can
> handle it completely!
> 
> >How does it find out when and for how long to step the motors?
> >
> Maybe no need ,I can get data first and then call the subroutine to do the
> busy-task !
> 
> >- Kal.
> >
> >dding wrote:
> >>
> >> -Original Message-
> >> From: Kulwinder Atwal <[EMAIL PROTECTED]>
> >> To: dding <[EMAIL PROTECTED]>
> >> Date: 2000Äê3ÔÂ13ÈÕ 8:08
> >> Subject: Re: [rtl] generate squares
> >>
> >> >how many stepper motors?
> >> Two!
> >> >is there any other device's involved? sensors?
> >> Now no sensors! perhaps future...
> >> >sorry, i have forgotten what is your application?
> >>
> >> Oh ,I only want to generate squares in the highest frequency to test the
> >> RTLinux, if the realtime ability of RTLinux is enough we should use
> RTLinux
> >> as the control system platform to machine tool!
> >> >What are you using the motor for?
> >> >
> >> >- kal.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] generate squares (corrected)

2000-03-12 Thread Kulwinder Atwal

A correction:

Kulwinder Atwal wrote:
> 
> while (pulse_count1 || pulse_count2){
> 
> oldpulse1_state = pulse1_state;
> oldpulse2_state = pulse2_state;
> 
> READ_BACK_CNT0;
> READ_CNT0(pulse1_state);
> pulse1_state ^= OUT_STATE;
> if ((pulse1_state != oldpulse1_state) && pulse_count1)
> pulse_count1--;
> READ_BACK_CNT1;
> READ_CNT1(pulse2_state);
> pulse2_state ^= OUT_STATE;
> 
> if ((pulse2_state != oldpulse2_state) && pulse_count2)
> pulse_count2--;
> pulse2_state = pulse2_state << 1;
> motor_output = pulse2_state + pulse1_state;
> outb(motor_output,LPT_PORT);
[snip]
> }
> 
> - Kal.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[Fwd: Re: [rtl] generate squares]

2000-03-11 Thread Kulwinder Atwal


There are many types of hardware peripherals that can be used to
generate a 120 kHZ clock signal depending upon your application.

What do you need a 120 kHZ clock signal for?  

- Kal.

dding wrote:
> 
> I want to generate squares from parallel in the highest frequency and
> stable needed. pthread_create() and pthread_make_periodic_np() only give me
> the stable square wave about 30k HZ . I need 120k HZ or more.
> 
> I think I can use rtl_request_irq() to register a timer handler and use
> rtl_hard_enable_irq() to enable it! but I don't know how to do it in detail
> ! Who can help me ? Thanks a lot!
> 
> dding
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] (off topic) CAN interface

2000-03-08 Thread Kulwinder Atwal

Try the CANaerospace driver to start:

http://www.mstock.com/can.htm

The source code is freely available for CANaerospace.  Any CANBus
interface card will work with the CANaerospace driver.

- Kal.

Gordan Sikic wrote:
> 
> Kulwinder Atwal wrote:
> >
> > Are you looking for a CANbus driver, or interface card?
> 
> I need some general info about interfaces between computers and
> hardware.
> At the company I work for, there has been a discusion about relability
> of CAN interface. I am awared of some implementations for flight
> simulators, but I have no data concerning real thing. That is the origin
> of my question.
> 
> I may say that I am interested in CANbus driver and interface card to.
> 
> >
> > Which OS?
> >
> > CANbus driver source also?
> >
> > Are you looking for a CANbus driver that has been approved by the FAA
> > for use on commercial aircraft?
> >
> > What are the special requirements for your application?
> >
> > Are you interfacing with pre-installed equipment?
> 
> At the moment we need some general info, since we are exploring
> posibilities to connect old aircraft cockpit (for instruments driving
> purposes, as well as data aquisition) via CAN bus. We would like to use
> Linux as OS. Another (possible) requirement is that I would like
> interface with hardware to be done as a RT-linux task.
> 
> >
> > - Kal.
> >
> > Gordan Sikic wrote:
> > >
> > > Hello!
> > >
> > > Does anybody know of some implementation of CAN bus on real aircraft?
> > >
> > > Thanks in advance,
> > >
> > > Gordan Sikic
> > > [EMAIL PROTECTED]
> > >
> > > -- [rtl] ---
> > > To unsubscribe:
> > > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > > echo "unsubscribe rtl " | 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 " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] substitute to jiffies

2000-03-06 Thread Kulwinder Atwal



"Wayne E. Van Loon Sr." wrote:

> In my opinion, a better
> description of the jiffy is that the jiffy is the time of one "time slice"
> for the scheduler.

Yes, I was trying to be brief.  The setting of the constant HZ (number
of jiffies per second) will affect the result.  The most common default
setting for HZ is 100 which translates into 10 milliseconds.  But many
using RTL have set HZ to 1000 to get more responsiveness from Linux.

Also, hrtime is a 64 bit signed value, and a jiffies is a unsigned 32
bit number.

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



Re: [rtl] substitute to jiffies

2000-03-05 Thread Kulwinder Atwal



Alain Rolle wrote:
> 
> Hi again,
> 
> concerning jiffies in rtl, I can indeed see why it is not very usefull
> using them in a RT driver. My question is :
> could I simply use "gethrtime()" wherever "jiffies" ocurred in an
> original linux driver, or should I multiply "gethrtime()" with a certain
> factor.

jiffies = 11931800*gethrtime();

 By the way, can anyone tell me what jiffies really stands for in
> linux ? 

10 millisecond increments.

Or can give me at least a tip for further reading about the
> use and source of it ? 

See: sched.h/sched.c.


>I already tried the Linux Docu Project, but without
> results.
> 
> Thanks again,
> 
> Alain.
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] map a file to rtl space.

2000-03-03 Thread Kulwinder Atwal

#include 

volatile void* linux_address;
unsigned long rtlinux_address = virt_to_phys(linux_address);

Or, back the other way.

unsigned long rtlinux_address;
void* linux_address = phys_to_virtual(rtlinux_address);


- Kal.

Mario Teijeiro Otero wrote:
> 
> Firt of all, I want excuse me for my mail without subject ( I forgot it) of
> 21/02/2000. I asked about the subject of this mail. I do this solution.
> 
> On  linux space:
> [...]
> flength=lseek(fd,0,SEEK_END);
> p=(char*)mbuff_alloc(M_PTR_MC,flength);
> [ if error...]
> pfichero=mmap((caddr_t)p,flength, 
>PROT_READ,MAP_SHARED|MAP_FIXED|MAP_LOCKED,fd,0);
> 
> and on rtlinux space:
> pteroMC=(char*)mbuff_alloc(M_PTR_MC,sizeMC);
> if(pteroMC==NULL){
> []
> 
> Thanks for all.
> --
> Windows 98 no se cuelg·$%&/# NO CARRIER
> 
> =
> Mario Teijeiro Otero   mailto:[EMAIL PROTECTED]
> Powered by RedHat 6.1  clave: Mandame un correo con
> Usr. Reg. 122438,Maq. Reg. 74229   Subject:[PGPKEY]
> =
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] astonished?

2000-03-01 Thread Kulwinder Atwal

[EMAIL PROTECTED] wrote:
> 
> What this error message does mean?

I have looked at the file 'kernel_patch' in RTL.  On line 994 is the
printk for this message: 'RTL is astonished to announce out of fake
regs'

> 
> RTL is astonished to announce out of fake regs
> [blahblahblah]
> ...
> [crash]
> 
> Background info
> A 5 ms periodical task every time called [unintentionally]
> rtl_printf("write_chars() %d"...); on a 100 MHz 486DX4.
> 
> Yes, I can imagine, that this can freeze the host.
> I guess rtl_printf lasted more than 5 msec and scheduler had to
> do something. But what happens in this case exactly?
> I wonder what are the fake regs?
> 

This occurs in the interrupt intercept function in RTL 2.2.  There is an
array of 200 for storing 200 contexts of the CPU.  Each time an
interrupt occurs the context of the CPU (all of its registers) are saved
into one line of this array.  So, if more than 200 Linux or RTL
interrupts happen before any of them are serviced, RTL will run out of
space to store any more registers (fake regs).  

If 200 interrupts are happening before any of them is completely
serviced by your code or Linux, then this is a strong indication that at
least one of your tasks takes longer to complete in your RTL interval
than you have allowed.  This is causing the Linux interrupts to pile up,
because your task is taking all of the CPU time.  So if the host is
freezing as well then this is probably what is happening.

If the Linux interrupts are few and far between, then it may be that
your own code is allowing your own interrupts to pile up, by taking too
long to finish before the next interrupt occurs.

I suppose a more meaningful error message maybe to display the interrupt
source (IRQ number) that is not being serviced fast enough, indicate
whether it is a Linux or RTL handler attached to this interrupt, and the
pid.

- Kal.

> Gabor
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] How to map the memory into the users' memory space

2000-02-28 Thread Kulwinder Atwal

Looking in arch/i386/mm/ioremap.c, it says that the functions prefixed
with 'remap_area' are primarily for remapping a high PCI range to kernel
space.  Where as the ioremap function are for remapping any high memory
area to kernel space.

These functions are to be called once to cause linux to perform a
remapping.

The functions phys_to_virt and virt_to_phys are faster one line
functions defined in include/asm-i386/page.h. and accessible in io.h,
but they do not remap to kernel space so that a Linux program can access
the the memory range.  They just convert one address per function call. 

Looking at the driver, drivers/net/wan/cycx_drv.c, shows an ISA device
using ioremap. 

- Cheers,Kal.

Tomasz Motylewski wrote:
> 
> > > > How can i do this, can i use ioremap/iounmap function in my driver?
> > >
> > > Yes, these are the correct functions to use in your device driver.
> 
> Just looking in arcnet driver shows that phys_to_virt is used like:
> 
> union ArcPacket *arcpacket = (union ArcPacket *) phys_to_virt(dev->mem_start
> + recbuf * 512);
> 
> saddr = arcpacket->hardheader.source;
> 
> dev->mem_start is usually around 0xd. ioremap/iounmap are probably used
> rather for PCI memory (high addresses).
> 
> --
> Tomek
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] How to map the memory into the users' memory space

2000-02-28 Thread Kulwinder Atwal

Kulwinder Atwal wrote:

> [EMAIL PROTECTED] wrote:
>
> > I am working with an dual-ported RAM which is on a motion control card and allows 
>the cardt and its host to share an area of fast
> > memory. my driver(in kenerl mode) should map the memory(i locate this memory in 
>0xd4000 of PC memory) into the user's memory
> > space. So processes in user's space can read this area directly.
> >
> > How can i do this, can i use ioremap/iounmap function in my driver?
>
> Yes, these are the correct functions to use in your device driver.

That is in Linux in your Linux device driver.  You may want to put all of your 
computationally intensive time critical code in RTL
using physical memory (PC memory).  And use fifos to communicate with your less time 
critical Linux code.  Then you don't have to
translate between virtual and physical.  This will allow you to make better use of the 
fast dual-ported RAM.

-  Kal.

>
> - Kal.
>
> >
> >
> > Thanks in advance!
> >
> > Liang jiangang
> >
> > ___
> > ÍƼö£¡EaseBand( http://easeband.163.com )ÈÃÄãÇáËÉÉÏÍø¡£
> >
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > echo "unsubscribe rtl " | 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 " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] How to map the memory into the users' memory space

2000-02-28 Thread Kulwinder Atwal

[EMAIL PROTECTED] wrote:

> I am working with an dual-ported RAM which is on a motion control card and allows 
>the cardt and its host to share an area of fast
> memory. my driver(in kenerl mode) should map the memory(i locate this memory in 
>0xd4000 of PC memory) into the user's memory
> space. So processes in user's space can read this area directly.
>
> How can i do this, can i use ioremap/iounmap function in my driver?

Yes, these are the correct functions to use in your device driver.

- Kal.

>
>
> Thanks in advance!
>
> Liang jiangang
>
> ___
> ÍƼö£¡EaseBand( http://easeband.163.com )ÈÃÄãÇáËÉÉÏÍø¡£
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] Problem loading modules

2000-02-25 Thread Kulwinder Atwal

"Dresner, Norman A." wrote:
> 
> > -Original Message-
> > From: Stuart Hughes [SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 23, 2000 6:39 AM
> > To:   David Schleef
> > Cc:   rtlinux
> > Subject:  Re: [rtl] Problem loading modules
> >
> > David Schleef wrote:
> > >
> > > On Tue, Feb 22, 2000 at 12:51:11PM +, Stuart Hughes wrote:
> > > >
> > > > Note also the following compiler feature:
> > > >
> > > > If have in your RT code:
> > > >
> > > >   char buf[12] = "mystring";
> > > >
> > > > You get an error, due to an implicit call to memset.
> > >
> > > Nope.  gcc-2.7.2.3 outputs assembly instructions that perform
> > > the memcpy, even with very long strings.
> >
> > Hi Dave,
> >
> > That's weird, this is what I get (gcc version 2.7.2.3).  If I compile
> > the code below using:
> >
> > cc -O2 -g -D__KERNEL__ -DMODULE -c -o para_mod.o para.c
> >
> > and then try to insmod para_mod.o, I get the following:
> >
> > ./para_mod.o: unresolved symbol memset
> >
> > If I comment out the first version and uncomment the second, everything
> > works ???
> >
> > Any ideas ??
> >
> [Norm Says:]
> The first form ( char buff[12]="test"; ) creates the string "test"
> somewhere in memory and then when the function init_module is entered, space
> is made on the stack for the buf[] array and the string is copied from the
> string to the array.
> 
> The second form ( char *buff="test";) also creates the string "test"
> in memory -- probably in the same place as the first -- but when the
> function init_module is entered, just the space for a char-pointer is made
> on the stack and the pointer is initialized with the addess of the string;
> no copying is done, just the storing of a "numeric" data item on the stack
> (possibly even a push of immediate data).
> 
> It's all perfectly logical.
> 
> Norm
> 

Not just logical, but the second form is also preferable.  Passing by
reference should be encouraged, whenever possible, instead of passing by
value due to its greater memory and speed efficiency. Also, if you are
going to be hard coding strings, using a 'const' pointer will be safer.

const char *buff = "test";

- Cheers, Kal.


> > Regards, Stuart
> >
> >
> > // System headers.
> > #include 
> > #include 
> >
> > int init_module(void)
> > {
> > char buf[12] = "test";  // fails, calls implicit memset
> > //char *buf = "test";   // Okay
> > printk(buf);
> >
> > return 0;
> > }
> >
> > void cleanup_module(void)
> > {
> > }
> >
> >
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > echo "unsubscribe rtl " | 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 " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] question

2000-02-21 Thread Kulwinder Atwal

If you are willing to consider ultrasonic radar for your application,
you can get a lower priced solution than laser.  A ultrasonic radar can
be purchased for ~ $70 US for first copy and parts list:

http://www.columbia-center.org/fascinating/rad/radar.html

The parts list allows you to build your own copies.

With the lower speed of sound the timing requirements for the short
distances that you are interested are not as tight when using pulsed
wave ranging.  For light pulses to have an accuracy of one centimeter
requires the pulses to be 3.336 x 10^-11 Sec apart (0.01m/3.00 x 10^8
m/s).  Also, a laser is more costly and less energy efficient.

For laser ranging, continuous wave (AM/FM) or triangulation techniques
are required which are more costly to implement, and thus for which a
significant market does not exist.  For laser triangulation a CCD is
required which leads to the removal of the more costly laser for the
short distances you are interested in, and the addition of another low
cost CCD. 

With the commodity pricing of CCDs, a lower cost option is a stereo CCD
camera system where the DSP software tries to position the two cameras
on the same point is space using a very small area of the CCDs.  Each
CCD is rotated by servo.  The servo angles are used to triangulate the
position of the point in space where the CCDs are focused.  This is the
same technique that your eyes use to judge distance.

By combining ultrasonic radar and a stereo CCD system a fool-safe
ranging system should be possible at a reasonable cost.  The ultrasound
can also be used to autofocus the CCDs.

- Cheers, Kal.

Guilherme Nelson F De Souza wrote:
> 
>   Hi,
> 
> Sorry, this question is not related to real-time, but I was
> wondering if anybody out there knows of manufacturers of laser
> range scanners, specially for mobile robots. Any name, URL, etc.
> is highly appreciated.
> 
> Thanks,
> 
>   gnd
> 
> 
> 
>-< G. N. DeSouza >-
>-< [EMAIL PROTECTED]>-
>--< http://rvl1.ecn.purdue.edu/~gnelson >--
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] "Longer" Thread Periods

2000-02-18 Thread Kulwinder Atwal

I misread types.h and the gcc index.  You are correct.

 long = int

- Kal.

Guilherme Nelson F De Souza wrote:
> 
>WHere did you get this from?  ;-)
> 
>char = 8bits = 1byte
>short = 16bits = 2bytes
>int = 32bits = 4bytes
>long = 32bits = 4bytes
>long long = 64bits = 8bytes
> 
>If you don't trust me, run this:
> 
> int main(void)  {
> 
>   printf ("Size: %d\n", sizeof(char));
>   printf ("Size: %d\n", sizeof(short));
>   printf ("Size: %d\n", sizeof(int));
>   printf ("Size: %d\n", sizeof(long));
>   printf ("Size: %d\n", sizeof(long long)); }
> 
> Size: 1
> Size: 2
> Size: 4
> Size: 4
> Size: 8
> 
> >Date: Fri, 18 Feb 2000 06:05:23 -0700
> >From: Kulwinder Atwal <[EMAIL PROTECTED]>
> >Subject: Re: [rtl] "Longer" Thread Periods
> >
> >For Linux on a 32-bit machine (Pentium):
> >
> >short = 8 bits
> >int = 16 bits
> >long = 32 bits = one word
> >long long = 64 bits = two words
> >
> >As you can see it turns out to be a very 'long long' time.
> >
> >- Kal.
> >
> >
> 
>-< G. N. DeSouza >-
>-< [EMAIL PROTECTED]>-
>--< http://rvl1.ecn.purdue.edu/~gnelson >--
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] "Longer" Thread Periods

2000-02-18 Thread Kulwinder Atwal

For Linux on a 32-bit machine (Pentium):

short = 8 bits
int = 16 bits
long = 32 bits = one word
long long = 64 bits = two words

As you can see it turns out to be a very 'long long' time.

- Kal.


Kenneth Jacker wrote:

> typedef long long hrtime_t
> 
> "Long long"?  How many bits is that on a Pentium?  It appears to be
> "only" 32 which would make the longest period ~4.3 secs = 2^32/10^9
> (or since "long long" is signed, maybe ~2.2 sec = 2^31/10^9).  So, a
> work-around would be necessary.
> 
> If I wanted a period of, say, ~8.6 sec, I could schedule a thread with
> period 2^32 (assuming the bits are treated as unsigned).  After the
> second execution of this "timer thread", I could set a "flag"
> indicating the end of the ~8.6 sec period. (BTW, I am interested in
> much, much smaller periods: 15 - 25 usecs.  However, in future apps I
> might need longer intervals).
> 
> That's why I though we might use the (now deprecated) "pthread_setperiod_np"
> function since its period is specified (in the "GettingStarted.txt"
> document) via a "itimerspec" structure (which allows longer "timespec"
> intervals).
> 
> I'm happy either way ... but was wondering what other's might think
> about the issue of "longer" periods and whether, in fact,
> pthread_setperiod_np might be of use in certain situations.
> 
> --
> Prof Kenneth H Jacker   [EMAIL PROTECTED]
> Computer Science Dept   www.cs.appstate.edu/~khj
> Appalachian State Univ
> Boone, NC  28608  USA
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] Problem loading modules

2000-02-18 Thread Kulwinder Atwal

Paul Koning wrote:
> 
> > "Dresner," == Dresner, Norman A <[EMAIL PROTECTED]> writes:
> 
>  Dresner,> It has to be possible to "re-create" functions like strcat
>  Dresner,> et al that are usable in the kernel, and I have difficulty
>  Dresner,> believing that someone hasn't already done just that.
> 
> You don't need to re-create anything.  All you need is to link the
> relevant object library with your module.
> 
> That assumes, of course, that the library doesn't need to do system
> calls (like malloc).  For example, the strings stuff should be fine
> except for "strstr".  Math should be fine unless there's some
> exception related stuff in it.

Use the functions in include/asm-i386/string-486.h
Although the call 'strstr' does not appear in string.h it is in this
file.

These functions are written in 486 assembly code and thus completely
independent of Linux.  That is if you are using a 486 or better.  If you
are using a different architecture look for a similar file in your asm
directory to see if 'strstr' is supported.

- Kal.

> 
>  >> you cannot use standard library functions in your modules.
> 
> That's not true.  It's true for libraries that use Linux system
> services; for libraries that are just self-contained functions, there
> is no problem.
> 
>  >> You
>  >> can use functions of your own or ones provided by kernel (man
>  >> ksyms). On this mailing list, it was mentioned that it's possible
>  >> to use math functions (-lm) in the modules.
> 
> Right...
> 
> paul
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] accessing a raw disk

2000-02-17 Thread Kulwinder Atwal

Find the Linux driver for your drive and access the functions in it
directly in your code.  The large majority of this code will be portable
to RTL with little modification because the 'includes' in most drivers
are very low level.

- Kal.

Nicholas Mc Guire wrote:
> 
> Hi !
> 
>  could someone give any pointers to code/docs on how
>  to directly access a IDE disk device . I would
>  need this for a datalogger that should no copy to shm
>  or via fifo into userland and then do fileio to a filesystem
>  I would like to simply dump the stuff to a dedicated IDE-HD .
> 
> thx
> nmg
> 
> **
> *THERE   {__} Universitaet Wien  *
> *IS  oo )  Inst. f. Materialphysik   *
> *LIFE   O_   `_---.  Mc  Guire  Nicholas *
> *IN   (-. ,-\*
> *THE   || )---<  )[EMAIL PROTECTED] *
> *NET ! ||| | |  privat: [EMAIL PROTECTED] *
> * [EMAIL PROTECTED]   *
> **
> * ASCII-COW 1995-2001 (c) [EMAIL PROTECTED]   *
> **
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] ...about linux and rtl boot

2000-01-09 Thread Kulwinder Atwal

All of your messages have the same time 12/31/69 at 5:00 PM.
Your messages are appearing at the other end in my inbox.  This is
probably why not too many people are reading your emails.  They don't
show up as new but as very very old.  Are both of you using Slackware?

- Kal.

"Der Herr Hofr.at" wrote:
> 
> Hi !
> 
>  I think there is a very simple solution to the lilo problem
>  you just create a directory for each kernel you would like to boot
> 
>  my non-rtlinux failsafe kernel is in boot .At compiletime Extraversion (in the
>  toplevel Makefile of the linux-source) was simply empty, so modules went to
>  /lib/modules/2.2.13/*
> 
>  /boot/vmlinuz.ok
>  /boot/System.map
> 
>  my rtlbet16 is in (extraversion set to bet16 -> modules reside in
>  /lib/modules/2.2.13bet16/*)
>  /boot/bet16/vmlinuz.bet16
>  /boot/bet16/System.map
> 
>  my rtl2.0 is in (extraversion set to -RTL2.0 -> modules reside in
>  /lib/modules/2.2.13-RTL2.0/*)
>  /boot/rtl2.0/vmlinuz.rtl2.0
>  /boot/rtl2.0/System.map
> 
>  so atleast I belive that the correct System.map is taken at boot-time.
>  atleast lilo doesn't complain and all versions boot ok.
> 
> nmg
> 
> --- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] PCI Latencies

2000-01-04 Thread Kulwinder Atwal



Paul Koning wrote:
>
> I wonder if people have examined the worst case timing properties of
> PCI... assuming it has any.  Lots of buses have no reasonable or
> defined worst case behavior.
>
> paul
 
Typical 33 MHz PCI hardware latencies are 10-20 uSec according to an IBM
datasheet.  Add to this any delays caused by the 'readPCI' code running
on the CPU before and after the read.  The PCI 2.1 Specification has two
equations for calculating bus latencies after a device wins arbitration
of the bus:
 
worst case:

  latency (bus clocks) = 16 + 8*(n-1) 
  n = number of 32 bit words transferred
  bus clocks = 1/33 MHz or 1/66 MHz depending on your PCI bus speed.

typical case:

  latency (bus clocks) = 8 + 8*(n-1)

The arbitration latency is:

  m * Latency Timer

  m = number of masters ( max is 8 )
  Latency Timer = typical is 22 bus clocks

 Your total PCI bus delay is the sum of the two latencies.

 - Each device can have a different timer setting.  Check the settings
   of your devices.
 - Some devices can do an endless data transfer without a timer.
 - Normal Linux can start a PCI data transfer that can run into
   a real time Linux interval.
 
Experiment with your system setup.  If you need shorter delays stop
any  unnecessary Linux PCI transfers, and plan the transfers better.

The PCI 2.1 Specification is available for download at:

 http://akulin.npi.msu.su/docs/standard/pci21.pdf

Latencies are covered in section 3.5.

 - Kal.
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] Linux Drivers for PCI based A/D

1999-11-20 Thread Kulwinder Atwal

I have read the app note at the Harris site:

http://www.intersil.com/data/AN/AN9/AN9509/an9509.pdf

It uses an IF.  The example it uses has an IF of 45 MHz and an ADC of 4
MHz to get an IF of 1 MHz.  The limiting factor in going to higher
frequencies is the aperture error of the ADC.  The formula is:

ta = 1/(2^n*pi*fmax)
where:
n = number of bits
pi = 3.14...
fmax = IF maximum
ta= aperture error in pico-seconds

For a 1 GHz signal an aperture error of no more than 1.24 ps is
required.  Currently, I have found no ADC with these characteristics. 
But, Analog Devices is developing an ADC with 1.0 ps error and 10 bits
at 200 MHz.  Then direct RF at 1 GHz will be possible.

But, as for 'software radios'.  I have read the vanu.com site.  A
simpler,more flexible and faster solution is a digital radio consisting
of an RF I/Q modulator, DDS (direct digital synthesizer), and CPU/DSP. 
It eliminates the need for a multi-band front end.  The latest Analog
Devices DDS does the frequency selection/hopping (at 100 Million
frequencies per second),PLL, ADC, DAC, and flexible modulation (PSK,
QPSK,FSK,...).   The DDS has a 100 MHz serial port/parallel port for
direct connection to a CPU/DSP.  The DDS integrates many of the hardware
functions that occur before the ADC in the 'software radio'. It also
hardware accelerates these functions. With the high speed frequency
hopping of a DDS you can still sample the whole band of 10 MHz.  Check
Analog.com for a DDS.


Paul Koning wrote:
> 
> >>>>> "Kulwinder" == Kulwinder Atwal <[EMAIL PROTECTED]> writes:
> 
>  Kulwinder> How many channels do you need?  I have done sampling of RF
>  Kulwinder> at 900 MHz.  I sampled I and Q of the signal after it was
>  Kulwinder> demodulated from the carrier and sent through a mixer to
>  Kulwinder> produce separate I and Q channels.
> 
>  Kulwinder> Do you need two channels?  One for I and one for Q?
> 
>  Kulwinder> Also, since your carrier is 1 GHz and your IF 10 MHz there
>  Kulwinder> is a mod/demod stage between your 1 GHz RF and your 10 MHz
>  Kulwinder> IF.  It is not all done at a 'digital level'.  The
>  Kulwinder> mod/demod of your IF is all digital.
> 
>  Kulwinder> Your answer to the I and Q question will determine the
>  Kulwinder> type of ADC you need.  - Kal Atwal.
>  >> Again ...our application is not the traditional analog ones as u
>  >> thinkwe do digitize the whole band and do the mod/demod at the
>  >> digital level
> 
>  >> 1. Physical parameter...?? Say a wideband signal centred at
>  >> 1Gc.(10Mhz bandwidth...)...to be more specific let it be a
>  >> wideband CDMA signal  2. If I say 20Msps at 10 bits
> 
> If your bandwidth is 10 MHz, then the min sampling rate you need is 20
> Ms/s.  Since your carrier is at 1 GHz, the sample/hold and analog
> input stages of the A/D have to have sufficient bandwidth for that,
> but it doesn't mean you have to sample at rates anywhere near there.
> 
> If you can do this -- and with modern A/Ds I believe you can, since
> they are aimed at this exact application -- then you can do direct RF
> sampling, no analog mixing to a lower IF is needed.
> 
> "Undersampling" is the term that describes this process.  I remember
> some nice apps notes on the subject from Harris, related to their
> HSP50214 digital receiver ASIC.
> 
> paul
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] Linux Drivers for PCI based A/D

1999-01-16 Thread Kulwinder Atwal

Yes, I have heard of 'software radios', but what you are describing is
not a 100% 'software radio'.  I have checked the vanu site.  It still
requires a 'multi-band front end' which the RF to IF mod/demod section I
was referring to.  
The key element in such a radio is a DDS (direct digital synthesizer),
and an RF I/Q modulator IC (mixer) See:

http://products.analog.com/products/info.asp?product=AD8346

This product is specifically designed for WCDMA (wideband CDMA).
Analog Devices also provides solutions. 

Jithesh Kizhakkekkara wrote:
> 
> Have u heard abt software radioslooks like u haventnow
> adays...irrespective of what signals it is we can do sampling of a very wideband
> signal..and do all mod/demod/if stuff in digital level.for more info u should
> probably take a peek in to http://www.vanu.com.,
> So here there is no I and Q channels.it is all done after sampling the
> wideband...I hope u understand..
> Any waywe did figure out couple of boards to start withthe only problem
> is we got write Linux drivers in near future for these boards.,
> 
> thanx again,
> Jithesh
> Kulwinder Atwal wrote:
> 
> > How many channels do you need?
> >
> > I have done sampling of RF at 900 MHz.  I sampled I and Q of the
> > signal after it was demodulated from the carrier and sent through a
> > mixer to produce separate I and Q channels.
> >
> > Do you need two channels?  One for I and one for Q?
> >
> > Also, since your carrier is 1 GHz and your IF 10 MHz there is a
> > mod/demod stage between your 1 GHz RF and your 10 MHz IF.  It is not all
> > done at a 'digital level'.  The mod/demod of your IF is all digital.
> >
> > Your answer to the I and Q question will determine the type of ADC you
> > need.
> > - Kal Atwal.
> > > Again ...our application is not the traditional analog ones as u thinkwe
> > > do digitize the whole band and do the mod/demod at the digital level
> >
> > > 1. Physical parameter...?? Say a wideband signal centred at 1Gc.(10Mhz
> > > bandwidth...)...to be more specific let it be a wideband CDMA signal
> > > 2. If I say 20Msps at 10 bitsI hope u understand...how often...
> > > 3. We have a dsp testbed here with an A/D which takes max 1 to -1V
> > > inputsat 10 bit resolution this means the no : of significant digits is
> > > 3...that will be fine for us
> > > Look forward to ur reply..,
> > > thanx,
> > > Jithesh...
> > > Kulwinder Atwal wrote:
> > >
> > > > Obviously, you have not done data acquisition before.  It is meaningless
> > > > to talk about sampling rates without stating the desired resolution.  It
> > > > is like talking about velocity in terms of direction alone.  I have
> > > > worked on research projects requiring real time A/D and none of them
> > > > have used the lowest resolution.  Further, there is the SINAD of the
> > > > analog front end to consider when calculating 'true' resolution.  Many
> > > > solutions exist to meet your needs.  To provide you with an optimal
> > > > solution I need to know the following:
> > > >
> > > > What is the physical parameter being measured?
> > > >
> > > > How often does it need to be measured?
> > > >
> > > > How many significant digits are required?
> > > >
> > > > - Kal Atwal.
> > > >
> > > > Jithesh Kizhakkekkara wrote:
> > > > >
> > > > > Hi,
> > > > >  Iam working on a research project which requires real time data
> > > > > acquisition of the order of 20Mega samples /sec To be more specific
> > > > > I would like to know whether there are any LINUX drivers written to date
> > > > > for PCI based A/D cards of speeds above 20Msps... I will be extremely
> > > > > grateful if any body could give pointers to some product which is
> > > > > existing or some work happening in this domain...
> > > > > The max speed of the A/D for which a linux driver exists, I could
> > > > > spot out was around 2 Msps...
> > > > >
> > > > > thanx in advance,
> > > > > Jithesh
> > > > >
> > > > > --- [rtl] ---
> > > > > To unsubscribe:
> > > > > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > > > > echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] Linux Drivers for PCI based A/D

1999-01-16 Thread Kulwinder Atwal

How many channels do you need?

I have done sampling of RF at 900 MHz.  I sampled I and Q of the
signal after it was demodulated from the carrier and sent through a
mixer to produce separate I and Q channels.

Do you need two channels?  One for I and one for Q?  

Also, since your carrier is 1 GHz and your IF 10 MHz there is a
mod/demod stage between your 1 GHz RF and your 10 MHz IF.  It is not all
done at a 'digital level'.  The mod/demod of your IF is all digital.

Your answer to the I and Q question will determine the type of ADC you
need.
- Kal Atwal.
> Again ...our application is not the traditional analog ones as u thinkwe
> do digitize the whole band and do the mod/demod at the digital level
 
> 1. Physical parameter...?? Say a wideband signal centred at 1Gc.(10Mhz
> bandwidth...)...to be more specific let it be a wideband CDMA signal
> 2. If I say 20Msps at 10 bitsI hope u understand...how often...
> 3. We have a dsp testbed here with an A/D which takes max 1 to -1V
> inputsat 10 bit resolution this means the no : of significant digits is
> 3...that will be fine for us
> Look forward to ur reply..,
> thanx,
> Jithesh...
> Kulwinder Atwal wrote:
> 
> > Obviously, you have not done data acquisition before.  It is meaningless
> > to talk about sampling rates without stating the desired resolution.  It
> > is like talking about velocity in terms of direction alone.  I have
> > worked on research projects requiring real time A/D and none of them
> > have used the lowest resolution.  Further, there is the SINAD of the
> > analog front end to consider when calculating 'true' resolution.  Many
> > solutions exist to meet your needs.  To provide you with an optimal
> > solution I need to know the following:
> >
> > What is the physical parameter being measured?
> >
> > How often does it need to be measured?
> >
> > How many significant digits are required?
> >
> > - Kal Atwal.
> >
> > Jithesh Kizhakkekkara wrote:
> > >
> > > Hi,
> > >  Iam working on a research project which requires real time data
> > > acquisition of the order of 20Mega samples /sec To be more specific
> > > I would like to know whether there are any LINUX drivers written to date
> > > for PCI based A/D cards of speeds above 20Msps... I will be extremely
> > > grateful if any body could give pointers to some product which is
> > > existing or some work happening in this domain...
> > > The max speed of the A/D for which a linux driver exists, I could
> > > spot out was around 2 Msps...
> > >
> > > thanx in advance,
> > > Jithesh
> > >
> > > --- [rtl] ---
> > > To unsubscribe:
> > > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > > echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[Fwd: [rtl] Linux Drivers for PCI based A/D]

1999-01-16 Thread Kulwinder Atwal



Kulwinder Atwal wrote:
 
 Obviously, you have not done data acquisition before.  It is
meaningless
 to talk about sampling rates without stating the desired resolution. 
It is like talking about velocity in terms of direction alone.  I have
 worked on research projects requiring real time A/D and none of them
 have used the lowest resolution.  Further, there is the SINAD of the
 analog front end to consider when calculating 'true' resolution.  Many
 solutions exist to meet your needs.  To provide you with an optimal
 solution I need to know the following:
 
 What is the physical parameter being measured?
 
 How often does it need to be measured?
 
 How many significant digits are required?
 
 - Kal Atwal. 
 
 Jithesh Kizhakkekkara wrote:
 >
 > Hi,
 >  I am working on a research project which requires real time data
 > acquisition of the order of 20Mega samples /sec To be more  >
specific
 > I would like to know whether there are any LINUX drivers written to 
> date
 > for PCI based A/D cards of speeds above 20Msps... I will be extremely
 > grateful if any body could give pointers to some product which is
 > existing or some work happening in this domain...
 > The max speed of the A/D for which a linux driver exists, I could
 > spot out was around 2 Msps...
 >
 > thanx in advance,
 > Jithesh
 >
 > --- [rtl] ---
 > To unsubscribe:
 > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
 > echo "unsubscribe rtl " | 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 " | mail [EMAIL PROTECTED]

For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/