软件可以在裸机上执行吗?

标签 c linux-kernel machine-code

<分区>

我只是想知道,我们可以在没有操作系统的机器上执行程序吗?

另外,听说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/

相关文章:

linux - 为什么我不能在 Linux 2.6.26 中注册边沿触发中断?

assembly - JIT 跳转 (x86_64)

c - fork() 和父/子进程 ID

c - GLib v APR 各自的优缺点

C 创建一个 Bignum 矩阵

c++ - 与零比较时的 int 运算符 != 和 ==

linux - 在 Linux 下从十六进制文件创建可执行文件

c - 使用原子和 futexes 锁定代码时无法找到竞争条件

Linux:列出所有从磁盘上不再存在的可执行文件运行的正在运行的进程?

linux - Linux如何确定下一个PID?