Android手机关闭状态和启动进程 - Android在关闭时执行电源吗? -- boot 领域 和 power-on 领域 android 相关 的问题

Android Phone Off State and Boot process - Does Android consume power when switched off?


简体版||繁體版
1
vote

问题

中文

我很好奇地在细节之后"关闭" 状态和启动过程。 我在这个主题上发现了一些很好的文章: http://www.lieberbiber.de/2015/07 / 05 / mediatek-redist-little-kernel / 但是我仍然没有完全清楚的是什么是完全的过程。

我知道基本引导序列是:

  • boot rom
  • 预加载器
  • 小核(LK)
  • 然后它可能分成前进:
    • 下载模式(例如,在示例的三星设备的情况下)
    • fastboot模式或
    • 恢复或
    • 正常启动(启动Android启动本身)

但是当我们关闭时,手机真的关闭,插入电池? 我知道Android真的被关闭,但是手机完全有关软件级别吗? 随着上面链接的文章所说,小内核正在做充电动画, 或者在按键时选择下一个引导映像(恢复,fastboot,正常启动等)。

所以我的问题是:当手机关闭时,我们按下电源按钮是硬件 从零(从引导ROM)或此时,启动靴子的启动 已经完成了处理引导ROM,预加载器和加载 小内核也在看着关键新闻事件?

对我来说并不清楚,因为我也检查了小核的源代码 并且有一些键盘ckecking例程例如进入恢复模式。

提前感谢!

欢呼!

英文原文

I am curious about the "turned off" state and the boot process after that in details. I found some good articles on this topic like this one: http://www.lieberbiber.de/2015/07/05/mediatek-details-little-kernel/ but it's still not completely clear to me what's the exact process.

I know that the basic boot sequence is:

  • Boot ROM
  • Preloader
  • Little kernel (LK)
  • And then it may split into going to:
    • Download mode (in case of a Samsung device for example)
    • Fastboot mode or
    • Recovery or
    • Normal boot (starting Android boot itself)

But is the phone really off when we turn it off and the battery is inserted? I know that Android is really shut down but is the phone completely off regarding the software level? As the article linked above says, the little kernel is doing the charging animation, or selects the next boot image when pressing the keys (recovery, fastboot, normal boot, etc).

So my question is: when the phone is off and we press the power button is it the hardware which starts the boot really from zero (from the boot rom) or at this point the phone has already been finished with processing the boot rom, the preloader and loading the little kernel as well which is watching the key press events?

It's not clear to me because I checked the source code of the little kernel as well and there are some keyboard ckecking routines for example to enter to recovery mode.

Thanks in advance!

Cheers!

     
 
 

回答列表

0
 
vote

澄清

你在帖子的每个部分询问不同的东西。标题询问"在关闭时android消耗电源?" 但后部后部询问"正在观看关键的新闻事件?" ,有几个不同的在两者之间的问题,这会对可能的回答者添加进一步的分心和混淆...

无论如何,我猜它都归结为:"一旦一个Android手机关闭,它会在每个适当情况下启动一个过程?" 。

背景

要回答这个问题,我必须带你甚至更低的电子设备级别: hardware
你可以争辩,

"你在说什么?!在没有软件的情况下,硬件就没有了!必须在那里观看按钮输入,我只是询问它是什么"

请耐心等待。很快就能到那里。

"但是......!"

相信我。此外,您可能需要提醒自己对"软件" 和"硬件" 的定义,因为我们即将深入进入如此低的水平。

我想知道你是否曾用 Arduino 一起玩过,那些再键盘按钮输入并放置华而不实的LED输出。作为其中一个设备中的大脑工作的芯片称为"MCU" 或"微控制器" 。包括Android设备在内的计算机 - 配备了以下几种。每个固件/ ROM芯片,BIOS芯片或任何可编程IC都可能是另一个微控制器。

简单答案

与CPU相比,这些MCU非常简单,但更强大和节能。因此,MCU通常用于帮助CPU为他们设置件事。他们如何工作?基本上,它们只是根据固件如何在ROM内编程。

"哈,所以它只是靴子rom,不是吗?你可以刚才说!" 嗯,你必须知道更多的是要更好地了解你的每个哦的答案 - 这么多的问题。

更深的解释

关键字是 interrupt sleep mode (后者的术语可能会有所不同)。

(错误)示例

固件可以以芯片不断查看外部输入的方式编码。但是,这不是理想的方式。芯片将不得不检索按钮的状态,比较它是<代码> on 还是 off ,然后计算最多50ms左右。现在回检索状态,等等。 Poweroff State可以持续时间,天甚至几年 - 所有的虽然不知数是穷人的小芯片是它是否再次发光的那一刻,但是

抱歉,这有点令人不安。如果有帮助,存在危机不是唯一的问题。即使芯片要积极工作,每个闪烁也花费了宝贵的资源!

中断

