单个开发人员是否可以为 Android 手机编写一个简单的移动操作系统?

发布于 2024-08-20 12:36:28 字数 111 浏览 6 评论 0原文

作为一个单独的开发人员,我是否可以为 Android 手机编写一个操作系统,该操作系统可以使用徽标打开,并有一个简单的屏幕键盘用于文本输入,接收文本命令并可以自拍并保存它们? 我该如何构建它以及需要多长时间?

Is it possible for me as a single developer to write an OS for Android phones that can turn on with a logo and have a simple onscreen keyboard for text input which receives text commands and can take selfies and save them?
How do I go about building it and how long might it take?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

萌吟 2024-08-27 12:36:28

如果你的意思是从头开始:这当然是可能的。但这需要大量的人力资源:-)。手机制造商通常有数百名程序员,但软件却常常充满错误:-)。

简单地说,手机中通常有两个软件模块:

  • “UI OS”,用于处理显示、声音和用户输入。
  • 处理移动网络通信的“基带操作系统”。

UI 操作系统可以是 Linux 或更简单的操作系统。普通的 Linux 内核可以轻松地在几乎所有现代手机上运行。

第二部分是基带操作系统。这部分通常需要实时属性才能处理与移动网络的通信,因为在特定“时隙”中发送数据时定时需要精确。

只有一个问题:你需要找到一款“开放硬件手机”来安装操作系统。电信运营商通常要求对当今的手机采取严格的安全措施,因此很难在市场上的手机上编写自己的操作系统。此外,您还需要访问电路板原理图、芯片详细信息等,但这是不会发生的:-)。

一个想法可能是 OpenMoko,它是一个“开放电话项目”: http://wiki.openmoko.org/wiki /Main_Page 或 Google Android 项目。

此外,当今手机中使用的 CPU(例如 TI OMAP)通常可以通过开发板获得,例如 http://www.igep-platform.com/index.php?option=com_content&view=article&id=46&Itemid=55

这里的缺点是该板不包含基带芯片来处理移动网络的通信。

编辑:
关于构建和运行手机软件。手机启动时发生的情况显然取决于硬件平台,但可能会发生类似的情况(对于大多数嵌入式系统也是如此):

  1. ASIC(包含 CPU)启动,重置自身并开始执行所谓的引导带(硬编码到 ASIC 中)。
  2. 引导程序尝试设置连接到 ASIC 的闪存芯片。
  3. 引导程序将 SW 从闪存加载到芯片的 SRAM(ASIC 芯片上的集成 RAM)中。
  4. SRAM 中的软件设置 SDRAM(时序等)并将“操作系统”(或您想要的任何软件)从闪存加载到 SDRAM 中。
  5. SRAM中的SW将CPU中的内部指令指针设置到SDRAM,从而ASIC的CPU核开始在SDRAM中执行。
  6. SDRAM 中的软件(“操作系统”)设置定时器、中断、内存管理或任何需要的东西。
  7. 软件可以是任何东西,无限的 for 循环,完整的操作系统,或者只是一个将某些 LED 拉高或拉低的软件。

如果 ASIC 具有 NOR 闪存,则它可以直接执行,而无需先将 SW 上传到 SDRAM。

SDRAM 中的操作系统可以是普通的 Linux 内核。 Linux 内核唯一需要的是一些信息块,例如内存大小、该内存的物理位置等(一种方法是使用 ATAG 列表)。当然,它还需要了解 ASIC 的一些内部结构,这将被添加到 Linux 内核中。但目前市场上的大多数芯片已经存在于 Linux 内核中。例如,诺基亚为 TI OMAP3430 适配贡献了大量代码,这可以在内核源代码本身(arch/目录或类似目录)中看到。我不确定诺基亚的哪些手机使用该芯片,但可能是高端 Linux 和 Symbian 手机。

给出比上面更详细的答案需要几页纸,所以你最好的选择是使用你在 SO 上得到的答案,并尝试使用它从其他地方获取更多信息。

祝你好运 :-)

