本文介绍了如何将第二阶段Bootloader复制到软盘或Cd(Iso)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Hello Friends, 我开发了第二阶段bootloader,我正在尝试将其复制到软盘img但是每次我从这个图像第一阶段bootloader工作正常,但没有加载第二阶段bootloader。 谁能告诉我怎么做, 我通过CD和El-torito使用软盘模拟没有软盘模拟 我的操作系统:Linux 汇编程序:Nasm 用于测试:虚拟盒子 Thnx提前:) 这里是我的代码 位 16 org 0 jmp loader 打印: lodsb 或al,al jz pdone mov啊,0eh int 10h jmp print pdone:ret loader: mov si,msg 调用print cli hlt msg db 准备加载操作系统......, 13 , 10 , 0 解决方案 + start DB 0 bpbBytesPerSector:DW 512 bpbSectorsPerCluster:DB 1 bpbReservedSectors:DW 1 bpbNumberOfFATs:DB 2 bpbRootEntries:DW 224 bpbTotalSectors:DW 2880 bpbMedia:DB 0xF0 bpbSectorsPerFAT:DW 9 bpbSectorsPerTrack:DW 18 bpbHeadsPerCylinder:DW 2 bpbHiddenSectors:DD 0 bpbTotalSectorsBig:DD 0 bsDriveNumber:DB 0 bsUnused:DB 0 bsExtBootSignature:DB 0x29 bsSerialNumber:DD 0xa0a1a2a3 bsVolumeLabel:DB MOS FLOPPY bsFileSystem:DB FAT12 msg db 原始消息, 0 succmsg1:d b 驱动器存在, 0 succmsg2:db Extensions Present, 0 succmsg3:db Dap Readed, 0 ackmsg1:db 错了!!!, 0 errmsg1 db 错误:Drive Absent, 0 errmsg2 db 扩展缺席, 0 errmsg3 db DAP读取错误, 0 driveno:db 0 result :times 30 db 0 ;忽略此dap表 DAP: DAP_Size db 10h; 1h DAP_Res1 db 0 ; 2h DAP_Bytes2Transfer db 1h; 3h DAP_Res2 db 0 ; 4h DAP_Buff_Addr1 dw 0000h; 6h DAP_Buff_Addr2 dw 1000h; 8h DAP_LBA dq 1h; 9h 打印: lodsb 或al,al jz pdone mov ah,0eh int 10h jmp print pdone:ret nlin: mov ah,0eh; 设置 BIOS子功能 mov al,0x0A;将换行符移至 al int 10h; Interupt ... ret;返回 loader: xor ax,ax mov es,ax mov ds,ax mov啊,0h mov dl,[driveno] int 13h jnc succdd mov si,errmsg1 call print int 19h succdd: mov si,succmsg1 call print call nlin mov ax,1000h mov es,ax xor bx,bx mov al, 1 mov ch, 0 mov cl, 2 mov dh, 0 mov dl,[driveno] int 13h jc hlt mov ax, 00h int 16h jmp 1000h: 0000 hlt: mov si,errmsg3 电话打印 cli hlt 次 510 - ( - )db 0 dw 0xaa 55 位 16 org 0 jmp loader 打印: lodsb 或al,al jz pdone mov ah,0eh int 10h jmp print pdone:ret loader: mov si,msg call print cli hlt msg db 准备加载操作系统...... , 13 , 10 , 0 Hello Friends, i've developed a second stage bootloader and i'm trying to copy it to floppy img but it wont works every time i boot from this image the 1st stage bootloader works fine but doesn't load the second stage bootloader.can anyone tell me how to do it,i'm using floppy emulation through CD and El-torito for no floppy emulationMy OS: Linuxassembler: Nasmfor testing: Virtual BoxThnx in advance :)here is my codebits 16org 0jmp loaderprint:lodsbor al,aljz pdonemov ah,0ehint 10hjmp printpdone:retloader:mov si,msgcall printclihltmsg db "Preparing to load operating system...",13,10,0 解决方案 +start DB 0bpbBytesPerSector: DW 512bpbSectorsPerCluster: DB 1bpbReservedSectors: DW 1bpbNumberOfFATs: DB 2bpbRootEntries: DW 224bpbTotalSectors: DW 2880bpbMedia: DB 0xF0bpbSectorsPerFAT: DW 9bpbSectorsPerTrack: DW 18bpbHeadsPerCylinder: DW 2bpbHiddenSectors: DD 0bpbTotalSectorsBig: DD 0bsDriveNumber: DB 0bsUnused: DB 0bsExtBootSignature: DB 0x29bsSerialNumber: DD 0xa0a1a2a3bsVolumeLabel: DB "MOS FLOPPY "bsFileSystem: DB "FAT12 "msg db "Raw msg",0succmsg1: db "Drive is Present",0succmsg2: db "Extensions Present",0succmsg3: db "Dap Readed",0ackmsg1: db "Goes Wrong!!!",0errmsg1 db "Error:Drive Absent",0errmsg2 db "Extension Absent",0errmsg3 db "Error in DAP read",0driveno: db 0result: times 30 db 0;Ignore this dap tableDAP: DAP_Size db 10h ;1h DAP_Res1 db 0 ;2h DAP_Bytes2Transfer db 1h ;3h DAP_Res2 db 0 ;4h DAP_Buff_Addr1 dw 0000h ;6h DAP_Buff_Addr2 dw 1000h ;8h DAP_LBA dq 1h ;9hprint:lodsbor al,aljz pdonemov ah,0ehint 10hjmp printpdone:retnlin: mov ah, 0eh ; Set BIOS subfunction mov al, 0x0A ; Move newline to al int 10h ; Interupt... ret ; Returnloader:xor ax,axmov es,axmov ds,axmov ah,0hmov dl,[driveno]int 13hjnc succddmov si,errmsg1call printint 19hsuccdd:mov si,succmsg1call printcall nlinmov ax,1000hmov es,axxor bx,bxmov al,1mov ch,0mov cl,2mov dh,0mov dl,[driveno]int 13hjc hltmov ax,00hint 16hjmp 1000h:0000hlt:mov si,errmsg3call printclihlttimes 510-(-) db 0dw 0xaa55bits 16org 0jmp loaderprint:lodsbor al,aljz pdonemov ah,0ehint 10hjmp printpdone:retloader:mov si,msgcall printclihltmsg db "Preparing to load operating system...",13,10,0 这篇关于如何将第二阶段Bootloader复制到软盘或Cd(Iso)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-01 23:37