[fpc-pascal] Embedded ARM system unit

Michael Van Canneyt michael at freepascal.org
Wed Aug 24 11:08:58 CEST 2005



On Wed, 24 Aug 2005, Florian Klaempfl wrote:

> Michael Van Canneyt wrote:
>
>>
>>
>> On Wed, 24 Aug 2005, Florian Klaempfl wrote:
>>
>>> Marco van de Voort wrote:
>>>
>>>>> I am in the first stage of creating a system unit for
>>>>> Embedded ARM. Things are working but I get a lot of
>>>>> Warnings and Hints (See some of them below).
>>>>> Should I be worried about this?
>>>>
>>>>
>>>>
>>>> I see no troubling ones. THe first few mean that generic might not be
>>>> 64-bit
>>>> clean, but are probably false. (since generic.inc is used for the
>>>> 64-bit ports too),
>>>> the others are simply unused Unix symbols. This is normal, because
>>>> these includefiles
>>>> are also used in a few other places (like baseunix), where they _are_
>>>> used.
>>>
>>>
>>> Maybe we should think about a generic embedded rtl which is
>>> configurable what's
>>> included.
>>
>>
>> I think this is a good idea. Maybe create a system unit which has simply
>> a set
>> of handlers (very much like the Managers we use for heap, widestring
>> etc) which can be set by a drop-in unit. We can then provide a drop-in
>> unit which creates a set of handlers based on the C library.
>>
>> If a handler is not implemented, the unit can simply throw an error.
>> Even this could be handled by the drop-in unit...
>
> No, I meant simply with an include file with defines like:
> {$define RTL_INCLUDE_ANSISTRING}
> {$define RTL_INCLUDE_WIDESTRING}
> { $define RTL_INCLUDE_TEXTIO}
> {$define RTL_INCLUDE_FILEIO}
> {$define RTL_INCLUDE_HEAPMANAGER}
> {$define RTL_INCLUDE_FLOAT}
> {$define RTL_INCLUDE_FLOAT_TRANSCENDENT}
>
> An embedded system needs no managers.

Yes, but this leaves the question how to implement this system unit.
You'll have to re-implement it for each platform. The handler system
allows to plug-in the real implementation.

What is more, with the handlers, you can still use the {$define }
system to exclude functionality. They are 2 different things. One is
implementation, the other is functionality. The handlers are only
needed for OS calls, i.e. implementation. The defines decide what you
want in your embedded system.

But it was just a thought.

Michael.




More information about the fpc-pascal mailing list