开发者

How do I obtain disk manufacturer information?

开发者 https://www.devze.com 2023-03-20 00:46 出处:网络
I\'m learning to program the ATA bus. In Bochs it seems my code for r/w works, however I can\'t say that for sure until I try it with开发者_StackOverflow社区 real disk. Thus I need to find out how to

I'm learning to program the ATA bus. In Bochs it seems my code for r/w works, however I can't say that for sure until I try it with开发者_StackOverflow社区 real disk. Thus I need to find out how to obtain the disk manufacturer information which is the least importnant thing when talking about it's functionality but on the other hand printing this information on the screen is one of the things that can assure me I'm not gonna screw up my whole pc. I was trying to google this out but wasn't very lucky. If you could provide me with some links or hints that would be great. thx stu.

ps - solutions without interrupts are prefered


I found the solution in this pdf (look up the indetify device command) and there is also a nice C code here. There is also a lot of information on osdev, which I think is the best if you don't much like reading through source codes. With Bochs it works fine, with Qemu it works fine, with my desktop PC it works fine, but of course laptops are feeling somewhat special so I couldn't make it work on these yet. One prints 40 characters which look like pi and one doesn't print anything at all. Should you have ideas what could be the matter please share your opinions with me. Hope the references help others who seek this information.

EDIT

ok, my bad (of course), I forgot to wait for BSY. The proper way to get the desired information is just as described on osdev under IDENTIFY command. Also make sure you read all the data after sending the command or else the busy led would not go off.


I think that you should try with investigating libata from linux kernel.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号