小编Rog*_*ier的帖子

MBR从DOS启动

对于一个项目,我想直接从DOS调用第一个硬盘上的MBR.我编写了一个小的汇编程序,它将MBR加载到内存中0:7c00h,远远超过它.我把我的util放在(DOS)可启动软盘上.我正在尝试启动的磁盘(HD0,0x80)上有一个TrueCrypt启动加载程序.当我在此设置中运行该工具时,它会显示TrueCrypt屏幕,但输入密码后会崩溃系统.当我在普通的WinXP机器上运行我的小功能(w00t.com)时,它似乎立即崩溃.

显然我忘记了BIOS通常会做的一些关键事情,我猜这是微不足道的.有更好的裸机DOS和BIOS经验的人可以帮助我吗?

继承我的代码:

.MODEL tiny
.386
_TEXT SEGMENT USE16

INCLUDE BootDefs.i

ORG 100h

start:
    ; http://vxheavens.com/lib/vbw05.html
    ; Before DOS has booted the BIOS stores the amount of usable lower memory 
    ; in a word located at 0:413h in memory. We going to erase this value because
    ; we have booted dos before loading the bootsector, and dos is fat (and ugly).

    ; fake free memory  
    ;push ds
    ;push   0
    ;pop        ds
    ;mov        ax, TC_BOOT_LOADER_SEGMENT / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED …
Run Code Online (Sandbox Code Playgroud)

assembly bootstrapping truecrypt bare-metal bootloader

6
推荐指数
1
解决办法
1272
查看次数