Subject: Talk to ATA device directly
To: None <port-arm32@netbsd.org>
From: None <skwong@panasas.com>
List: port-arm32
Date: 10/09/2001 10:27:14
I've been working with hard drive diagnostic test developement under
DOS/Windows environment for past years. Currenlty, I am try to do the same
operations under FreeBSD. I've been searching under web, found a lot of
info. I also look at the source code directory for ATA (ata-all.h
ata-all.c ata-disk.c ata-disk.h, etc...) But I don't seem to be able to put
the puzzle together. If you can have sometimes and point me to right
directory. The operations I am try to do is be able talk directly to
ide/scsi hard drive (ide mainly) so that I can issue ATA commands, get SMART
attributes, drive vendor, firmware version, cycliner, head, sector, read,
write, seek sector off the hard drive. I find a code of atactl.c. It
used opendisk (only in NetBSD and OpenBS), I cannot figure out how to use it
under FreeBSD. This function will open drive and return a handle. This
will be helpful if I can get a handle of drive under FreeBSD. Also, under
kernel source code ATA. Are there anyway I can use some of code to create
tools or utility. I can seem to get around #include <sys/systm.h>
statement. And the header file for "opt_global.h" "opt_ata.h" is defining
at top of file, I dont understand where these two files come from. It must
be build during compile kernel. Always, report errors. The ata
directory's source are all kernel ata driver. I really like to know to use
those function and can access hard drive directory like the kernel ata
driver.
Thanks in advance
sonny