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


On Fri, 2001-09-28 at 18:52, Jonathan Larmour wrote:
> The idea is more that the PCMB package collects together those parts common
> to PC-like boards. It doesn't itself provide an abstraction - instead it
> provides those facilities which the underlying platform HAL (the PC HAL)
> would use.
> 
> In your case, by the sound of it, you would still use the pcmb HAL _with_ a
> new merlin platform HAL. That merlin platform HAL would do the equivalent
> of the PC HAL (i.e. hal/i386/pc) for your merlin board.

Aaah, I see. I got it backwards. Happily, once I started thinking this
way round things were much simpler ;-)

Most of the abstraction seems to be in place already and the attached
'pc-dependency-fixes.patch' includes two tiny little patches which
remove the two dependencies from pcmb and arch on the pc package which I
tripped over. There might be others but they haven't bitten me as yet.
There's even ChangeLog entries this time..

The other attached patch (memsize-fixes.patch - which I am posting more
for comment than inclusion since it may not be the correct approach) is
to allow the memory size to be hardcoded. The display attributes in the
CDL have FIXMEs because I am not entirely sure how to describe what they
are. I'm also not convinced by my choice of option names.

I would like to be able to change the value of CYGNUM_HAL_RTC_PERIOD in
hal_i386_pcmb.cdl, however it is defined using a 'calculated' statement.
Is there any problem with making this into a 'default_value'?

My last change is to move romboot.S + associated CDL into the pc package
but I've not gotten round to it yet. I'll post a patch when I have.

[snip]

> > Is it possible to create a template target of some sort which simply
> > uses the PC/PCMB packages and enforces (or at least sets up the correct
> > initial values for) the options required for a particular board (ie so
> > that ecosconfig new merlin <xxx> will force the correct options for the
> > merlin variant? IDE=0, PCI=0 etc). It seems that packages can't override
> > or place constraints on options in other packages (I get errors about
> > redefining the option name)
> 
> You certainly can do that. You would set values for options in e.g. the
> PCMB or arch HALs just by using the appropriate "requires" statements using
> CDL.

This works just great, thank you!

> 
> > but maybe there is a way to create a target
> > template? What I would really like is to be able to have a merlin.epk
> > which people can install without applying patches or anything to the
> > main tree and then use 'ecosconfig new merlin xxx' to generate a working
> > project.
> 
> Sure. Although right now the abstractions may not be quite right to support
> this. We need to make sure the main tree is in a state where this _can_
> work. Even better though, would be to get your board support into our main
> tree though. In either case you should probably consider looking at the
> various legal technicalities for contributing to the main tree:
> http://sources.redhat.com/ecos/faq.html#contrib_assign

This is something which I will need to discuss with my boss at some
point. Hopefully the attached patches are trivial enough not to warrant
it (He said with his fingers crossed...)

> > This message has been checked for all viruses by MessageLabs Virus Control Centre.
> 
> I'm always amused by these lines.

Our mail server just started adding them recently, I wonder how many
it's caught so far...

Thanks for your help,
Ian.
 
-- 
Ian Campbell
Design Engineer

Arcom Control Systems Ltd,
Clifton Road,
Cambridge CB1 7EA
United Kingdom

Tel: +44 (0)1223 411200 ext. 3204
E-Mail: icampbell@arcom.co.uk
Web: http://www.arcomcontrols.com


_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.

This message has been checked for all viruses by MessageLabs Virus Control Centre. 

Company registered in England No. 1608562.
Registered Office: Unit 8, Clifton Road, Cambridge, CB1 7EA, United Kingdom, Tel: 01223 411200.
Index: packages/hal/i386/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/arch/current/ChangeLog,v
retrieving revision 1.24
diff -u -r1.24 ChangeLog
--- packages/hal/i386/arch/current/ChangeLog	2001/09/12 00:59:23	1.24
+++ packages/hal/i386/arch/current/ChangeLog	2001/10/01 15:08:45
@@ -1,3 +1,9 @@
+2001-10-01  Ian Campbell  <icampbell@arcom.co.uk>
+
+	* src/vectors.S: include CYGBLD_HAL_PLATFORM_H rather than
+	<pkgconf/hal_i386_pc.h>
+	
+
 2001-09-05  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* src/vectors.S (__default_interrupt_vsr): Adjust saved stack pointer
