freestanding

Is there a meaningful distinction between freestanding and hosted implementations?

≡放荡痞女 提交于 2019-12-28 02:13:08
问题 The question I have is mostly related to section four, paragraph six. The two forms of conforming implementation are hosted and freestanding. A conforming hosted implementation shall accept any strictly conforming program. As I understand, this constitutes the typical application environment, with filesystems, allocated memory and threads... A conforming freestanding implementation shall accept any strictly conforming program in which the use of the features specified in the library clause

How to compile for a freestanding environment with GCC?

旧街凉风 提交于 2019-12-18 02:24:07
问题 The code I'm working on is supposed to be possible to build for both hosted and freestanding environments, providing private implementations for some stdlib functions for the latter case. Can I reliably test this with just GCC on a normal workstation/build server? Compile for freestanding environment with GCC The "-ffreestanding" option looked promising, but it seems that it "only" disables built-ins and sets the STDC_HOSTED macro properly, it still provides all system headers. The option "

Call assembly procedure from another assembly file?

删除回忆录丶 提交于 2019-12-11 02:06:04
问题 Just a simple question: Let's say I had the following two assembly programs: 1: add10: add eax, 10 ret ;call add5 from other file 2: add5: add eax, 5 ret ;call add10 from other file Could I call add10 (declared in the first file) from the second file, or vice-versa? If so, how can it be done? (even if it isn't feasible) NOTE: This will be running on bare metal, not on any fancy NT calls! Thanks. Edit: I'm using NASM on Windows. 回答1: If both files are linked into the same executable, yes.

Custom memory allocator for real-mode DOS .COM (freestanding) — how to debug?

女生的网名这么多〃 提交于 2019-12-10 11:44:44
问题 A little background first: stumbling upon this blog post, I learned it was possible to create DOS .COM files with the GNU linker and it's not even rocket science. Using clang and the -m16 switch (creating real-mode compatible 32bit code by prefixing 32bit instructions accordingly), this worked out quite well. So I had the idea to try implementing just enough runtime to get a little curses game I wrote recently to compile to a .COM and run in real-mode DOS. The game is small enough so that

Freestanding GCC and builtin functions

痞子三分冷 提交于 2019-12-09 00:52:20
问题 The GCC docs at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html say (under -ffreestanding ) that a freestanding environment implies -fno-builtin . I might be misunderstanding exactly what a freestanding environment is or how it works, but it seems to me that, since the builtins usually emit inline code instead of calling the library function, this is ideal for a freestanding environment where the standard library may be missing functionality or even missing entirely. So why would we

Freestanding GCC and builtin functions

谁都会走 提交于 2019-11-30 22:49:31
The GCC docs at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html say (under -ffreestanding ) that a freestanding environment implies -fno-builtin . I might be misunderstanding exactly what a freestanding environment is or how it works, but it seems to me that, since the builtins usually emit inline code instead of calling the library function, this is ideal for a freestanding environment where the standard library may be missing functionality or even missing entirely. So why would we not want to use the biltins with a freestanding environment? Konstantin Vladimirov In freestanding mode

How to compile for a freestanding environment with GCC?

荒凉一梦 提交于 2019-11-28 23:10:19
The code I'm working on is supposed to be possible to build for both hosted and freestanding environments, providing private implementations for some stdlib functions for the latter case. Can I reliably test this with just GCC on a normal workstation/build server? Compile for freestanding environment with GCC The "-ffreestanding" option looked promising, but it seems that it "only" disables built-ins and sets the STDC_HOSTED macro properly, it still provides all system headers. The option "-nostdinc" is too restrictive; I still want to use the headers required for a freestanding implementation