If you mean from scratch: it would certainly be possible. But it requires a lot of human resources :-). Manufactures of mobile phones often have hundreds of programmers, and yet the SW it often filled with bugs :-).

Simplifying things you could say that there's often two SW modules in a mobile phone:

  • The "UI OS" which handles display, sound and user input.
  • The "Baseband OS" which handles communication towards the mobile network.

The UI OS could be for example Linux or something simpler. A vanilla Linux kernel can easily run on almost any modern mobile phones.

The second part is the baseband OS. This part usually requires real time properties to be able to handle communication with the mobile network as the timing needs to be precise when sending data in specific "time slots".

There's only one catch: you need to find a "open hardware mobile phone" where to put the OS on. Telecom operators often require rigorous security measures on todays phones so it's very hard to program your own OS on a phone out on the market. Also you would need access to the circuit board schematics, chip details and so on, which is not going to happen :-).

One idea could be OpenMoko which is a "open phone project": http://wiki.openmoko.org/wiki/Main_Page or the Google Android project.

Also, the CPU:s used in todays phones, such as TI OMAP, are often available via development boards such as http://www.igep-platform.com/index.php?option=com_content&view=article&id=46&Itemid=55

The down thing here is that the board does not contain a baseband chip to handle communication towards the mobile network.

Edit:
About building and running SW for mobile phones. What happens in the startup of a mobile phone depends on the hardware platform obviously but something like this could happen (this is also true for most embedded systems):

  1. ASIC (which contains the CPU) starts up, resets itself and starts executing a so called boot strap (hard coded into the ASIC).
  2. The boot strap tries to set up flash chips connected to the ASIC.
  3. The boot strap loads SW from the flash into the SRAM of the chip (Integrated RAM on the ASIC silicon).
  4. The SW in SRAM sets up the SDRAM (timings et c) and loads the "OS" (or whatever SW you would want) into the SDRAM from the flash.
  5. The SW in SRAM sets the internal instruction pointer in the CPU to the SDRAM and thus the CPU core of the ASIC starts executing in the SDRAM.
  6. The SW in the SDRAM ("The OS") sets up timers, interrupts, memory management or whatever is needed.
  7. The SW could be whatever, an unlimited for loop, a full blown OS, or just a SW pulling some LED's hi or low.

If the ASIC would have a NOR flash it could execute directly without first uploading the SW into the SDRAM.

The OS in the SDRAM could be a vanilla Linux kernel. The only thing the Linux kernel would need is a few information blocks such as memory size, physical location of that memory and so on (one way is using an ATAG list). Of course it would also need to know some of the internals of the ASIC, this would be added to the Linux kernel. But most chips out on the market today exist in the Linux kernel already. Nokia has for example contributed a lot of code to the TI OMAP3430 adaption and this can be seen in the kernel source code itself (arch/ directory or similar). I am not certain which phones from Nokia uses this chip, but it's probably the high-end Linux and Symbian phones.

Giving a more detailed answer than above would require a few pages, so your best bet would be to use the answers you got on SO and try to use it to get more information from elsewhere.

Good luck :-)

黑凤梨 2024-08-27 12:36:28

如果您不想从头开始,Android 也是开源的。否则,您需要查找手机架构的文档。您有特定的手机需求吗?

Android is also open source, if you're not looking to start from scratch. Otherwise, you'll need to find documentation for your phone's architecture. Do you have a particular phone in mind?

心病无药医 2024-08-27 12:36:28

我认为,如果没有有关您希望运行它的设备的详细信息,您自己会很困难。但如果您仍然想尝试...

Symbian刚刚开源了他们的整个移动操作系统。这可能是一个很好的起点。

I think it would be difficult on your own, and without detailed information regarding the devices you expect to run it on. But if you still want to try...

Symbian have just open sourced their entire mobile operating system. That might be a good place to start.

人间不值得 2024-08-27 12:36:28

希望这更多的是幻影,而不是幻影威胁(badoom-tish),但是这个人正在编写自己的移动操作系统,您可能会发现该网站很有趣。

Hopefully this is more Phantom and less Phantom Menace (badoom-tish) but this person is writing their own mobile operating system and you might find the website interesting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文