bootloader

Implement custom u-boot command

百般思念 提交于 2020-07-03 13:18:10
问题 I want to add custom command command to u-boot be it a simple hello world command. After searching I found this link Yocto u-boot Custom Commands where it says to look at timer command in cmd/misc.c as starting point. How do I bring this timer command to my u-boot image? I assume I have make changes to the makefiles but not sure which makefile I should edit. I am using qemu to test the u-boot image in Ubuntu 18.04 using the following method Cloned the u-boot source from github. Installed all

Changing to “Unreal” mode, processor crash

邮差的信 提交于 2020-05-25 07:25:10
问题 I am writing a simple bootloader. Its main task is to load a kernel, and switch processor into unreal mode. My problem is when i turn on Unreal mode, the processor crashes. Here's my code (Some code used from MikeOS). I use NASM. BITS 16 jmp short bootloader_start ; Jump past disk description section nop ; Pad out before disk description ; ------------------------------------------------------------------ ; Disk description table, to make it a valid floppy ; Note: some of these values are

Changing to “Unreal” mode, processor crash

℡╲_俬逩灬. 提交于 2020-05-25 07:24:40
问题 I am writing a simple bootloader. Its main task is to load a kernel, and switch processor into unreal mode. My problem is when i turn on Unreal mode, the processor crashes. Here's my code (Some code used from MikeOS). I use NASM. BITS 16 jmp short bootloader_start ; Jump past disk description section nop ; Pad out before disk description ; ------------------------------------------------------------------ ; Disk description table, to make it a valid floppy ; Note: some of these values are

Cannot call real mode C function from bootloader (NASM + GCC toolchain)

北城余情 提交于 2020-05-15 06:56:05
问题 I am attempting to write my own OS kernel, and have been having some issues getting the linking to work properly between my bootloader and (what will soon be) my kernel (written in C). I have the following code... src/bootloader.asm ; Allows our code to be run in real mode. BITS 16 extern kmain section .text global _start _start: jmp Start ; Moves the cursor to row dl, col dh. MoveCursor: mov ah, 2 mov bh, 0 int 10h ret ; Prints the character in al to the screen. PrintChar: mov ah, 10 mov bh,

Optimizing an incrementing ASCII decimal counter in video RAM on 7th gen Intel Core

无人久伴 提交于 2020-05-08 09:40:48
问题 I'm trying to optimize the following subroutine for a specific Kaby Lake CPU (i5-7300HQ), ideally to make the code at least 10 times faster compared to its original form. The code runs as a floppy-style bootloader in 16-bit real mode. It displays a ten digit decimal counter on screen, counting 0 - 9999999999 and then halting. I have taken a look at Agner's Optimization Guides for Microarchitecture and Assembly, Instruction Performance Table and Intel's Optimization Reference Manual. Only

How to Solve 'bootloader.asm:30: error: TIMES value -44 is negative' Problem in NASM

一个人想着一个人 提交于 2020-04-07 10:29:22
问题 I'm developing a Hello World kernel and bootloader...I wrote this code but when I try to compile it via NASM It says : "bootloader.asm:30: error: TIMES value -44 is negative". bootloader.asm: [BITS 16] [ORG 0x7C00] MOV DL, 0x80 MOV DH, 0x0 MOV CH, 0x0 MOV CL, 0x02 MOV BX, 0x1000 MOV ES, BX MOV BX, 0x0 ReadFloppy: MOV AH, 0x02 MOV AL, 0x01 INT 0x13 JC ReadFloppy MOV AX, 0x1000 MOV DS, AX MOV ES, AX MOV FS, AX MOV GS, AX MOV SS, AX JMP 0x1000:0x0 TIMES 510 - ($ - $$) db 0 DW 0xAA55 kernel.asm:

ARM-Linux开发与MCU开发有何不同?下篇

