bootloader

Android Recovery升级原理

会有一股神秘感。 提交于 2019-11-30 01:23:06
摘要 Recovery模式指的是一种可以对安卓机内部的数据或系统进行修改的模式(类似于windows PE或DOS)。也可以称之为安卓的恢复模式,在这个所谓的恢复模式下,我们可以刷入新的安卓系统,或者对已有的系统进行备份或升级,也可以在此恢复出厂设置(格式化数据和缓存)。 1. Recovery相关概念 Recovery: Recovery模式指的是一种可以对安卓机内部的数据或系统进行修改的模式,也指Android的Recovery分区 OTA: Over-the-Air Technology,即空中下载技术,是 Android 系统提供的标准软件升级方式。 它功能强大,提供了完全升级、增量升级模式,可以通过 SD 卡升级,也可以通过网络升级。不管是哪种方式,都有几个过程:生成升级包、下载升级包、安装升级包。 RecoverySystem:Android系统内部实现的一个工具类,Android应用层操作Recovery模式的一个重要途径,它提供了几个重要的API,用于实现OTA包校验、升级以及恢复出厂设置(格式化数据和缓存)。 Main System:主系统模式,即Android正常开机所进入的Android系统 Bootloader:Bootloader是嵌入式系统在加电后执行的第一段代码,在它完成CPU和相关硬件的初始化之后

什么是STM32的ISP?

本秂侑毒 提交于 2019-11-29 23:26:05
上一篇笔记分享了STM32的串口IAP实例: STM32串口IAP分享 。其中,下载IAP程序时用 ISP 的方式进行下载。这里的ISP又是什么呢? ISP方式下载程序原理 ISP:In System Programing,在系统中编程 在STM32F10xxx里有三种启动方式: 以ISP方式下载程序时需要把STM32的 BOOT0 引脚置1、 BOOT1 引脚置0,即从系统存储区(System Memory)启动。为什么设置从System Memory启动就可以使用串口来下载我们的程序呢?那是因为在芯片出厂前ST官方已经把一段自举程序(BootLoader程序)固化到这一块存储区。对于STM32F103ZET6来说,System Memory的起始地址为0x1FFFF000,可在芯片手册的内存映射图里找到: 其通过串口来接收数据并烧写到 用户闪存存储器 的起始地址(0x08000000)。只能烧写到这个地址,若keil里设置的地址不是这个地址,则编译出来的文件将烧录不成功。 用户闪存,即User Flash,同时也称为Main Flash。 这一段 BootLoader 程序源码是没有开源出来的,用户是不可修改的。我们在上一篇笔记的IAP实验中,IAP程序通过 FlyMCU 软件进行烧录,烧录的地址就是 0x08000000 。 注意:不同系列不同型号的STM32固化的

(NASM) (80x86) Bootloader NEEDS xor ax, ax

主宰稳场 提交于 2019-11-29 15:09:07
I am learning how to make a bootloader from osdev. I'm using NASM to assemble my code, and a x86 machine to run my bootloader. This is a little piece of code which prints a character and enter in a infinite loop: BITS 16 xor ax, ax mov ah, 0x0E mov al, 0x41 int 0x10 jmp $ times 510-($-$$) db 0x00 db 0x55 db 0xAA My question is: why doesn't the code run when I comment the 'xor ax, ax' instruction? As you can see in the code above, the ax value is changed to store the interrupt parameters, so the code should run without the xor instruction... Extra notes: I'm assembly the code under Xubuntu with

Bootloader works in emulators but not on real hardware

主宰稳场 提交于 2019-11-29 12:30:56
I am writing a bootloader in assembly and it seems to work fine on qemu, bochs and virtualbox. However, it is not loading the kernel on real hardware (it seems). The bootloader starts off by writing a character to the video memory (for debugging), it then reads sector 2 off the drive and far jumps to the kernel. The kernel is then writing some characters to video memory. On a real machine, I see the character from the bootloader on the screen, and there it hangs (blinking caret). I have tried to set DS, ES, SI to zero, and I am also setting up a stack segment. I am reading sector 2 off of the

ARM bootloader: Interrupt Vector Table Understanding

谁都会走 提交于 2019-11-29 07:35:25
问题 The code following is the first part of u-boot to define interrupt vector table, and my question is how every line will be used. I understand the first 2 lines which is the starting point and the first instruction to implement: reset, and we define reset below. But when will we use these instructions below? According to System.map, every instruction has a fixed address, so _fiq is at 0x0000001C, when we want to execute fiq, we will copy this address into pc and then execute,right? But in

Debugging bootloader with gdb in qemu

