answersLogoWhite

0


Best Answer

Yes and No.

Unix and Linux Kernel code is written such that it is not dependent on external libraries. Thus, it can run without an OS - it is, in effect, the OS. The same goes for any OS Kernel. It has enough code to load device drivers and execute some form of initialization program.

The Linux kernel is executed by a bootloader, which is generally written in assembly or very low-level c, and must be told the location of the kernel, or the location of a 2nd-stage bootloader which is smart enough to "find" the kernel. An example of the former type is LILO, an example of the latter type is GRUB.

Beyond this, higher-level C programs must execute within the scope of a running kernel, which provides such functions as I/O access, Network access, etc. If you "kill" the kernel, then no applications are able to continue running, although kernels do have debug modes, which are mini-kernels that provide enough functionality to trace back the cause of a problem.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you run a c or c program without an OS if yes how if no then where is unix or Linux code running?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why is Linux popular in academia?

Students understand the source code for the operating system and how Linux works without complications.


Why Linux popular in academia?

Students understand the source code for the operating system and how Linux works without complications.


Does machine operation generate odject code during assembly?

You cannot generate machine code from assembly language without running a program (an assembler). Therefore the machine that generates the machine code must be operational and must be running an assembler program that is appropriate to the target platform. The machine code output from the assembler can then be loaded onto the target platform and executed.


What is the emerge command in Linux?

emerge is a Gentoo-specific command that downloads the source code to a program and compiles it.


Why is Linux referred to as open-source software?

Linux is referred to as "open-source" precisely because it is. Open-source is the ability for anyone to view the code necessary to make the program. The Linux kernel, and most of the programs that are available for it, have their source code available, under a variety of licenses.


Is c program works without main function?

yes a C program can work without a main() function. Though its not the normal C code that you would be writing on ur gcc or turbo C compiler. for example Linux Source code ... does not have a main() function : for details u can visit: http://samarthonweb.blogspot.com/2009/08/c-programe-with-no-main-function.html


Where can you get source code of Linux?

The source code for the Linux kernel is hosted at kernel.org.


What is static testing?

Its like testing a car without running it. Testing the code without actually running it. Code reviews by peers, checklist are popular techniques.


How do you program an RCA universal remote without a program code?

how to program my tv with the RCA D 770 - universal remote control which has no code search button


How do you convert C source code into a screensaver for Linux?

Most screensavers on Linux are modules run by Xscreensaver: http://en.wikipedia.org/wiki/XScreenSaver I don't know exactly how to convert a program to a module, check the Xscreensaver documentation.


What Visual Basic command terminates a running program?

...the END statement. Example code... END


Is there any software for running a c plus plus codes in Linux obuntu?

C++ source code cannot be run, it must be compiled and linked to produce an executable. Linux has many compilers available, with gcc being one of the most popular.