How do you create a freestanding C++ program?

后端 未结 7 1018
予麋鹿
予麋鹿 2021-02-02 02:11

I\'m just wondering how you create a freestanding program in C++?

Edit: By freestanding I mean a program that doesn\'t run in a hosted envrioment (eg.

7条回答
  •  名媛妹妹
    2021-02-02 02:57

    Have a look at this article:

    http://www.codeproject.com/KB/tips/boot-loader.aspx

    You would need a little assembly start-up code to get you as far as main() but then you could write the rest in C++. You'd have to write your own heap manager (new/delete) if you wanted to create objects at runtime and your own scheduler if you wanted more than one thread.

提交回复
热议问题