From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1870 invoked by alias); 7 Jun 2005 03:02:17 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 1861 invoked by uid 22791); 7 Jun 2005 03:02:12 -0000 Received: from sta-206-168-96-204.rockynet.com (HELO hermes.chez-thomas.org) (206.168.96.204) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 07 Jun 2005 03:02:12 +0000 Received: by hermes.chez-thomas.org (Postfix, from userid 2000) id ACD0E10000F; Mon, 6 Jun 2005 21:02:05 -0600 (MDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id 87BB910000C; Mon, 6 Jun 2005 21:02:02 -0600 (MDT) From: Gary Thomas To: jpath@free.fr Cc: eCos Discussion In-Reply-To: <1118068391.42a45ea7b812b@imp1-q.free.fr> References: <1118068391.42a45ea7b812b@imp1-q.free.fr> Content-Type: text/plain Date: Tue, 07 Jun 2005 03:02:00 -0000 Message-Id: <1118113322.22823.58.camel@hermes> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] problem writing a serial hardware interface driver X-SW-Source: 2005-06/txt/msg00047.txt.bz2 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