Page 1 of 1

Twin Version System

Posted: Sun Aug 10, 2008 4:01 am
by thepowersgang
For Acess I'm using two versions concurrently with a large amount of the higher level kernel code being shared between the two versions. (Drivers, VFS etc)
Currently for code that uses absolute memory addresses in the common code I'm checking the address of a local variable to see what version is in use (AcessOS is higher-half and Acess Basic is lower)

Is there a more efficient way of doing this without maintaining separate object files?

Re: Twin Version System

Posted: Mon Aug 11, 2008 1:29 am
by dr_evil
You're aware of the fact that access is spelt with two C's ?

And I don't get the question, sorry. Can you clarify?

Re: Twin Version System

Posted: Mon Aug 11, 2008 2:21 am
by thepowersgang
1. Yes I know, the name is pronounced Ay-Sess

2. The idea is I have two versions. One has virtual memory and multitasking, while the other is like a 32 bit version of DOS, no Virtual Memory and can only run a single task at one time.
The simpler version is used as a stable base for testing the higher level code (VFS and others).

The shared code is set up as to only need to be compiled once and linked into each kernel, but in this system if a direct memory address is required (like VGA memory) there needs to be an if statement that checks the version in use. Is there a way to remove the need for these statements to be executed at runtime? (Like a pre-processor command in the linker)

EDIT: Sorry if it sounded convoluted

Re: Twin Version System

Posted: Mon Aug 11, 2008 3:20 am
by AJ
Hi,

Are you looking for conditional compilation?

Code: Select all

#ifdef VERSION_A
...
#elif defined(VERSION_B)
...
#else
...
#endif
I also have shared code and architecture-dependent code (for 32 and 64 bit versions). Careful use of exports in your makefile can also be used to include/exclude various paths from your build.

Cheers,
Adam