我该如何开始写我自己的移动操作系统,ARM处理器? [英] How can I get started on writing my own mobile OS for ARM processors?

查看:120
本文介绍了我该如何开始写我自己的移动操作系统,ARM处理器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感兴趣的是创造我自己的移动操作系统。我读了现有的移动操作系统在ARM处理器上运行,并使用自己的汇编语言,而台式机的操作系统,如Linux和Windows都写在ASM。显示C是常见的两种语言。这使我一些问题:

I am interested in creating my own mobile OS. I read that the existing mobile OSes run on ARM processors and use their assembly language, while desktop OSes like Linux and Windows are written in asm. C appears to be a language common to both. This leads me to some questions:


  • 请我一定要学ARM汇编语言,如果我想建立自己的移动操作系统瞄准了ARM Cortex处理器?

如果是这样,那么一旦我开始这样做:

If so, then once I start doing it:


  • 在哪里/我怎么测试呢?它可以在虚拟机中运行?

  • 有喜欢的BeagleBoard板,但我不明白为什么我需要买他们,如果我可以使用一个虚拟机 - 我在这里失去了一些东西

  • 一个操作系统可以在x86和ARM?
  • 运行

我敢肯定,我希望建立一个移动操作系统,可以像极了现有的移动操作系统的做ARM处理器上运行。

I'm sure that I want to build a mobile OS which can run on ARM processors like most of the existing mobile OSes do.


  • 我应该我最初的步骤是什么?这将有助于看看开源项目,如Android或任何其他操作系统?

  • 我在哪里可以找到ARM汇编语言资源和IDE?

推荐答案

1)所需的所有平台上的一些组件,你可能需要一些启动code覆盖编程语言的假设,例如C编译器假定您已经设置堆栈(指针),并清零的.bss内存。数据是在正确的地方,等等。根据不同的处理器上,但通常,你可能需要一些code中断处理,也许任务开关等。

1) some assembly is required for all platforms, you probably need some startup code to cover the assumptions of the programming language, for example a C compiler assumes you have setup the stack (pointer), and zeroed out .bss memory, .data is in the right place, etc. Depending on the processor, but usually, you may need some code for interrupt handling, and maybe task switching, etc.

2)是有很多虚拟机,QEMU,skyeye的,等我有一个从琥珀项目上OpenCores的衍生的http:// github.com/dwelch67/amber_samples

2) yes there are many virtual machines, qemu, skyeye, etc. I have one derived from the amber project on opencores http://github.com/dwelch67/amber_samples

3)这是非常罕见的指令集仿真器或虚拟机等处理器完全匹配。正因为它的工作原理在虚拟机/ SIM卡并不意味着它的作品。没有比在一个调试器和调试器外运行code不同。你应该尝试不同的模拟器以及硬件验证模拟机的质量。一个ARM处理器到另一个或者一个86到另一个可以改变足以导致你失败​​的软件因此,即使在硬件上不是足够运行理清所有潜在的错误。

3) it is very rare that an instruction set simulator or virtual machine, etc exactly matches the processor. Just because it works on the vm/sim doesnt mean it works. No different than running code in a debugger and outside a debugger. You should try different simulators as well as hardware to verify the quality of the simulator. One arm processor to another or one x86 to another can vary enough to lead to your software failing so even running on hardware isnt enough to sort out all of your potential bugs.

4)Linux可以在许多平台上运行是吗? NetBSD的运行在更多的,是吗?这取决于你如何设计你的程序可以非常便携或无法移植或之间的任何地方。它是由你。

4) linux runs on many platforms yes? Netbsd runs on even more, yes? Depending on how you design your program it can be very portable or not portable or anywhere in between. It is up to you.

5)你需要一些操作系统的基础知识。也许得到的MicroC / OS-II的书或一些其他类似材料。通过任务切换等方面的基础行车。

5) You need some operating system basics. maybe get the MicroC/OS-II book or some other similar materials. Get through the basics of task switching, etc.

