This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Creating a drop in replacement for the pcmb package


Ian Campbell <icampbell@arcom.co.uk> writes:

> Hi,
> 
> I would like to create a drop in replacement for the pcmb package to
> support one of our products and would like some advice on a couple of
> matters.
> 
> My first problem is that the pcmb header files are hard coded in several
> places in the pc package. 

The idea of the PCMB package is that it collects together all the
common PC device and HAL support for both standard PCs and PC-like
embedded boards. If your board is so unlike a PC that you do not need
to use the PCMB package, then you should not really use the PC
platform package either, but make a new one of your own.

> Maybe someone has a better idea, or can tell me what the preferred
> solution is, to give maximum chance of acceptance for whatever patches I
> need to pass upstream?

Best bet is a totally new platform package. That would make it almost
totally orthogonal to the current packages, and would give it a much
greater chance of finding its way into the mainline sources.

> 
> My second query is to do with romboot.S which currently resides in
> hal/i386/arch. Unfortunately the merlin boards do not have exactly the
> same boot sequence, although they are fairly similar. I don't think I
> can override which files are compiled in another module with my own, so
> I think that either romboot.S really belongs in pcmb or else some level
> of abstraction could be added, for example factoring out some
> functionality into macros such as hal_i386_setup_gdt,
> hal_i386_setup_mem, etc in pcmb/merlin packages. I would be happy to do
> the work necessary to factor these things out.

You can always supply your own equivalent of romboot.S
(merlinboot.S ?). The CYGBLD_BUILD_REDBOOT_BIN_ROM option in the
architecture CDL file should really move to the PC packages CDL, and
your platform package should then have its own version to build the
ROM image your board needs. 

> 
> My third question is about the memory layout files (pc package
> include/pkgconf/mlt_i386_pc_rom.{h,ldi}). Again I need to override
> these. They claim to be generated, but I gather this is by the config
> tool rather than at build time from cdl options. Since these are header
> files, can I simply include my own copies in the merlin package and
> arrange for these to go into the build tree in preference to the ones in
> the pc package? or otherwise influence the values of
> CYGHWR_MEMORY_LAYOUT_{LDI,H} from the merlin cdl file? Perhaps these
> files are another candidate for moving to pcmb?
>

Again, if you make your own platform HAL, then you can redefine these
as you need.


Executive summary: Make a platform HAL of your own, start by just copying
the PC package and renaming everything. Then add any device support
you need to that package. If there's any stuff you need from the PCMB
package, just copy it over.

Hope this helps.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]