flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Assembly and C++

Author
Thread Post new topic Reply to topic
SkiMask11



Joined: 06 Sep 2014
Posts: 8
SkiMask11
Can an assembly bootloader boot a visual C++ file? If so how would I be able too do that?
Post 14 Sep 2014, 04:57
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
Yes. The boot loader would need to be able to load the exe the same way as windows would by parsing its header and correctly allocating/unpacking the correct regions. This is easier with 64bit PIC code. The tricky part from the C++ side is the dependencies - you will have to either compile without stdlib/win API or implement your own replacements (Some VC libraries are standalone asm and can be used e.g. string.h memset/memcpy). In either case you will have to define some OS-specific layer to interact with the underlying core/system; this can be done by defining your C API in a header then implementing you code in an external asm COFF file that you link during your C build.

EDIT: I forgot to add for C++ specifically you will also have to provide the runtime handling for constructs such as new/delete operators (if you use them), try/catch and others [including runtime checks] but I suggest you avoid using these except for new/delete.
Post 14 Sep 2014, 11:19
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.