Can I execute any c made prog without any os platform?

后端 未结 9 667
失恋的感觉
失恋的感觉 2021-01-30 23:46

I googled about it and somewhere I read ....

Yes, you can. That is happening in the case of embedded systems

I think NO, it\'s not poss

9条回答
  •  星月不相逢
    2021-01-31 00:38

    Usually, any C program will have a variety of system calls which depend on the operating system. For example, printf makes a system call to write to the screen buffer. Opening files and things like that are also system calls.

    So basically, you can run the C code which just gets compiled and assembled in to machine code on a processor, but if the code makes any system calls, it would just freeze up the processor when it tries to jump to a memory location that it thinks is the operating system. This of course would depend on your being able to get the program running in the first place, which is not easy without the operating system as well.

提交回复
热议问题