> We need to do some serial communication with PCI Rs485 card under RTLinux. 
> Now I move the driver into the RT-kernel. But I am really confused with something. 
> I wish somebody can give me some explanation.
>  
>   1.The driver should be used under RTLinux, can I call some kernel funtions 
> like register_chrdev(),kmalloc, kfree, ect which are given by book 
> <<linux devices driver>>?  In my opinion, those functions belong to the linux kernel,
> but not the RT-kernel, so I cannot. orelse, it is just a linux kernel module.

you can call these functions in init_module which runs in linux kernel context
register_chardev only makes sense though if you intent to call some device 
functions from linux context - if you only want the device driver to be 
accessed from rtlinux threads there is no need to use these functions. 

> For example,  In rt_com,  I find it used rtl_request_irq. 
> In standard serial driver, it uses request_irq. so what is the difference
> between the rtlinux module and the kernel module which written under
> normal linux. 

The difference is who handles it.

your interrupt_code registered with request_irq in linux context is called when
rtlinux does a pend irq which then causes Linux to execute the interrupt_code, 
if you register the interrupt_code with rtl_request_irq then it is called when
a hardware interrupt for that irq occurs in rt-context.

> 
>  2. In the other hand, I find that in the rt_com module, it calls linux kernel 
>function
>  like check_region request_region under rt-kernel module.

only in init_module - and it is generally only safe to call linux kernel
functions in init_module - if you want to call any linux kernel function
in rt-context you need to check if this is safe on your own.

> So what functions can be called under rt-kernel module?
> 
>  3. I think it will cannot guarantee the Hard real time performance if we call the 
>normal
> linux kernel functions since these function is running under linux kernel.
> 
> In fact they are almost same. They both run in the kernel space, both have 
>init_module 
> and cleanup_module If they can call same functions, maybe to write the rtlinux 
>program
> is just to write the some kernle module?!
>

nop - not at all. look at the parallel port example as an example an compar
it to the linux-kernel parallel port modules - they are not realy related at
all - asside from both doing outb/inb at some point to the LPT port.
  
> I think the only benifit is that you can call some RTlinux functions like rtl_**. 
> you can use rt_fifo,rt_schedule and other modules.
>  
> I am really confused with the RTKernel and normal linux kernel. any help will be 
>appreciated!

Read michael barabanovs thesis on rtlinux - it expains clearly what
the purpos of rtlinux is and how it fits on top of linux. look at the
examples for the paralell port and the sound module (using the pc speaker)
and give rt_com a nother look...

hofrat
-- [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/

Reply via email to