Twin Version System

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Twin Version System

Post 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?
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
dr_evil
Member
Member
Posts: 34
Joined: Mon Dec 20, 2004 12:00 am

Re: Twin Version System

Post 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?
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Twin Version System

Post 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
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Twin Version System

Post 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
Post Reply