This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

FW: Adding platform extensions?


Ok, here is the way my OS is designed and how the kernel works.
Its based off a COM/CORBA style object model.
It even gets more complicated by the fact that I allowed interfaces to be
compiled on the fly, meaning each member/function is also assigned a GUID.
(Note, this comes in handy when having a generic driver interface that can
work with any driver object!  This is also useful in many other kernel
situations)

There are interfaces and objects.
With my current method I use 2 files to define each interface and 2 files to
define each module.

Here is an example of how an object would be defined right now:

object.c
-------------

defobj(oFoo)
	objmembers
		objmember(UInteger,m_Foo)
	objmethods(oFoo)
		objmethod(Void,FooDoo,(THIS,UInteger fooParam)
objend

object.ob
-------------
object
{
	UInteger m_Foo = oFoo_mFooGUID;
	Void FooDoo(THIS,UInteger fooParam) = { oFoo_FooDoo , oFoo_FooDooGUID };
} oFooGUID;


Here is how this works:
The macros in the C file define 2 structures, a object structure which
includes an object header, a vtbl, and then the object members.  The vtbl
structure is defined afterwards and contains pointers to the functions.

In the .ob file, the object is defined again.  A GUID/UUID is assigned to
both the member, the function, and the object itself.  Then, the function is
also linked to a C function name, shown here as oFoo_FooDoo.  The .ob file
is compiled by a tool i wrote a few months ago into an object file and is
linked into the executable so my SwCom subsystem reads the headers from the
images and can make use of the objects and interfaces.

The problem?  This takes too long to use.  Keeping multiple source files up
to date is a pain, not to mention the GUIDs have to be defined in each file.
Another problem, the object/interface compilers are not advanced enough to
allow objects to have members that are not of basic types.  This means that
I manually must calculate size of items and write it in as a byte array in
the object definition!

The work put into modifying GCC to do this from a single source would
GREATLY simplify my work, along with the work others will do when I release
a dev. version of my OS this winter.

Any help, advice on how to continue, etc would be greatly appreciated.
I am using Win32 as my dev enviroment, and using a DOS based boot loader for
the time being (i.e. I dont have to worry about file system in the boot
loader, I just load it up, kill dos, and jump into the kernel).

-Dan

-----Original Message-----
From: Mike Stump [mailto:mrs@windriver.com]
Sent: Monday, November 15, 1999 4:41 PM
To: danrg@mn.mediaone.net; gcc@gcc.gnu.org
Subject: Re: Adding platform extensions?


> From: "Dan Guisinger" <danrg@mn.mediaone.net>
> Date: Mon, 15 Nov 1999 00:16:25 -0600

I am trying to understand how C++ doesn't fill every need you
expressed.  I failed.  If you want to create your own language, go
ahead, but if you I suspect you won't have much time left over for an
OS as well.


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