All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Polovov <andrey.polovov@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Getting HDD serial in kernel space
Date: Sat, 14 Nov 2009 14:34:54 +0300	[thread overview]
Message-ID: <4AFE95DE.3070308@gmail.com> (raw)

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)?


             reply	other threads:[~2009-11-14 11:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14 11:34 Andrey Polovov [this message]
2009-11-14 15:28 ` Getting HDD serial in kernel space Alan Cox
2009-11-15 14:03 ` Andrey Polovov
2009-11-15 17:05   ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AFE95DE.3070308@gmail.com \
    --to=andrey.polovov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.