Interrupt 按其他方式转换。它更像是给主计算部分的通知。一个具有能力的MCU,基本上每一个现代人都是用他们推开的程序准备好的程序。忘记以前忘记了什么,执行特定功能来响应中断信号,然后返回他们之前正在执行的任务。这样,MCU不必积极地,反复计算检索&amp;比较集。在典型的Android设备的情况下,您可以分配 [power applied/removed on the charger pin] 的中断, [power applied/removed on the charger pin] [power button pressed]

睡眠模式

你可能会问,

"好的,soooo ......现在MCU不必受到负担,它可以愉快地睡觉?"

哈!没有。

......好吧。 MCU可以睡在那里。

实际上我想评论这是,不要引用我,但是,他们在睡眠时啜饮的是什么,应该与电池自放电相当。 此时,这里有这么涉及的软件,我会说那些在这一点上运行的软件都纯粹在硬件中实现 - 但这只是我的意见,我不认为自己足够的专家,以让你必须相信。

闭合

所以,基本上,在Poweroff状态时,Boot ROM是勉强运行,电池消耗量是minuscule。 当唤醒时,所有它要做的就是打电话 Arduino0 a d /或告诉 Arduino1 关于发生的事情。我不确定更深的细节;我不知道,但我愿意说它应该是依赖的。

清除UPS

我猜这一点,应该回答你的主要问题。
以下是您的其他问题的答案。

android 关闭时消耗电源?

no
它不是Android OS的任何部分("正常启动" ,您表示)消耗电源。

android 消耗电源关闭时?

但勉强。
请注意,可以额外的功耗来运行其他部件,特别是RTC(实时时钟)模块。

但是当我们关闭时,手机真的关闭,插入电池?我知道Android真的被关闭,但是手机完全脱离了软件级别吗?

no 但几乎。

当手机关闭时,我们按下电源按钮就是它的硬件,它真正从零(从引导ROM)开始的硬件,或者此时手机已经完成了处理引导ROM,预装器和加载小内核,也看着关键的新闻事件?

更像以前
除Boot ROM之外不断运行但勉强。

希望你能更好地了解一切现在如何运作!

*注意:大多数Arduino板有两个MCU,一个在中心,另一个用于控制USB接口。

 

Clarification

You're asking different things in each part of the post. The title asks "Does Android consume power when switched off?" but the latter part of the post asks "which is watching the key press events?", with a few different questions in between, which adds further distractions and confusions to the possible answerers...

Anyhow, I guess it all boils down to: "Once an Android phone is turned off, what wakes it up to start a process in each appropriate situations?".

Backgrounds

To answer this, I'll have to take you to even lower level of an electronic device: hardware.
You may argue,

"What are you talking about?! A hardware is nothing when there's no software! Something HAS to be there watching the button input and I'm simply asking what that could be".

Be patient, please. Well get there soon.

"But...!"

Believe me. Besides, you might need to remind yourself of the definition of 'software' and 'hardware' now, since we're about to dive deep into such a low level.

I wonder whether you've ever played with an Arduino, those little boards that get clicky button inputs and put flashy LED outputs. A chip working as the brain in one of these devices* is called an 'MCU', or a 'microcontroller'. A computer - including Android devices - is equipped with a few of these. Every firmware/ROM chips, BIOS chips, or any programmable ICs is likely another microcontroller.

Simple Answer

These MCUs are quite simple compared to CPUs, but more robust and energy-efficient. For this reason, MCUs are often used to aid CPUs to set things up for them. How do they work? Essentially, they behave just according to how a firmware is programmed inside the ROM.

"Ha, so it's simply the Boot ROM, isn't it? You could have just said so!" Well, you'll have to know a bit more to understand better to get an answer for each of your oh-so-many questions.

Deeper Explanation

The keywords are interrupt and sleep mode (the terminology of the latter may vary).

(Wrong) Example

The firmware could be coded in a way that the chip would constantly be looking at the external inputs. However, this is not the ideal way. The chip will have to retrieve the state of a button, compare whether it's on or off, and then count up to 50ms or so to simply wait. Now back to retrieving the state, and so on. The poweroff state could last hours, days, or even years - all the while unbeknownst to the poor little chip is whether the moment for it to shine again would ever come...

Sorry, that was a little bit disturbing. The existential crisis is not the only problem though, if that helps. Even if the chip were to be actively working, each glancing costs valuable resource as well!

Interrupt

Interrupt works the other way round. It's more like giving a notification to the main computational part. An MCU with the capability, essentially every modern one, is prepared with a procedure where they could push away & forget whatever they were up to before, execute a specific function to respond to the interrupt signal, and then get back to the task they were doing before. This way, an MCU doesn't have to actively, repeatedly compute a retrieval & comparison set. In the case of a typical Android device, you could assign interrupt for [power applied/removed on the charger pin], [power applied/removed on the charger pin] and [power button pressed].

Sleep Mode

You may ask,

"Okay, sooo... now that MCU doesn't have to be burdened with that, it could happily sleep?"

HA! No.

...well yes. MCU could just sleep there.

Actually what I want to remark here is that, don't quote me on this but, what they sip when they sleep should be comparable to self discharge of a battery. At this point, there's so little software involved here that I would say those running at this point are all purely implemented in the hardware - but that's just my opinion and I don't consider myself expert enough to get you necessarily convinced.

