Cross gcc Mailing List Archive
[Prev][Next][Index][Thread]
RE: i386 and gcc
Dear Mike
I thought I'd reply to the list on this because other users may have the
same understanding of gcc and the i386 and then I'll explain why I want
far pointers with gcc
>> I need the effect of far pointers (segment:offset) from gcc running on a pc
>> for embedded i386. Does the current most up to date or will a future version
>> off gcc support far pointers directly.
>gcc does not support real mode, and likely never will.
True, and I'm not working in real mode
>> Failing this, anyone got any cute suggestion for far function calls, and far
>> data pointers.
>You don't need them, or want to use them. Run in protected
>mode, and enjoy the benefits of a flat 32-bit address space.
Yes, you do have a flat 32 bit address space but only with in the segment that
the operating system has given you. Sure if you are writing an embedded system
you can set yourself up segments for the whole memory range but you may choose
not to for operation reasons. The i386 does support segments in protected mode.
Protected mode gives you protection from code in one segment accesses code or
data in segments of higher privilege.
>If what you _really_ mean is "can I make BIOS calls", then
>yes, there are a few ways of doing this, but they're moderately
>involved.
True enough - linux source for this will show anyone how it's done.
I have an embedded system where the bulk of the code is made up of separate
independent binary components. Individual components may change or be different
for different configurations. Yes there are all sorts of ways of achieving this.
I would like one component to be able to make calls into other components, for
instance, a UI component wants to render a string by index. In this way the
language component can have a defined interface but contain different languages.
Each component will be loaded in its own segment, one code and one data. If a
component wants space from the heap, the segment is extended, another block
paged in to it's segment and off it goes.
GCC conveniently produces binaries that start from zero (or any other base if you
configure the linker command file correctly). These can then be loaded into a segment
without any knowledge of the rest of the system. If a component wants the sevices
of another , it can ask the OS for an interface pointer for that component - a far
pointer because its across a segment boundary.
So, dear GCC/DeLore (Is that right?) far pointers please, or as my original
post :-
Failing this, anyone got any cute suggestion for far function calls, and far
data pointers.
Thanks
David
Follow-Ups:
Home |
Subject Index |
Thread Index