Code: Select all
xorriso -as mkisofs -R -J \
-b disk.img -no-emul-boot -boot-load-size 1 \
-o mybootcd2.iso cd_img
also, i cant make my code working normally when i read it from iso by myself from 34 sector where my code is located at drive
it works but instead of printing string it prints some strange symbols and cant load GDT saying "fetch_raw_descriptor: GDT: index (f) 1 > limit (0)" (when i load code by int 13, ah=0x2 it works normally without any errors)
but dumps of memory where i load stage 2 absolutely identical (except of in second case i also load my stage1 (512 bytes) to memory so i simply add 0x200 to start address in memory) and i dont know what to do with that
Code: Select all
load_disk_lba :
push ax
push si
mov ah, 0x42
mov si, lba_read_packet
mov byte [lba_read_packet], 0x10
mov word [lba_read_packet + 2], cx
mov word [lba_read_packet + 4], di
mov word [lba_read_packet + 6], ds
mov word [lba_read_packet + 8], bx
int 0x13
jc disk_error
pop si
pop ax
ret
disk_error :
jmp $
align 8
lba_read_packet times 16 db 0
Code: Select all
load_kernel :
push ds
pusha
mov dl, [BOOT_DRIVE]
xor ax, ax
mov ds, ax
mov es, ax
mov di, 0x1000
mov bl, 0x22
mov cx, 0x3
call load_disk_lba
popa
pop ds
ret