Hi all,

Sorry for the long mail, but as you probably already noticed I'm just
starting with RTLinux.

I have the next problem:

I've written a driver of wich I only need the irq-handler to be RT. The
handler reeds data from the hardware and puts it in a kernel buffer. The
kernel read call, reads the data from the buffer and copies it to
userspace.

I have assumed there's no problem for the RT irq-handler to work with
shared kernel memory allocated at open time of the device with vmalloc.
Is this correct?

The buffer is circular and I'm using the following code:

...
fifostruct_t fifo;

id=inb(address);
fifo->head++;
fifo->buf_entry[fifo->head].id=id;

/* This last line causes a page fault because of the fifo->head index
for buf_entry. If I use a integer there's _no_ problem. */

typedef struct {
        ...
        int id;
        unsigned data;
} msgstruct_t;

typedef struct {
        ...
        int head, tail;
        msgstruct_t *buf_entry;
} fifostruct_t;

Memory is allocated with vmalloc and correctly type-casted for the array
buf_entry. (The same problem occurs with static allocated memory though)

question:
The same code works perfectly with standard Linux so why can't I use
this kind of array indexing on RTLinux? It's not a synchronisation issue
since the read operation doesn't get to wake up yet! (Oops message is at
the bottem) 


question:
I'd like to have some pointers to information about calculating the
execution time (duration) of the handler. (Or is it easier to do
gethrtime at the beginning and the end of the handler?)

question:
What's a good/easy way to test the driver? I remember a thread in the
mail archive using ping etc. however I don't have any network utilities
installed.

question:
Does a "hard" handler stop a RT thread? (I would say yes) How are the
"priorities" between hard handlers and RT threads determined by RTLinux?

question:
It takes a verry long time before I receive my own messages from the
list (~45 min.) is it normal?


Thanks,

Greetings Arnaud

********************* OOPS ********************
Unable to handle kernel paging request at virtual address cad491dc
current->tss.cr3 = 00101000, %cr3 = 00101000
*pde = 00000000
Oops: 0002
CPU:    0
EIP:    0010:[<c280a2b3>]
EFLAGS: 00010012
eax: 4214fe1b   ebx: 00000260   ecx: 00000073   edx: c04c244d
esi: ffffffe0   edi: c280994c   ebp: 00000201   esp: c01d1f30
ds: 0018   es: 0018   ss: 0018
Process swapper (pid: 0, process nr: 0, stackpage=c01d1000)
Stack: 00000005 c01d1f60 c04c244d fffffac0 e1000000 c010abd5 00000005
c01d1f68 
       00000000 c01d0000 0000517a 00000000 00004854 c0109ed8 00000000
0000000c 
       00000004 c01d0000 0000517a 00004854 00000018 00000018 00000018
ffffff05 
Call Trace: [<c010abd5>] [<c0109ed8>] [<c01078ed>] [<c0106000>]
[<c0107910>] [<c0109048>] [<c0106000>] 
       [<c010607b>] [<c0106000>] [<c0100176>] 
Code: 89 4c 87 24 83 7f 14 36 75 07 c7 47 14 00 00 00 00 66 8b 0d 

>>EIP: c280a2b3 <_end+261354f/26210bc>
Trace: c010abd5 <rtl_intercept+8d/130>
Trace: c0109ed8 <common_interrupt+18/30>
Trace: c01078ed <cpu_idle+59/68>
Trace: c0106000 <get_options+0/74>
Trace: c0107910 <sys_idle+14/24>
Trace: c0109048 <system_call+34/38>
Trace: c0106000 <get_options+0/74>
Trace: c010607b <cpu_idle+7/18>
Code:  c280a2b3 <_end+261354f/26210bc>         00000000 <_EIP>: <===
Code:  c280a2b3 <_end+261354f/26210bc>            0:    89 4c 87
24             movl   %ecx,0x24(%edi,%eax,4) <===
Code:  c280a2b7 <_end+2613553/26210bc>            4:    83 7f 14
36             cmpl   $0x36,0x14(%edi)
Code:  c280a2bb <_end+2613557/26210bc>            8:    75
07                   jne     c280a2c4 <_end+2613560/26210bc>
Code:  c280a2bd <_end+2613559/26210bc>            a:    c7 47 14 00 00
00 00    movl   $0x0,0x14(%edi)
Code:  c280a2c4 <_end+2613560/26210bc>           11:    66 8b 0d 00 00
00 00    movw   0x0,%cx

Kernel panic: Attempted to kill the idle task!
In swapper task - not syncing
-- [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/

Reply via email to