感情迁移 提交于 2020-04-02 16:27:32
ARM-Linux开发与MCU开发有何不同?下篇 (4)固件的存储位置不同 单片机:通常具备片内flash存储器,固件程序通常存储在该区域,若固件较大则需要通过外部电路设计外部flash用于存储固件。 ARM-Linux: 由于其没有片内的flash, 并且需要运行操作系统,整个系统映像通常较大,故ARM-Linux开发的操作系统映像和应用通常存储在外部的MMC、SD卡上,或者采用SATA设备等。 (5)启动方式不同 单片机:其结构简单,内部集成flash, 通常是芯片厂商在程序上电时加入固定的跳转指令,直接跳转到程序入口(通常在flash上);开发的应用程序通过编译器编译,采用专用下载工具直接下载到相应的地址空间;所以系统上电后直接运行到相应的程序入口,实现系统的启动。 ARM-Linux:由于采用ARM芯片,执行效率高,功能强大,外设相对丰富,是功能强大的计算机系统,并且需要运行操作系统,所以其启动方式和单片机有较大的差别,但是和家用计算机的启动方式基本相同。其启动一般包括BIOS,bootloader,内核启动,应用启动等阶段; (a)启动BIOS: BIOS是设备厂家(芯片或者是电路板厂家)设置的相应启动信息,在设备上电后,其将读取相应硬件设备信息,进行硬件设备的初始化工作,然后跳转到bootloader所在位置(该位置是一个固定的位置,由BIOS设置)。(根据个人理解

LBDP-Z bootloader在线升级指南

不打扰是莪最后的温柔 提交于 2020-03-30 08:17:59
LBDP-Z可支持STM32通过无线模块实现在线升级,在代码校验后进行升级操作。 因无线传输可能发生丢包,因此需要多次发送(目前尝试5次)。 step 1:准备升级包 启动SCP软件,将编译好的升级包(本例中为ledPrj_app_1847.hex)复制到网关/root/目录,改名为“ledPrj_app.hex”,如下图所示: step 2:确认灯具板在bootloader模式: 灯具板上电,crt终端界面显示bootloader版本信息,以"boot_"开头。 step 3:启动升级命令: 在系统管理->软件升级的操作界面上,输入需要升级的灯具板地址,点”升级“按钮,crt终端界面显示升级信息,如下图所示: 升级完成后,自动运行APP程序,如下图所示: 点”检查标记“按钮,crt终端界面显示升级标记信息,如下所示: 退出APP程序 点”清除标记“按钮,crt终端界面显示升级标记被清除的信息,如下所示: 灯具板再次上电,crt终端界面又会显示bootloader版本,如下所示: 来源: https://www.cnblogs.com/shlb/p/12596397.html

Problem with BIOS INT 13H (Read Sectors From Drive)

让人想犯罪 __ 提交于 2020-03-22 06:25:43
问题 Description: In my efforts to create a simple standalone program I have written a simple boot loader in the first sector. Its purpose is to load the program into memory. For this purpose I am using INT 13h with AH=2. The code is: disk_load: push dx ; Store DX on stack so later we can recall how many sectors were requested to be read, ; even if it is altered in the meantime. mov ah, 0x02 ; BIOS read sector. mov al, dh ; Read DH sectors. mov ch, 0x00 ; Select cylinder 0. mov dh, 0x00 ; Select

GPRS网络(Air202/SIM800)升级STM32: 测试STM32远程乒乓升级,基于(GPRS模块AT指令TCP透传方式),定时访问升级

醉酒当歌 提交于 2020-03-20 09:08:49
前言 上节实现远程更新是更新的STM32F103C8T6的单片机 GPRS网络(Air202/SIM800)升级STM32: 测试STM32远程乒乓升级,基于(GPRS模块AT指令TCP透传方式),定时访问升级 这节将告诉大家如何移植到其它型号的单片机. 这一节以 STM32F103RET6 (512KB Flash 64KB RAM) 为例 我使用我的这块板子      大家测试的时候可以按照下面的方式接到自己的GPRS模块(Air202 / SIM800)   单片机串口1 接到GPRS的AT指令配置串口   单片机引脚PB2 接到GPRS的复位引脚 直接上菜 一,由于是移植的F103系列所以BootLoader程序咱可以不用移植,直接先拷贝过去    二,调整下Flash的分配   2.1 自己自行调整哈,不过要注意最好设置成2的倍数因为512KB的Flash单片机都是以2KB作为一页    三,其它大家应该知道的配置(以下根据自己使用的芯片选择)             四,编译下载,看下打印的信息   user1ROMStart: 0x8004000 //用户程序1开始的地址   user1ROMSize : 0x3d000 //用户程序1大小 249856字节 == 244KB   user2ROMStart: 0x8041000 //用户程序2开始的地址