<分区>
我只是想知道,我们可以在没有操作系统的机器上执行程序吗?
另外,听说Linux内核是用C语言写的,开机就运行一个内核,所以我就想知道电脑不编译怎么理解这门语言?
<分区>
我只是想知道,我们可以在没有操作系统的机器上执行程序吗?
另外,听说Linux内核是用C语言写的,开机就运行一个内核,所以我就想知道电脑不编译怎么理解这门语言?
最佳答案
来自维基百科:
When a computer is first powered on, it does not have an operating system in ROM or RAM. The computer must initially execute a small program stored in ROM along with the bare minimum of data needed to access the nonvolatile devices from which the operating system programs and data are loaded into RAM. The small program that starts this sequence of loading into RAM, is known as a bootstrap loader, bootstrap or boot loader. This small boot loader program's only job is to load other data and programs which are then executed from RAM.
计算机可以理解 Linux 内核,因为它已经被编译并(通常)存储在磁盘上。引导加载程序为计算机提供足够的功能来将预编译的内核加载到内存中。
您无需加载整个操作系统即可在计算机上运行程序,您可以编写引导加载程序来启动您已编译的程序。您将无权访问任何使程序员的生活更轻松的操作系统调用。
关于软件可以在裸机上执行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2099869/