Index: packages/hal/i386/pcmb/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/ChangeLog,v
retrieving revision 1.5
diff -u -r1.5 ChangeLog
--- packages/hal/i386/pcmb/current/ChangeLog	2001/09/12 00:59:23	1.5
+++ packages/hal/i386/pcmb/current/ChangeLog	2001/10/01 15:08:56
@@ -1,3 +1,9 @@
+2001-10-01  Ian Campbell  <icampbell@arcom.co.uk>
+
+	* include/pcmb_io.h: Include CYGBLD_HAL_PLATFORM_H rather than
+	<pkgconf/hal_i386_pc.h>. Also include <pkgconf/system.h> so the
+	define is available.
+
 2001-08-22  Nick Garnett  <nickg@redhat.com>
 
 	* src/pcmb_misc.c: Added spinlock to clock read operation.

Index: packages/hal/i386//arch/current/src/vectors.S
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/arch/current/src/vectors.S,v
retrieving revision 1.8
diff -u -r1.8 vectors.S
--- packages/hal/i386/arch/current/src/vectors.S	2001/09/12 00:59:23	1.8
+++ packages/hal/i386/arch/current/src/vectors.S	2001/10/01 14:33:19
@@ -47,7 +47,7 @@
 
 #include <pkgconf/system.h>
 #include <pkgconf/hal.h>
-#include <pkgconf/hal_i386_pc.h>
+#include CYGBLD_HAL_PLATFORM_H
 
 #ifdef CYGPKG_KERNEL
 #include <pkgconf/kernel.h>
Index: packages/hal/i386//pcmb/current/include/pcmb_io.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/include/pcmb_io.h,v
retrieving revision 1.3
diff -u -r1.3 pcmb_io.h
--- packages/hal/i386/pcmb/current/include/pcmb_io.h	2001/09/12 00:59:23	1.3
+++ packages/hal/i386/pcmb/current/include/pcmb_io.h	2001/10/01 14:33:19
@@ -45,7 +45,8 @@
 //
 //==========================================================================
 
-#include <pkgconf/hal_i386_pc.h>
+#include <pkgconf/system.h>
+#include CYGBLD_HAL_PLATFORM_H
 
 #include <cyg/hal/pcmb_io.h>
 
Index: packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl,v
retrieving revision 1.3
diff -u -r1.3 hal_i386_pcmb.cdl
--- packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2001/09/12 00:59:23	1.3
+++ packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2001/10/01 15:14:53
@@ -87,7 +87,32 @@
         }
     }
 
-    
+    cdl_component CYGNUM_HAL_MEMSIZE {
+	display       "FIXME: How to configure the size of RAM."
+	flavor        data
+	legal_values  {"BIOS" "HARDCODE"}
+	default_value {"BIOS"}
+	description   "It is possible for the HAL to discover the 
+	               size of RAM In several ways. Currently this
+                       can be done by querying the BIOS or by 
+                       hardcoding the values into the executable."
+
+	cdl_option CYGNUM_HAL_MEMSIZE_BASE {
+	    display       "FIXME: Memory base"
+	    flavor        data
+	    default_value 0xF0000
+	    active_if     { CYGNUM_HAL_MEMSIZE == "HARDCODE" }
+	}
+
+	cdl_option CYGNUM_HAL_MEMSIZE_EXTENDED {
+	    display       "FIXME: Extended memory"
+	    flavor        data
+	    default_value 0x100000
+	    active_if     { CYGNUM_HAL_MEMSIZE == "HARDCODE" }
+	}
+
+    }
+
     cdl_interface CYGINT_HAL_I386_PCMB_SCREEN_SUPPORT {
 	display       "Enable PC screen support"
 	compile       pcmb_screen.c
Index: packages/hal/i386//pcmb/current/src/pcmb_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/src/pcmb_misc.c,v
retrieving revision 1.3
diff -u -r1.3 pcmb_misc.c
--- packages/hal/i386/pcmb/current/src/pcmb_misc.c	2001/09/12 00:59:23	1.3
+++ packages/hal/i386/pcmb/current/src/pcmb_misc.c	2001/10/01 14:33:20
@@ -70,6 +70,12 @@
 
 void hal_pcmb_init(void)
 {
+#ifdef CYG_HAL_MEMSIZE_HARDCODE
+    cyg_hal_pcmb_memsize_base = CYGNUM_HAL_MEMSIZE_BASE;
+    cyg_hal_pcmb_memsize_extended = CYGNUM_HAL_MEMSIZE_EXTENDED;
+#endif
+
+#ifdef CYG_HAL_MEMSIZE_BIOS
     cyg_uint8 lo,hi;
     
     HAL_READ_CMOS( 0x15, lo );
@@ -89,7 +95,7 @@
 #endif
 
     cyg_hal_pcmb_memsize_extended = ((hi<<8)+lo)*1024;
-
+#endif
 }
 
 /*------------------------------------------------------------------------*/

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