flat assembler
Message board for the users of flat assembler.

Index > Main > Portability

Author
Thread Post new topic Reply to topic
jvff



Joined: 05 Jul 2005
Posts: 5
Location: Brazil
jvff 09 Jul 2005, 04:02
Hello,

I'm not sure this is right area to post this, because this is assembler related by not specifically related to flat assembler.

However here goes: I'm planning a library and one of my goals is portability through operating systems and hardware. Therefore my plan is to separate code in 2 blocks: one architecture (hardware) related and one platform (software/operating sytem) related. So the user loads an architecture related part of the library and another platform related part of the library to compose the final useable library. My first design decision was to separate them in include files. So if you wanted to use the library in a specific OS in a specific hardware you just include the necessary files. However, this could make the library inflexible as I am forcing a static library. So to make a dynamic library, I need to compile the library in a format so that the application can load it in run-time. One solution is to use the platform default dynamic library format (DLL in Win32, ELF .so in Linux, etc.), but it leads portability issues as the application needs to be big part re-coded to support the platform and I need to assemble the hardware specific code in every support platform specific dynamic library. Another solution is to use a standard dynamic library format for all platforms (for example ELF). The problem with this is writing an ELF loader for every platform (the hard part isn't multiple platforms but varios ELF standards for different architectures like ELF64, and therefore the question is what ELF to use and when). Another solution is to create a dynamic library format. This is probably the most flexible solution, however I feel like I am reinventing the wheel and like I'm forcing a new standard instead of supporting old standards, which is in my way of thinking the portability way; be compatible.

If you read up till here I would like to thank you. Although this may seem very personal and unrelated to everything else, I would like to ask your opinion and analysis in the design decisions to help me decide and that we could make this a constructive conversation. Sorry for taking up your time if you don't like my post and thank you very much for your time if you liked it. Again thank you,

JVFF

PS: Sorry for my bad english.
Post 09 Jul 2005, 04:02
View user's profile Send private message MSN Messenger Reply with quote
Kain



Joined: 26 Oct 2003
Posts: 108
Kain 09 Jul 2005, 06:23
It's going to be considerable difficult-impossible to make your library compatible between various hardware while still using FASM (x/86) assembly.

Your best bet in this situation is to use GAS, then work out the different operating system calls through conditional assembly to produce static or dynamic libraries supported by different vendors.

If you drop the architecture condition and stick with x/86, your job becomes a lot easier! Consider also that Apple is switching to x/86 processors so it becomes a simpler task of coding the various system calls for windows/linux/mac which will pretty much cover 99% of the desktop market.

_________________
:sevag.k
Post 09 Jul 2005, 06:23
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 10 Jul 2005, 22:46
Now when FASM has moved to 64bit, too - you should have your starting point set ready.

If you are thinking of a final executable, that every platform/OS combination can run, the the first part of it must be 100% compatible between them, but even BIOS's don't get close enought to this kind of interoperatability you are shorthanded. You must think of a code that on one machine runs as bytecode and on the other means nop's or sth...
...effectively skipping "wrong" parts until arriving at the "right" ones Neutral

Very Happy This gets philosophical
Post 10 Jul 2005, 22:46
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.