QEMU. Загрузка с SATA диска
Пишу MBR загрузчик для операционной системы, сейчас мне нужно прочитать диск из защищенного режима, для этого я собираюсь писать AHCI драйвер, но у меня не получается загрузиться c SATA диска через QEMU.
Booting from Hard Disk...
Boot failed: could not read the boot disk
Самый нормальный вариант, который я нашел в интернете - запустить вм с параметром -M q35, вот полная комманда запуска:
qemu-system-x86_64 -drive file=shit_OS.iso,format=raw -M q35 -monitor stdio -bios bios.bin -gdb tcp::9000
Пробовал использовать и встроенный в QEMU биос и сам компилировал SeaBIOS со включенным AHCI - результат один и тот же. info pci показывает, что SATA Controller присутствует.
QEMU 7.1.50 monitor - type 'help' for more information
info pci
Bus 0, device 0, function 0:
Host bridge: PCI device 8086:29c0
PCI subsystem 1af4:1100
id ""
Bus 0, device 1, function 0:
VGA controller: PCI device 1234:1111
PCI subsystem 1af4:1100
BAR0: 32 bit prefetchable memory at 0xfd000000 [0xfdffffff].
BAR2: 32 bit memory at 0xfebd4000 [0xfebd4fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].
id ""
Bus 0, device 2, function 0:
Ethernet controller: PCI device 8086:10d3
PCI subsystem 8086:0000
IRQ 11, pin A
BAR0: 32 bit memory at 0xfeb80000 [0xfeb9ffff].
BAR1: 32 bit memory at 0xfeba0000 [0xfebbffff].
BAR2: I/O at 0xc040 [0xc05f].
BAR3: 32 bit memory at 0xfebd0000 [0xfebd3fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
id ""
Bus 0, device 31, function 0:
ISA bridge: PCI device 8086:2918
PCI subsystem 1af4:1100
id ""
Bus 0, device 31, function 2:
SATA controller: PCI device 8086:2922
PCI subsystem 1af4:1100
IRQ 10, pin A
BAR4: I/O at 0xc060 [0xc07f].
BAR5: 32 bit memory at 0xfebd5000 [0xfebd5fff].
id ""
Bus 0, device 31, function 3:
SMBus: PCI device 8086:2930
PCI subsystem 1af4:1100
IRQ 10, pin A
BAR4: I/O at 0x0700 [0x073f].
id ""
Если поможет, вот ссылки на проект и iso образ:
http://gulag.cybercommunity.space/shit_OS.iso http://gulag.cybercommunity.space/shit_OS.tar.gz
В главном CMakeLists.txt на 18 строке - команда запуска. bootloader/mbr.asm - сам MBR загрузик