No bootloader found on bootable medium

被刻印的时光 ゝ 提交于 2019-12-23 02:45:36

问题


I'm currently playing with mkisofs, dd and assembly. I've created simple bootloader:

BITS 16
;-------------------
;SIMPLE BOOTLOADER
;-------------------
start:
    mov ax, 0x07C0
    mov ds, ax

    mov si, welcmsg
    call printstr

    mov ah, 0Eh
    mov al, 65
    int 10h

    cli;
    hlt;    

printstr:
    pusha
    mov ah, 0Eh
    .loop:
        mov al, byte [ds:si]

        cmp al, 0
        jz .end
        int 10h

        inc si
        jmp .loop
    .end:
        popa
    ret
;-------------------
;DATA
;-------------------
welcmsg: db "Welcome!", 0x0D, 0x0A, 0
;-------------------
;FILL
;-------------------
times 510-($-$$) db 0
dw 0xAA55

I've compiled it on linux using NASM. After successful compilation I copied content of 512 byte .bin file and I pasted it to empty .img file with Okteta hex editor.

dd if=/dev/zero of=boot.img bs=512 count=2880

Then I used mkisofs to create .iso file.

mkisofs -U -D -floppy-boot -b  boot.img -c boot.catalog -hide boot.img -hide boot.catalog -V "test" -iso-level 3 -L -o test.iso content

I have added this .iso image to virtual machine settings and I started it. Face of my problem is VirtualBox error message:

FATAL: No bootable medium found.

Does anybody know what am I doing wrong and how can I make it working? Please help.


回答1:


Here is someone else who was working on developing a bootloader on SO. You might want to check out OSDev for more ideas, and hook up with a community of build it from scratch kind of folks. As for why your effort doesn't boot, I wonder if there is something that you need to check out Using Virtualbox as a bootloader testing environment. As I said before, you've made a great start, all the best. CHEERS!



来源:https://stackoverflow.com/questions/11824231/no-bootloader-found-on-bootable-medium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!