如何运行无操作系统的程序? [英] How to run a program without an operating system?

查看:189
本文介绍了如何运行无操作系统的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么运行的程序全部由自己没有操作系统运行?

您可以创建汇编程序计算机可以加载并在启动时运行,例如从闪存驱动器启动计算机并运行程序,它是驱动器上?


解决方案

  

你怎么运行的程序全部由自己没有操作系统运行?


您将您的二进制code到处理器会换一个地方重新启动(在ARM例如地址为0)。


  

您可以创建一个计算机可以加载并在启动时运行的汇编程序(例如,从闪存驱动器启动计算机并运行程序,它是驱动器上)?


一般问题的答案:它可以做到的。
它经常下文称作为裸机编程。
从闪存驱动器中读取,你想知道什么是USB,你希望有一些驱动程序使用该USB工作。这个驱动器上的程序也必须是在某些特定的格式。在一些特殊的文件系统......这是一件平常的引导加载程序做的。
许多ARM板,让你做一些这些事情。有些人的引导装载程序,以帮助您基本设置。

这里你可以找到如何伟大的教程做树莓PI Basic操作系统。

编辑:
这篇文章,整个wiki.osdev.org将ANWER大部分的问题
http://wiki.osdev.org/Introduction

另外,如果你不想直接在硬件上做实验,你可以运行它使用类似QEMU管理程序的虚拟机。请参阅如何运行的Hello World直接在虚拟化的ARM硬件的这里

How do you run a program all by itself without an operating system running?

Can you create assembly programs that the computer can load and run at startup, e.g. boot the computer from a flash drive and it runs the program that is on the drive?

解决方案

How do you run a program all by itself without an operating system running?

You place your binary code to a place where processor looks for after rebooting (e.g. address 0 on ARM).

Can you create assembly programs that the computer can load and run at startup ( e.g. boot the computer from a flash drive and it runs the program that is on the drive)?

General answer to the question: it can be done. It's often reffered to as "bare metal programming". To read from flash drive, you want to know what's USB, and you want to have some driver to work with this USB. The program on this drive would also have to be in some particular format. On some particular filesystem... This is something that usually boot loaders do. Many ARM boards let you do some of those things. Some have boot loader to help you with basic setup.

Here you may find great tutorial of how to do basic operating system on Raspberry PI.

Edit: This article, and the whole wiki.osdev.org will anwer most of your questions http://wiki.osdev.org/Introduction

Also, if you don't want to experiment directly on hardware, you can run it as a virtual machine using hypervisors like qemu. See how to run "hello world" directly on virtualized ARM hardware here.

这篇关于如何运行无操作系统的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