有没有API/代码可以检查Android手机的bootloader是否已解锁?
我有一个用汇编编写的第一阶段引导加载程序。我需要它从 dvd(或 cd)加载第二阶段引导加载程序。我只找到了从 floopy 或 hdd 读取的示例。那里使用的中断是 13h。在中断描述中,它说它可以读取软盘和硬盘。我曾尝试使用 13h 来读取 CD,就好像它是软盘一样,但它不起作用。
问题:软盘和 DVD 之间有区别吗(在访问它们的意义上),我可以使用 CHS(磁头,磁头,扇区)吗,它的扇区大小是多少,我可以使用 13h 指令正确读取 DVD。也许一些例子。我查看了 LILO 的源代码,发现那里只有 13h,所以它必须工作。谢谢。
刚刚从eBay上购买了这些ARM Cortex-M3 LPC1768迷你主板之一.它基本上是一个突破板.
但是,基于它带来的小文档,我已经确定它有一个类似于恩智浦 LPC1700辅助USB引导加载程序(AN10866)应用笔记所描述的USB引导加载程序.
这两个文档(应用笔记和电路板文档)都表明要构建用户程序,使其起始地址为0x2000.因为USB引导加载程序已经是0x0并占用8K.
这两个文档还显示了如何在Keil uVision中执行此操作的屏幕截图(请参阅应用说明的第14页),但我计划使用GNU工具链(Yagarto + Eclipse + OpenOCD).
在使用GNU工具链进行编译时,如何指定起始地址0x2000,以便它能够与USB引导程序一起正常工作?
我一直在用头撞墙,试图理解为什么以下程序集没有正确转储“HELLO_WORLD”的内容。
; Explicitly set 16-bit
[ BITS 16 ]
[ ORG 0x7C00 ]
; Create label for hello world string terminated by null.
HELLO_WORLD db 'hello world', 0
start:
; Move address of HELLO_WORLD into si
mov SI, HELLO_WORLD
call print_string
; Continue until the end of time
jmp $
print_string:
loop:
; Retrieve value stored in address at si
mov al, [SI]
mov ah, 0x0E
cmp al, 0
; Finish execution after hitting null terminator
je return …Run Code Online (Sandbox Code Playgroud) 在QEMU中诊断引导加载程序代码?
我试图创建一个最小的“引导程序代码”,该代码打印字符“ A”,然后停止。
我为此编写了以下C ++程序
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
/*
* If I run these code directly in Windows, it crashes, for I believe Windows
* do not allow accessing the BIOS directly, that make sense
*
* But I can compile a binary, then I can use the debugger to view what machine code
* does these correspond to, and build to boot program!
*/
/*
__asm
{
mov ah, 0x0e …Run Code Online (Sandbox Code Playgroud) 我试图从Bootloader编写引导加载程序。写的代码是
BITS 16
start:
mov ax, 07C0h ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we're loaded
mov ds, ax
mov si, text_string ; Put string position into SI
call print_string ; Call our string-printing routine
jmp $ ; Jump here - infinite loop!
text_string db 'This is my cool …Run Code Online (Sandbox Code Playgroud) 我正在尝试学习操作系统的工作方式。这是我要解决的一个容易的任务:编写一个简单的引导程序,提示用户输入他的名字并打印欢迎消息,例如“ hello,>> name <<”-之后,它什么也不做。
如果minix 3与qemu此相关,我正在与一起运行。我只是将asm文件dd及其前512个字节编译为/dev/c0d0(的虚拟硬盘minix)。
我可以打印消息并打印用户输入的内容。但是,此后我没有设法打印用户名。
这是我的汇编代码:
[bits 16]
[org 0x7c00]
mov si, HelloString
call print_string
mov di, name
call read_name
mov si, name
call print_string
read_name:
read_char:
mov ah, 0h ; read character from keyboard
mov [di], ah ; save it in the buffer
inc di ; next char
int 0x16 ; store it in AL
cmp ah, 0x0d ; check for enter
je stop_reading
mov …Run Code Online (Sandbox Code Playgroud) 因此,我阅读了有关处理器模式的信息,然后知道虚拟实模式允许实模式应用程序(例如DOS应用程序,例如BIOS程序)在受保护模式的操作系统中运行。
因此,我的问题是当前系统是否首先以实模式加载,然后再提供更多保护或直接将其保护为虚拟实模式,因为否则,我们必须创建一个从实模式开始的multiboot引导加载程序,然后跳转到虚拟模式。虚拟实模式难道不容易吗?
我有一个每磁道有 63 个扇区的磁盘。(我假设,根据我的观察)我想使用 int 13h 读取 16 位引导加载程序上的扇区。例如,如果我想读取扇区号 63,我将执行以下操作:
mov dl,0x80;Drive number
mov dh,0 ;This is head number/platter number
mov ch,0 ;This is cylinder number
mov cl,63 ;Sector number
mov ah,0x02 ;interrupt function
mov al,1 ;Number of sectors to be read
xor bx,bx
mov es,bx ;Making es=0
mov bx,0x8000 ;Any random buffer address
int 0x13
Run Code Online (Sandbox Code Playgroud)
上面的代码按预期工作。
现在我想读取扇区 64。我相信它将是柱面 0,磁头 1,扇区 1。我使用:
mov dl,0x80;Drive number
mov dh,1 ;This is head number/platter number
mov ch,0 ;This is cylinder number
mov cl,1 ;Sector …Run Code Online (Sandbox Code Playgroud) 我希望你们度过了愉快的一天。我有一个关于将程序集编译为.bin. 我正在尝试使用这篇文章来修复它,但即便如此,我还是得到了`relocated truncation to fit: 16 against '.text'。
bootReal.s :
#generate 16-bit code
.code16
#hint the assembler that here is the executable code located
.text
.globl _start;
#boot code entry
_start:
jmp _boot #jump to boot code
welcome: .asciz "Hello, World\n\r" #here we define the string
.macro mWriteString str #macro which calls a function to print a string
leaw \str, %si
call .writeStringIn
.endm
#function to print the string
.writeStringIn:
lodsb
orb %al, %al
jz .writeStringOut …Run Code Online (Sandbox Code Playgroud)