我是研究僧i 提交于 2019-11-29 06:11:03
There seems to be a problem with the Freedos bootloader. (It appears that the bootcode can't find the kernel in certain circumstances.) So I'm trying to debug the bootloader in qemu with gdb. Following the instructions found on several wiki and freely available online course materials, I run qemu like this qemu-system-i386 -fda fdboot.img -boot a -s -S And then connect gdb like this $ gdb (gdb) target remote localhost:1234 I can step through the first 10 - 12 instructions with si which I assume is the SeaBIOS. But past that, when I try to step into bootloader code, it continues execution

How to make an bootable iso(not cd or flash drive) for testing your own boot loader?

▼魔方 西西 提交于 2019-11-29 03:43:10
问题 i am trying to write a boot loader(hello world sort). i am using Bochs for simulation (platform Linux-Ubuntu). But i am unable to make an bootable iso for my binary file. Though in tutorial VFD(virtual floppy disk) is used but it is for windows platform. Here is my code for bootloader ( just for testing) ;********************************************* ; Boot1.asm ; - A Simple Bootloader for testing if cd is booting or not ; ; Operating Systems Development Tutorial ;****************************

x86 NASM 'org' directive meaning

筅森魡賤 提交于 2019-11-29 01:39:32
I am following this tutorial as a first foray into bootloader/OS development for x86 using NASM: http://joelgompert.com/OS/TableOfContents.htm And I'm on Lesson 4, which is making my bootloader print the "Hello, world" string. I'm not understanding the meaning of the org instruction (directive?). As I understand it, org defines where the program being executed is loaded into memory. This is needed when using any sort of labels or relative addresses in the program. Suppose I have a string defined with a label like this in my program: szHello db 'Hello, world!', 0 And I then later try to

CentOS启动流程

点点圈 提交于 2019-11-28 23:56:03
CentOS启动流程 Step 1: POST 加电自检 此过程的就是为了检测一下外界的硬件设备是否能够正常运行,如CPU,内存设备,硬盘等等这些硬件设备是否可以正常工作。 完成这一任务的是在主板上的BIOS程序 Step 2: Boot Sequence 主要实现的功能是 选择要启动的硬件设备 ,选择了之后就可以读取这个设备上位于MBR里头的bootloader了。根据BIOS中对启动顺序的设定,BIOS自己会依次扫描各个引导设备,然后第一个被扫描到具有引导程序(bootloader)的设备就被作为要启动的引导设备。 Step3: Bootloader MBR分为三个部分 MBR(Master Boot Record) MBR记录一般是在磁盘 0 磁道 1 扇区,共512个字节。前446个字节是BootLoder,后 4*16 的 64 个字节是存放分区信息的,最后 2 个字节是校验信息,一般是 55AA MBR中的bootloader,bootloader提供一个菜单给用户,让用户去选择要启动的系统或不同的内核版本,然后把用户选择的内核版本加载至RAM中的特定空间,接着在RAM中解压、展开,而后把系统控制权移交给内核。 CentOS使用GRUB(grand uniform bootloader)引导, CentOS 7 使用 GRUB2,此前版本使用GRUB.

基于STM32的简易Bootloader实现

旧时模样 提交于 2019-11-28 15:11:55
一、背景   公司在开发一款智能眼镜,使用STM32L0系列芯片作为主控芯片,蓝牙连接,总体来说不是很复杂。在发给客户测试的时候发现了一些问题,需要重新更新程序。这在开发人员看来只要两三下的事情,在客户手里可能就是一个巨麻烦的事情。所以决定给设备添加在线升级功能,通过蓝牙将新的固件更新到主控芯片里,而bootloader就是OTA中不可或缺的一部分。 二、实现思路   bootloader其实就是一段启动程序,它在芯片启动的时候首先被执行,它可以用来做一些硬件的初始化,当初始化完成之后跳转到对应的应用程序中去。   我们可以将内存分为两个区,一个是启动程序区(0x0800 0000 - 0x0800 2000 )大小为8K Bytes,剩下的为应用程序区(0x0800 2000 - 0x0801 0000)。   芯片上电时先运行启动程序,然后跳转到应用程序区执行应用程序。 三、程序跳转   bootloader一个主要的功能就是首先程序的跳转。在STM32中只要将要跳转的地址直接写入PC寄存器,就可以跳转到对应的地址中去。 怎么实现呢?   当我们实现一个函数的时候,这个函数最终会占用一段内存,而它的函数名代表的就是这段内存的起始地址。当我们调用这个函数的时候,单片机会将这段 内存的首地址(函数名对应的地址)加载到PC寄存器中,从而跳转到这段代码来执行。那么我们也可以利用这个原理