OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 2:41 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Test AHCI ATAPI device using qemu
PostPosted: Tue Dec 13, 2022 4:21 pm 
Offline
Member
Member
User avatar

Joined: Wed Feb 19, 2020 1:08 pm
Posts: 270
Location: Italy
I have a fully working AHCI SATA driver that reads a disk connected to qemu with the following flags:
Code:
-M q35 -drive file=./OS.img,index=0,media=disk,format=raw

Now I want to implement SCSI, hence I need an ATAPI device. I tried with -cdrom and many other flags but the ahci driver doesn't find the atapi device. What is the exact combination of flags needed to make an atapi device pop out in the ahci interface using qemu?

_________________
Regards, Bonfra.


Top
 Profile  
 
 Post subject: Re: Test AHCI ATAPI device using qemu
PostPosted: Tue Dec 13, 2022 8:04 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5143
Using "-cdrom" or "-drive media=cdrom" works fine for me.

What makes it seem like it isn't working for you?


Top
 Profile  
 
 Post subject: Re: Test AHCI ATAPI device using qemu
PostPosted: Wed Dec 14, 2022 1:55 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 19, 2020 1:08 pm
Posts: 270
Location: Italy
Octocontrabass wrote:
What makes it seem like it isn't working for you?

after resetting the AHCI controller and probing the ports none of them contains an ATAPI device using -cdrom, now I tested with
Code:
-drive file=./os.iso,index=1,media=cdrom,format=raw

and it seems to be working; now two(?) ATAPI devices pop out after the enumeration.
I'm not sure why the simplest form -cdrom isn't working but I'm not as worried about that as the fact that two ATAPI are present. how do I discern which one is mine?

_________________
Regards, Bonfra.


Top
 Profile  
 
 Post subject: Re: Test AHCI ATAPI device using qemu
PostPosted: Wed Dec 14, 2022 3:20 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5143
Bonfra wrote:
after resetting the AHCI controller and probing the ports none of them contains an ATAPI device using -cdrom

It sounds like there's a bug in your AHCI driver. Linux has no problem finding the optical drive when using "-cdrom".

Bonfra wrote:
how do I discern which one is mine?

Your drive will be the one with your disc in it. The default optical drive will be empty unless you use "-hdc" or "-cdrom" or "-device index=2" or "-nodefaults" to override it.


Top
 Profile  
 
 Post subject: Re: Test AHCI ATAPI device using qemu
PostPosted: Wed Dec 14, 2022 6:55 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 19, 2020 1:08 pm
Posts: 270
Location: Italy
Well I updated qemu and now it works with -cdrom, maybe it was a buggy version, I also don't have the empty disk problem anymore using index=2 as you suggested. Thanks a lot :)

_________________
Regards, Bonfra.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: austanss, Bing [Bot] and 114 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group