public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] problem writing a serial hardware interface driver
@ 2005-06-06 23:28 jpath
  2005-06-07  3:02 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: jpath @ 2005-06-06 23:28 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I'm porting a BSP from PSOS to the HAL from ECOS (my target is a PPC860) for my
application, and I have a problem writing my serial hardware interface driver.
I already have all my I/O function "handlers" to attach to the
DEVTAB_ENTRY/handlers,  but
I don't understand what is exactly done in the DEVTAB_ENTRY/"module_init"
function.
Here are my questions:
1) Is there a setup of the serial device driver already done in the ECOS's HAL
(before the DEVTAB_ENTRY/init), or do I have to add MY driver setup in the
hal_variant_init() or in the hal_platform_init()?
2) the DEVTAB_ENTRY/"init" function is said to be "called when eCos is
initialized. This function can query the device, setup hardware, etc."
When is it exactly called in the HAL? in which file?
3) What am I supposed to initialize exactly in the DEVTAB_ENTRY/init function?
4) Is there a "Print()" function furnished with ECOS to print messages on the
console when my serial device driver will be installed?

Sincerely yours,

Jenny

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] problem writing a serial hardware interface driver
  2005-06-06 23:28 [ECOS] problem writing a serial hardware interface driver jpath
@ 2005-06-07  3:02 ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2005-06-07  3:02 UTC (permalink / raw)
  To: jpath; +Cc: eCos Discussion

On Mon, 2005-06-06 at 16:33 +0200, jpath@free.fr wrote:
> Hello,
> 
> I'm porting a BSP from PSOS to the HAL from ECOS (my target is a PPC860) for my
> application, and I have a problem writing my serial hardware interface driver.

What's wrong with the framework that's already in place for PPC8xx?
You can simply adapt one of the existing targets (there are a number
to choose from) for your specific hardware.

Have you looked at the drivers that already exist for this processor?

> I already have all my I/O function "handlers" to attach to the
> DEVTAB_ENTRY/handlers,  but
> I don't understand what is exactly done in the DEVTAB_ENTRY/"module_init"
> function.
> Here are my questions:
> 1) Is there a setup of the serial device driver already done in the ECOS's HAL
> (before the DEVTAB_ENTRY/init), or do I have to add MY driver setup in the
> hal_variant_init() or in the hal_platform_init()?

Normally hal_XXX_init sets up the basic hardware (on the PPC8xx, it 
might set up I/O pins, etc).  It's up to the driver to configure the
device as required.

> 2) the DEVTAB_ENTRY/"init" function is said to be "called when eCos is
> initialized. This function can query the device, setup hardware, etc."
> When is it exactly called in the HAL? in which file?

It's not called from the HAL - it's called from the I/O framework.  This
happens as part of the "CTOR" initializations (called to initialize 
static classes)

> 3) What am I supposed to initialize exactly in the DEVTAB_ENTRY/init function?

100% up to you.  You need to set up enough stuff so that when the lookup
(part of 'opening' a device) happens, you're ready to take off.  
Typically this includes things like setting up interrupt handlers, 
creating auxiliary threads, etc.

> 4) Is there a "Print()" function furnished with ECOS to print messages on the
> console when my serial device driver will be installed?

diag_printf()?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-07  3:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-06 23:28 [ECOS] problem writing a serial hardware interface driver jpath
2005-06-07  3:02 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).