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?
Twin Version System
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Twin Version System
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: Twin Version System
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?
And I don't get the question, sorry. Can you clarify?
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: Twin Version System
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
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
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: Twin Version System
Hi,
Are you looking for conditional compilation?
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
Are you looking for conditional compilation?
Code: Select all
#ifdef VERSION_A
...
#elif defined(VERSION_B)
...
#else
...
#endif
Cheers,
Adam