Closure

So, basically, when in the poweroff state, Boot ROM is barely running that battery consumption is minuscule. When awakened, all it has to do is to call Preloader and/or to tell LK about what happened. I'm not sure of even deeper details; I have no idea but I'm willing to say it should be implementation dependent.

Clear Ups

I guess at this point, your main question should be answered.
Followings are answers to your other questions.

Does Android consume power when switched off?

No.
It is not any part of the Android OS ("Normal boot", you said) that consumes power.

Does Android consume power when switched off?

Yes but barely.
Note that there could be additional power consumption to run other parts, notably RTC (Real Time Clock) module.

But is the phone really off when we turn it off and the battery is inserted? I know that Android is really shut down but is the phone completely off regarding the software level?

No but almost.

when the phone is off and we press the power button is it the hardware which starts the boot really from zero (from the boot rom) or at this point the phone has already been finished with processing the boot rom, the preloader and loading the little kernel as well which is watching the key press events?

More like former.
Except Boot ROM is constantly running but barely.

Hope you got better idea about how everything works now!

*Note: Most Arduino boards have two MCUs, one in the center and the other to control the USB interface.

 
 
   
   

相关问题

1  我的手机的电源按钮变坏了。我可以用我的电脑发送USB命令以启动手机吗?  ( My phones power button has gone bad can i use my computer to send a usb comman ) 
我有一部旧电话:一个HTC Wildfire S.一切正常,除了电源按钮已经变坏。可以以某种方式通过USB连接从我的电脑开始电话吗? ...

1  有没有办法在HTC Desire HD上安排Hibernate /关闭?  ( Is there a way to schedule hibernate shut down on an htc desire hd ) 
我打算得到困倦,这是一种舒适的耳机,我插入我的HTC Desire HD。我会播放音乐,让我进入睡眠(希望)最多60分钟。 有没有办法Hibernate / Shutdown手机在90分钟后说出每天凌晨2点,以节省电力? ...

32  当我的手机关闭时报警工作吗?  ( Does the alarm work when my phone is turned off ) 
如果我之前关闭手机,警报仍会关闭吗? 示例:当我有低电量时,我必须睡觉并在x点醒来,周围没有充电器。 我应该关闭手机吗? 注意:如果它有任何不同,我的手机是Galaxy跑步froyo ...

1  标签2 10.1继续开启  ( Tab 2 10 1 keeps turning on ) 
我买了一个Galaxy Tab 2 10.1去年,它一直很棒。然后我在另一天注意到我试图关掉平板电脑(通过按住电源黄油),它只是回收并重新接通。它会去睡眠模式,但它不会完全关闭。我认为最新的更新可能已经与此有关。想到任何人? ...

5  关闭屏幕没有Android睡觉  ( Turn screen off without android sleeping ) 
是否有任何方法可以在不制作Android睡眠状态的情况下快速切换屏幕? 例如,我有时喜欢在睡觉时使用平静的应用程序。但它一直保持屏幕。当我只使用该应用程序10分钟时,它会保持屏幕;但是,如果我睡了几个小时,我希望应用程序继续运行(发出声音)并关闭屏幕。 如何完成? ...

-2  是否可以使用应用程序禁用电源按钮切换电话?  ( Is it possible to use an app to disable the power button from switching the phon ) 
是否可以拥有Android应用程序,使得如果用户启动它,则通过按下侧按钮,手机不会关闭?这意味着关闭它的唯一意味着它将取下电池,并在此处占用用户的所有权限并不是一个问题。 ...

-1  联想S6000 - 连接充电器后自动开机[复制]  ( Lenovo s6000 auto power on after connecting charger ) 
这个问题已经在这里有答案: 充电器连接时自动电源启动Android (7个答案) ...

3  电源按钮缺陷:如何转动设备  ( Power button defect how do i turn my device on ) 
最近我的电源按钮停止工作,这意味着它不接受任何输入。使用CyanogenMod,很容易在通知区域中添加易于访问的按钮,以关闭屏幕。 然而,我担心将来关闭手机的时间(可能通过0%电池电量)。如何打开设备? 我犹豫了打开设备(以前做过的),因为这种情况相同。我不确定按钮是否可修复,因此我非常希望有一个备份计划将其重新打开...

1  nexus 5x无法打开  ( Nexus 5x wont turn on ) 
我的nexus 5x开始引导,但现在它根本不会打开。我注意到电池膨胀,所以我用我在亚马逊上购买的新电池更换它。我整夜都给了它,但它仍然无法打开。我已经尝试过不同的关键组合并持有它们各次,仍然没有。我把它插入电脑,什么都没有。我安装了adb,它没有在键入 adb devices 时列出我的设备 (我没有能够将其进入F...

4  如何安排计时器电源打开和关闭设备?  ( How can i schedule timer to power on and off device ) 
有没有办法调度计时器电源打开和关闭设备? 示例每日电源8AM并在10点处关闭电源。 ...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有