6)IDE的和编辑等都是一个非常个人的事情,人们最喜欢的人是别人厌恶。对于ARM开发,你需要获得ARM ARM(ARM体系结构参考手册)。曾经被一个单一的文件已经分裂,由于他们拥有这么多不同的内核和家庭。什么是最古老的期待之一的ARMv5 ARMv6的或ARM是曾经被认为是奇异的。把那一个,你至少可以写code,它是在整个系列ARM内核更便携。你会希望得到一些TRM的(技术参考手册)。获取一个用于ARM7TDMI(用于ARMv4T),它像英特尔获得486手册,因为pretty所有事情(32位ARM指令)兼容回​​到那个核心。大概想获得TRM的其他家庭。记者了解到,即使例如REV 1.0(r1p0)的旧版本可能会被标记为过时,如果有它ARM已经把它卖给别人有手动和它的一些芯片存在的地方,你可能需要知道的区别内核(如果你的目标紧密)。外围设备,如PL310二级缓存经常发现连接到某些内核,你可能会想知道什么是在那里,如果你在开启和使用缓存的兴趣。嗯,在ARM7(ARM版本,不要与ARMv7的混淆)没有MMU的,我觉得ARM9呢,所以这取决于你想如何管理应用程序和它们的内存,您可能希望使用ARM9什么新作为一个基准。

6) IDE's and editors, etc are a very personal thing, one persons favorite is loathed by others. For ARM development you need to get the ARM ARM (ARM Architectural Reference Manual). What used to be a single document has split due to them having so many different cores and families. What is the oldest looking one the ARMv5 or ARMv6 ARM is what used to be the singular one. Get that one and you can at least write code that is more portable across the whole family of arm cores. You will want to get some TRM's (Technical Reference Manuals). Get the one for the ARM7TDMI (ARMv4T), its like getting the 486 manual from intel, pretty much everything (32bit arm instructions) since is compatible back to that core. Probably want to get TRM's for other families. Understand that even though an older version for example a rev 1.0 (r1p0) might be marked as obsolete if there is a manual for it ARM has sold it to someone and it exists in some chips somewhere, and you might need to know the differences between cores (if you target that closely). Peripherals such as the pl310 L2 cache are often found attached to some cores, you will likely want to know what is in there if you have an interest in turning on and using the cache. Hmmm, the arm7 (ARMv4, not to be confused with the ARMv7) does not have an mmu, I think the ARM9 does, so depending on how you want to manage apps and their memory, you might want to use the ARM9 or something newer as a baseline.

得到codesourcery精简版基于GNU工具链。 codesourcery现在是Mentor Graphics公司的一部分。不难建立自己的交叉编译器,手臂或得到一些其他的(emdebian等)。 ARM成为一名优秀的编译器,但它是昂贵的,最支持将有代价的,当然一些网上google搜索的帮助来自他们,但最自由的帮助是基于GCC。 LLVM的编译工具每天都越来越好,他们从我的理解在iPhone上使用。我用铿锵编译器是LLVM的一部分。你没有必要建立一个交叉编译器开箱他们是从语言到中间交叉编译器为目标的汇编。装配和链接的目标是到主机,但你可以使用GNU binutils的汇编器和链接为最后一步。

get the codesourcery lite gnu based toolchain. codesourcery is now part of mentor graphics. It is not hard to build your own cross compiler for arm or get some other (emdebian, etc). ARM makes a good compiler but it is pricey and most support will come from them at a price, certainly some online googling for help but most free help is gcc based. the llvm compiler tools are getting better every day, they are used on iPhones from what I understand. I use the clang compiler which is part of llvm. You dont have to build a cross compiler necessarily out of the box they are a cross compiler from language to intermediate to target's assembly. assembling and linking is targeted to the host, but you can use the gnu binutils assembler and linker for that final step.

像IDE /编辑器,你的编程风格和preferences可能你瘦往一编译环境,另一些人。

Like the IDE/editor, your programming style and preferences might lean you toward one compile environment over another.

您可能会发现在github上我的手臂例子有用与否,他们是水平低,板带类的实例。大多是以拇指但一些手臂以及在可能的情况。

You might find my arm examples on github useful or not, they are low level, board bring up type examples. Mostly thumb based but some arm as well where possible.

这篇关于我该如何开始写我自己的移动操作系统,ARM处理器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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