어셈블리 프로그래밍에서 3-4 일 전입니다. 비디오 메모리에 문자열을 인쇄하고 qemu를 실행하려고합니다. 이 프로그램이 Hallo 세계를 인쇄 할 것으로 예상했습니다. 그러나 아무것도 인쇄하지 않습니다. qemu 창에 "하드 디스크에서 부팅 중 ..."다른 내용이 없습니다.비디오 메모리에 부트 로더 인쇄 0xb8000
부트 로더에서 16 비트 만 허용됩니까? 그렇다면 어떻게하면 MMIO를 할 수 있습니까? I는 실제 페이지 32 16 비트의 실제 모드 대 http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf
[bits 32]
[org 0x7c00]
loop:
mov edx, 0xb8000
mov ah, 0x0f
mov ebx, message
mov ecx, 0x0
call draw_string
;jmp self_loop
;jmp loop
self_loop:
jmp self_loop
; take the stream begining from ebx
draw_string:
mov al, [ebx]
mov ah, 0x0f
mov [edx], ax
add ebx, 1
add edx, 2
cmp al, 0
jne draw_string
ret
message:
db 'Hallo World', 0x0
times 510 -($ - $$) db 0 ; When compiled , our program must fit into 512 bytes ,
; with the last two bytes being the magic number ,
; so here, tell our assembly compiler to pad out our
; program with enough zero bytes (db 0) to bring us to the
; 510th byte.
dw 0xAA55 ; Last two bytes (one word) form the magic number ,
; so BIOS knows we are a boot sector.
이 작업을 수행 할 때는 보호 모드가 아닙니다. 그렇습니까? 세그먼트 화 된 주소 지정을 사용해야합니다. – Michael
보호 모드는 어떻게 지정합니까? 세그먼트 주소 지정은 어떻게 지정합니까? 나는'nasm -f bin file.asm -o file.bin'을 컴파일하고'qemu-system-i386 file.bin'을 가지고 컴파일하고있다. –