LiShuang
LiShuang

Reputation: 11

What does the qemu command option -hda mean?

If I add the -hda option to the qemu startup command to add external storage, how should my operating system know where this device is mounted? Furthermore, what interface protocol should my operating system use to access this device?

I tried to use the operating system I developed to run on qemu. When I wanted to read the hard disk, I didn't know where the hard disk device emulated by qemu was. All I can tell is that the boot command uses the -hda option to emulate a hard drive, and I need to know how I can access it. In addition, I am not familiar with how SATA interface devices should be accessed, so I want to know how I should access the above hda hard drive through the SATA interface protocol.

Upvotes: 1

Views: 1602

Answers (1)

Peter Maydell
Peter Maydell

Reputation: 11493

"-hda" is one of QEMU's "do the right thing" options -- it creates a disk whose type and location depends on the machine type QEMU is emulating, and which is hopefully the normal, expected, common kind of disk for that machine.

For the x86_64 PC machine types, for instance, it creates an IDE drive; on some other machine types it creates a SCSI drive, and on a few machine types it even creates an SD card drive.

If you don't want this kind of "do what I mean" interface, you can always use the long-form options which let you precisely specify what disk type to create and which controller or bus to plug it into.

Upvotes: 1

Related Questions