이 질문은 이전에 물어 보았지만 다른 대답으로는 제 문제가 해결되지 않은 것 같습니다. 어쩌면 내가 놓친 것일까?부트 로더가 실제 컴퓨터에서 작동하지 않습니다.
QEMU에서 실행했기 때문에 .iso가 작동한다는 것을 알고 성공적으로 작동했습니다. 그래서 내가 뭘 잘못하고 있니?
bits 16
xor ax, ax
start:
cld ; Set direction flag to forward
; Set up registers
mov ax, 07c0h ; Segment location which BIOS loads
add ax, 288 ; (4096 + 512)/16 bytes
mov ss, ax ; Sets stack segment register
mov sp, 4096 ; Sets stack pointer register (offset of stack)
mov ax, 07c0h
mov ds, ax ; Sets data segment to where we're loaded
mov si, text ; Puts string into source index
call print_string ; Calls print string
jmp $ ; Infinite loop to prevent shutdown
print_string:
mov ah, 0eh ; System call for printing
xor bh, bh ; Sets BH register to 0
.repeat:
lodsb ; Loads byte into AL
cmp al, 0 ; Sees if AL is 0
je .done ; Jumps to done if AL is zero
int 10h ; Otherwise, print
jmp .repeat ; Repeat
.done:
ret
text db 'Test', 0
times 510 - ($ - $$) db 0 ; Pads 510 - (current location - start location) zeros
dw 0xAA55 ; Standard PC boot signature (takes up 2 bytes)
편집 : 나는 내 코드에 다음을 추가했습니다 : iso 파일을 만들기위한
xor ax, ax
cld
xor bh, bh
, 나는 다음과 같은 명령을 실행에 iso 파일 굽기
dd if=/dev/zero of=floppy.img bs=1024 count=1440
dd if=bootloader.bin of=floppy.img seek=0 count=1 conv=notrunc
mkdir iso
cp floppy.img iso/
mkisofs -o file.iso -b floppy.img iso
을 내 usb, 다음 명령을 실행합니다 :
umount /dev/sdX
dd if=/home/mint/Downloads/file.iso of=/dev/sdX bs=4M && sync
실제 컴퓨터에서 ".iso"를 부팅하려면 정확히 무엇을하고 있습니까? –
_LODSB_를 사용하여 정방향을 사용하므로 _CLD_로 방향 플래그를 앞으로 설정할 수 있습니다. 당신은 당신의 coe에 도달하기 전에 BIOS가 어떤 방향으로 설정했는지 보장 할 수 없습니다. –
[Int 10h/ah = 0eh] (http://www.ctyme.com/intr/rb-0106.htm)의 경우 BH 레지스터를 0으로 설정하면 쓰기 위해 페이지 번호로 사용되기 때문에 . –