Page 1 of 1

How to connect hard disk in qemu?

Posted: Fri Apr 17, 2020 3:04 am
by Shvets04
hi, i try to implement file system, but i dont know how to connect hard disk. I know bit about -fda, -hda, -initrd flags in qemu. But i dont know what i should use and how it use. How i can get acces to it in C code? In some OS in github i found that multiboot->mods_addres store addres of disk, but in may situation multiboot->mods_count returns 0.( even when i use one of above flags)

i created disk img by

Code: Select all

qemu-img create -f raw disk.img 100M
Can anyboby tell me, what i should do?

Re: How to connect hard disk in qemu?

Posted: Fri Apr 17, 2020 7:52 am
by iansjack

Re: How to connect hard disk in qemu?

Posted: Fri Apr 17, 2020 8:43 am
by Shvets04
iansjack wrote:Use the flag -hda disk,img

https://fosspost.org/tutorials/use-qemu ... tributions

but how to get access to the disk from C code?

Re: How to connect hard disk in qemu?

Posted: Fri Apr 17, 2020 8:53 am
by iansjack