bootloader

STM32F4 Jump to Bootloader via SoftReset and without BOOT0 and BOOT1 Pin

丶灬走出姿态 提交于 2019-12-10 10:11:20
问题 i ask because of an answer to a similar quastion which can be found here: Jump to Bootloader in STM32 through appliction i.e using Boot 0 and Boot 1 Pins in Boot mode from User flash The User "JF002" @JF002 answered "When I want to jump to the bootloader, I write a byte in one of the backup register and then issue a soft-reset. Then, when the processor will restart, at the very beginning of the program, it will read this register. This register contains the value indicating that it should

NASM - Load code from USB Drive

≯℡__Kan透↙ 提交于 2019-12-09 19:03:02
问题 Would any assembly gurus know the argument (register dl ) that signifies the first USB drive? I'm working through a couple of NASM tutorials, and would like to get a physical boot (I can get a clean one with qemu). This is the section of code that loads the "kernel" data from disk: loadkernel: mov si, LMSG ;; 'Loading kernel',13,10,0 call prints ;; ex puts() mov dl, 0x00 ;; The disk to load from mov ah, 0x02 ;; Read operation mov al, 0x01 ;; Sectors to read mov ch, 0x00 ;; Track mov cl, 0x02

How to write on hard disk with bios interrupt 13h

折月煮酒 提交于 2019-12-09 07:57:12
问题 I want to copy my boot loader to first sector(512) of hard disk within itself (I should use bios interrupt 13h) and I found this code: mov bx, buffer1 ; set BX to the address (not the value) of BlahBlah mov ah,03h ;When ah=, int13 reads a disk sector mov al,5 ;Al is how many sectors to read mov cl,0 ;Sector Id mov dh,0 ;Head mov dl,80h ;Drive (0 is floppy) mov cx,512 ;One sector /2 mov ah, 0x3 ; set function 2h int 0x13 bu it does not work! 回答1: Your code is very messy. In order to properly

Real Mode Assembly: Print Char to Screen without INT Instruction on Boot

不羁岁月 提交于 2019-12-09 06:53:39
问题 The following site "Writing Boot Sector Code" provides a sample of code that prints 'A' to the screen when the system boots. From what I have been reading don't you have to use INT opcode to get BIOS to do certain things? How does the code below, from the site referenced above work without using interrupts? What portion of code actually tells the hardware to print 'A' to the screen? Code in question: .code16 .section .text .globl _start _start: mov $0xb800, %ax mov %ax, %ds movb $'A', 0 movb

No bootloader found on bootable medium

巧了我就是萌 提交于 2019-12-08 22:14:27
I'm currently playing with mkisofs, dd and assembly. I've created simple bootloader: BITS 16 ;------------------- ;SIMPLE BOOTLOADER ;------------------- start: mov ax, 0x07C0 mov ds, ax mov si, welcmsg call printstr mov ah, 0Eh mov al, 65 int 10h cli; hlt; printstr: pusha mov ah, 0Eh .loop: mov al, byte [ds:si] cmp al, 0 jz .end int 10h inc si jmp .loop .end: popa ret ;------------------- ;DATA ;------------------- welcmsg: db "Welcome!", 0x0D, 0x0A, 0 ;------------------- ;FILL ;------------------- times 510-($-$$) db 0 dw 0xAA55 I've compiled it on linux using NASM. After successful

What is a “Javascript Bootloader”?

半腔热情 提交于 2019-12-08 19:28:45
问题 I have seen this mainly in the source of Facebook Bootloader.setResourceMap({"bMxb7":{"name":.... What is exactly a bootloader in javascript? What is its use and purpose? 回答1: Generally speaking, the bootloader is a (relatively) small amount of code responsible for establishing the environment that all subsequent code requires to run, as such it is also the the first code to be executed. It's usually restricted to OSes, but makes sense for FB too. In the case of Facebook, the bootloader will

How to compile a Rust kernel with an Assembly (NASM) bootloader

旧城冷巷雨未停 提交于 2019-12-08 12:50:59
问题 I have a simple 2-stage bootloader written in NASM, and I want to continue the OS kernel using Rust. So I created a nightly Rust project with Cargo, and disabled std in the src/main.rs file. Now I am trying to link the Assembly files with the Cargo project, but without any success. How should I compile and link the NASM bootloader with the Rust kernel? 回答1: After a couple of hours I compiled the code. The solution was (like Michael Petch suggested), to compile the assembly code into static .o

Compiling and linking NASM and 64-bit C code together into a bootloader [duplicate]

江枫思渺然 提交于 2019-12-08 07:14:20
问题 This question already has an answer here : Relocation error when compiling NASM code in 64-bit mode (1 answer) Closed last year . I made a very simple 1 stage bootloader that does two main things: it switches from 16 bit real mode to 64 bit long mode, and it read the next few sectors from the hard disk that are for initiating the basic kernel. For the basic kernel, I am trying to write code in C instead of assembly, and I have some questions regarding that: How should I compile and link the

How can I use one function from main application and bootloader? (embedded)

人盡茶涼 提交于 2019-12-08 07:01:26
问题 First of all I need to say I develop application for embedded device based on cortex m4. I have functions that are common for bootloader and main application. For now I compile source files 2 times once for bootloader and app. But I am running short on space for dual bank dfu and I would like to have those functions only once in ROM. Any idea how can I achieve this? EDIT: Using functions pointers maybe danger in some cases, check on my problems - Using pointer functions - 2 seperate

Printing a string in assembly using no predefined function

别等时光非礼了梦想. 提交于 2019-12-07 20:50:15
问题 I have to define a function in assembly that will allow me to loop through a string of declared bytes and print them using a BIOS interrupt. I'm in 16 bit real mode. This is an exercise on writing a little bootloader from a textbook, but it seems that it was only a draft and it's missing some stuff. I have been given the following code: org 0x7c00 mov bx, HELLO_MSG call print_string mov bx, GOODBYE_MSG call print_string jmp $ ;hang so we can see the message %include "print_string.asm" HELLO