Re: Making a bootable image
Posted: Fri Oct 30, 2020 2:41 pm
I'm not really sure on what I have to do, is my first time doing a bootloader my own
I've followed the new wiki:
But is just like before, qemu and bochs boot the image but i can't explore the image with poweriso and if i burn the image to a usb, the stick is no more recognized.
This is my bootloader simplified:
I've followed the new wiki:
Code: Select all
$ dd if=boot.bin of=diskimage.dd conv=notrunc bs=446 count=1
$ dd if=boot.bin of=diskimage.dd conv=notrunc bs=2 count=1 skip=510 seek=510
This is my bootloader simplified:
Code: Select all
org 0
bits 16
jmp 0x7C00 : boot
BiosPrint:
pusha
.loop:
lodsb
or al, al
jz .done
mov ah, 0x0E
int 0x10
jmp .loop
.done:
popa
ret
%macro BiosPrintMacro 1
mov si, word %1
call BiosPrint
%endmacro
boot:
.init:
cli ; Disable interrupts
; All data segments (except es) are initialized to use the code segment.
mov ax, cs
mov ds, ax
mov fs, ax
mov gs, ax
; Set up a temporary stack.
xor ax, ax
mov ss, ax
mov sp, 0x00007C00
; The es segment is 0, which is useful for absolute addressing of the first 64KiB of memory.
mov es, ax
sti ; Re-enable interrupts.
BiosPrintMacro Message
hang:
cli
hlt
jmp hang
Message db "Hello World!", 13, 10, 0
times 510-($-$$) db 0
dw 0xAA55