Messages in this thread | | | Date | Sat, 14 Nov 2009 14:34:54 +0300 | From | Andrey Polovov <> | Subject | Getting HDD serial in kernel space |
| |
Hello.
I had a necessity to get HDD serial number in my kernel module. In user space I can do it so:
fd = open( "/dev/sda", O_RDONLY|O_NONBLOCK ); ioctl( fd, HDIO_GET_IDENTITY, &id ); printf( "Serial: %s", id.serial_no );
How can I do it in kernel space (it is one hdd in machine, plugged with SATA)?
| |