SnaiL wrote:
It depends on operating system you using.
If you are using Linux:
#include <stdio.h>
#include <fcntl.h>
#include <linux/hdreg.h>
int main()
{
struct hd_driveid hd;
int ide;
ide=open("/dev/hda",O_RDONLY);
ioctl(ide,HDIO_GET_IDENTITY,&hd);
printf("Serial number - %s\n",hd.serial_no);
return 1;
}
maybe NetBSD?:
man atactl -> read atactl code ...
or FreeBSD?:
look at
atacontrol - cap command
Do you have information for an ARM based embedded system,
using the Nucleus Plus operating system?
Do you have information for a SPARC based embedded system
runing VRTX operating system?
In other words, platform specific solutions should
be posted in platform specific newsgroups, regardless
of the language being used.
All the world is not a Linux, Windows, Mac, VMS, etc.
platform.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library