Classic Mac OS Software (Discussions on Applications) > Application Development & Programming in the Classic Mac OS

HD temperature

(1/2) > >>

Is it possible to read the HD temperature in a C++ program?

If you have something like a SPI3 CAM interface it should be pretty simple. Send a LOG SENSE command for either page $2F (informational exceptions) or page $0D (temperature), and parse the receive data buffer for the 1-byte temperature in C. It is always at offset +10 in log page $2F, and offset +9 in log page $0D.

MacOS does let you send arbitrary ATA and/or SCSI commands to any connected disk. The type of command that gets temperature might not even interfere with ongoing data operations. I just have no clue what ATA and/or SCSI commands to use and if there are any vendor differences between disks for those commands or the data returned.

I copied the source code of hddtemp for Linux to see how they do it.

It uses ioctl.h. This is included in Symantec C++. But I don't see an implementation or library that contains the ioctl function. How do I link this?


[0] Message Index

[#] Next page

Go to full version