Most C compilers can emit code that's not designed to run in the context of an OS (see the memtest86+
codebase for example), but that's going to severely limit the feature set provided by any of those compilers. (In particular, you're not going to get anything like malloc
).