How to connect hard disk in qemu?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Shvets04
Member
Member
Posts: 28
Joined: Wed Feb 13, 2019 3:07 pm

How to connect hard disk in qemu?

Post 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?
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How to connect hard disk in qemu?

Post by iansjack »

Shvets04
Member
Member
Posts: 28
Joined: Wed Feb 13, 2019 3:07 pm

Re: How to connect hard disk in qemu?

Post 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?
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How to connect hard disk in qemu?

Post by iansjack »

Post Reply