bootloader

关于8051的bootloader实现方式

馋奶兔 提交于 2019-12-15 20:58:04
一, 基本硬件需求 要实现IAP功能,需要51单片机可以在程序里修改代码空间的Flash,或者至少可以修改用户程序区的Flash,新出的51大部分都能满足这个要求 二, 空间划分 一般bootloader位于单片机代码空间的起始地址,用户程序在后面。这个需要根据实际的需求来决定,bootloader功能简单,就少占用一些,bootloader功能复杂的就多占用一些。除此之外,一般还要根据Flash的页为界线划分。附带的工程模板里,bootloader使用0x0000-0x0fff区间,用户程序使用0x1000以后的空间。 三, 中断的处理 51单片机的中断入口一般位于0地址开始的区间,无法修改,但是根据上面的空间划分方式,这个区间位于bootloader的范围,是不能随意更改的。所以代码里用了一个软件的方式对中断入口做了重映射处理,后面将结合具体的代码介绍实现方式。 四, Bootloader的处理 1, 建立工程的时候,选择把Startup.a51添加到工程 2, 在Startup.a51里添加如下代码: ORG 0003H LJMP 2003H ORG 000BH LJMP 200BH ORG 0013H LJMP 2013H ORG 001BH LJMP 201BH ORG 0023H LJMP 2023H …………………………. 根据具体型号的中断数量和地址

How are all disk sectors iterated in assembly?

╄→尐↘猪︶ㄣ 提交于 2019-12-14 04:17:28
问题 In the process of learning assembly, I am writing an OS. I have successfully written the code necessary for appending a second 512 byte sector to the initial 512 byte bootloader: %define KBDINT 0x16 %define VIDINT 0x10 %define DISKINT 0x13 %define TTYOUT 0x0E %define VIDMODE 0x0000 %define NUL 0x00 %define CR 0x0D %define LF 0x0A %define START 0x7C00 %macro PRINT 1 mov si, %1 call print %endmacro bits 16 ; 16 bit real mode org START ; loader start in memory start: jmp main print: jmp .init

ASM subroutine to print coloured text at specific location on the screen

ぐ巨炮叔叔 提交于 2019-12-14 02:40:17
问题 I'm trying to write some ASM code that will write some text to the display using BIOS interrupts. This code will run from the boot sector. I have msgText DB "Hello" ;Text msgCol DB 0x07,0x08,0x09,0x0A,0x0B ;Colours msgXY DW 0x0E26 ;Col/Row msgLen DB 0x05 ;Length The message is just "Hello", each letter having a different colour. The position of the message on the screen is roughly in the middle, and it has a length of 5. I want to write a function that will write any message/colour/xy/length

make bootloader and kernel into iso?

痴心易碎 提交于 2019-12-14 01:04:23
问题 how to create simple bootloader that load kernel into iso? it has been 5 days , I searching in google and do trial and error many times but got nothing.....I have tried many tutorial like mikeos,osdev,supernova,cosmos os but still get no solution..... my computer doesn't have floopy disk so I can't make bootloader using floopy disk... I see in mikeos tutorial first sector 512 byte is for bootloader and second for kernel can be made using imdisk but using floopy disk also he can made

How to auto boot a rooted android device on charging [code req]

☆樱花仙子☆ 提交于 2019-12-13 19:23:30
问题 How to auto boot a rooted android phone when it is dead and connected to the charger? I know many people think its not possible as when the device is OFF and ADB isn't running. But it turns out that it is possible to write an application for rooted device. There is an application for the same @playstore to do just that. I just want to make similar app. Any ideas or pointers? 回答1: You should google a bit i guess your looking for something similar to this? https://android.stackexchange.com/q

How to set ARM user app start address when using USB bootloader?

风流意气都作罢 提交于 2019-12-13 16:24:22
问题 Just picked up one of these ARM Cortex-M3 LPC1768 mini boards from eBay. It's basically a breakout board. However, based on what little documentation came with it, I've determined that it has a USB bootloader similar to that described by NXP's LPC1700 secondary USB bootloader (AN10866) app note. Both docs (the app note and board docs) indicate that user programs are to be built such that their starting address is 0x2000 . Because the USB bootloader is already at 0x0 and takes up 8K . Both

Code works on bochs but does not on real computer, x86 real mode

被刻印的时光 ゝ 提交于 2019-12-13 16:19:45
问题 This small piece of code works fine on bochs 2.6, but doesn't seem to work on 'real' computers (I've tried several of them). It seems like lodsb is causing the problem, since it worked fine, when I did hello world by printing the string "manually" character by character. .code16 .text .globl _start _start: movw $0, %ax jmp main ### DATA AND BUFFERS ### welcome: .asciz "welcome" main: movw $welcome, %si call print_string hang: jmp hang print_string: lodsb cmp $0, %al je done mov $0x0e, %ah int

Assembly 32-bit print to display code runs on qemu, fails to work on real hardware

岁酱吖の 提交于 2019-12-13 16:13:01
问题 I've written a small piece of code in x86 assembly language that runs on bare hardware which, at this point, goes as far as enabling protected 32-bit mode I've run into a problem, however, pertaining printing to the screen. I've read that to do so without interrupts one may load characters into a special memory region, namely RAM address 0xb8000. Knowing this, I wrote a function that does exactly that, and it proved a success when tested in qemu. However, and here comes the problem, when I

How to copy 9th sector to 1st sector?

北城余情 提交于 2019-12-13 16:05:39
问题 I'm creating custom mbr, something like mbr-lovenote and i can't create code that will copy 9th sector - (there is located original mbr) to 1st sector, i already tried take some code from mbr-lovenote and modify it, but i find out that code only load sector in memory and jump to it, but i have to copy it. I write my code, the code will be loaded from fist sector on PhysicalDrive0 , but i don't know why it doesn't works. ;---create buffer buffer db 512 ;---read sector - 9th mov ax, buffer ;ES:

How do I read/write (program) the MBR/VBR of a flash drive?

时间秒杀一切 提交于 2019-12-13 08:06:17
问题 I'm looking for a method of reading/writing (actually programming) the Master Boot Record (or maybe VBR) of a usb mass storage device. Actually its a flash drive whose MBR I want to program, so that whenever I plug it into any computer, a program (stored on my flash drive in a file) gets executed. I know quite a bit of assembly but I don't know how to go about programming MBRs.. Please help Thanks 回答1: If you're using linux, you can simple open the device file /dev/sdXY and write to it, the