Skip to content

Commit 43a1737

Browse files
committed
HDPARM 6.9 for Windows
0 parents  commit 43a1737

30 files changed

+6234
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changelog text eol=lf
2+
Changelog.* text eol=lf
3+
LICENSE.* text eol=lf
4+
Makefile text eol=lf
5+
Makefile.* text eol=lf
6+
README text eol=lf
7+
README.* text eol=lf
8+
*.c text eol=lf
9+
*.h text eol=lf

Changelog

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
hdparm-6.9
2+
- added -s flag to control power-up in standby
3+
(thanks to chrfranke)
4+
- make --Istdin more robust
5+
- added -I recognition of SMART Command Transport (SCT)
6+
(thanks to chrfranke).
7+
- fix X2 over-reporting of -T results
8+
- add udma 3/4/5 modes to the -i results
9+
hdparm-6.8
10+
- improve parsing/operation of --Istdin function
11+
hdparm-6.7
12+
- don't default to "-v" when only new "--" longopts are used.
13+
- calculate integrity word if not correct
14+
- remove used code/parameter from identify()
15+
- fix "(null)" strings from the "Drive conforms to" line of -I
16+
- tidied up usage of prefix vars in Makefile
17+
- fix bug in -C implementation
18+
- new -H flag for (Hitachi) drive temperature
19+
hdparm-6.6
20+
- fix build for Redhat/Fedora systems.
21+
- disable security commands when building on Redhat/Fedora,
22+
as they lack the required data structures in the system headers.
23+
hdparm-6.5
24+
- fix -I bugs from version 6.4.
25+
hdparm-6.4
26+
- Makefile updates from Mikkel Krautz.
27+
- manpage updates / corrections.
28+
- fixed bug in -C code.
29+
- major updates to bring -I information up to current specs.
30+
hdparm-6.3
31+
- added reporting of ATA revision numbers > 7
32+
hdparm-6.2
33+
- eliminated short form (-F) of --security-freeze flag
34+
- completely revamped ATA Security Commands
35+
(now they actually work sometimes)
36+
courtesy of Leonard den Ottolander (a BIG thank-you!)
37+
hdparm-6.1
38+
- fix BLKGETSIZE bug introduced in 6.0
39+
- man page clarification for -M (courtesy Stephen Gran)
40+
hdparm-6.0
41+
- correct usage of BLKGETSIZE64 (returns bytes instead of sectors)
42+
- Added ATA Security switches (Benjamin Benz bbe[AT]heise[DOT]de)
43+
hdparm-5.9
44+
- fix security-mode display (Franz Lehner)
45+
- fixed -W bug (Stephan Gran)
46+
hdparm-5.8
47+
- added HDIO_SET_WCACHE support to -W
48+
- fixed double byteswap for big endian
49+
- fixed %lld warnings on 64-bit architectures
50+
- "hdparm -h" now goes to stdout instead of stderr
51+
hdparm-5.7
52+
- fixed output of NULs in -I string fields
53+
- fixed big-endian -I crashes from 5.6
54+
- removed remains of defunct major-number checks
55+
- added support for BLKGETSIZE64 ioctl internally
56+
- added --direct flag to use O_DIRECT on device open
57+
- renamed -Istdin to --Istdin
58+
- renamed -Istdout to --Istdout
59+
- allow other flags to follow any of: -I, --Istdin, --Istdout
60+
hdparm-5.6
61+
- fixed reversed device names in idectl script
62+
- renamed readahead variables to avoid new glibc conflicts
63+
- added -Istdout flag to dump IDENTIFY data as hex
64+
- removed MAJOR number checks to open up hdpar for SATA-SCSI drivers
65+
hdparm-5.5
66+
- added limited support for SCSI(-controlled) CDROM/optical drives
67+
- incorporated various -I clean-up patches from Maciej W. Rozycki
68+
- removed wordswap from capacity calculation: latest kenels already do it
69+
- fixed slight issues with ATA Revision display
70+
- added debian scripts from Stephan Gran
71+
hdparm-5.4
72+
- fixed 2.5.67 compile error (LVM_BLK_MAJOR)
73+
- first attempt to support BIG_ENDIAN in identify.c
74+
- converted -T and -t to use minimum timing intervals (2 and 3 seconds)
75+
- fix device size overflow issue with -t
76+
- hdparm -I: fixed device size output for devices with reversed endian.
77+
- hdparm -i: added explanation for "*"
78+
- slight formatting change for -Tt outputs
79+
- fixed "(illegal value)" formatting
80+
- added CCISS_MAJOR
81+
- incorporated RedHat-8.0 and other patches
82+
hdparm-5.3
83+
- get rid of malloc()
84+
- fix(?) BIG_ENDIAN problems
85+
- fix -tT to work on very small drives
86+
- fix -p output for parameters >= 100
87+
hdparm-5.2
88+
- compile fixes for latest 2.5.xx kernels
89+
- moved -s from CFLAGS to LDFLAGS
90+
- fixed manpage formatting error from 5.1
91+
- -i was broken due to non-compatible changes in 2.5.xx
92+
- the fix for -i now breaks hdparm -i for really old kernels
93+
hdparm-5.1
94+
- fixed segfault from -i on older drives
95+
hdparm-5.0
96+
- updated -I to most recent ATA6 draft standard
97+
- added -Istdin to process input from /proc/ide/hd*/identify
98+
- CFLAGS Makefile fix from Kevin P. Fleming
99+
- -X mode names from Martin
100+
- tweaked #include's for Slackware
101+
- eliminate bogus "udma10" from -I output
102+
- formatting fixes for -I from various people
103+
- clean compile fixes from Steven Augart <[email protected]>
104+
- allow -d parameters other than 0/1 for special uses
105+
- removed busstate, acoustic, and nowerr from "-v" subset
106+
- support for Pacific Digital ADMA-100i
107+
hdparm-4.9
108+
- fixed compile error with some kernels
109+
hdparm-4.8
110+
- updated -Q to take queue depth as parameter value
111+
hdparm-4.7
112+
- add -z option for BLKRRPART ("re-read partition table")
113+
- add -Q option to turn on/off tagged queuing
114+
- add -M option for acoustic feature set
115+
- allow ANY value for the parameter to '-p' (user beware!)
116+
- applied APM fixes from Gildas Bazin <[email protected]>
117+
hdparm-4.6
118+
- fix version numbers, update DMA notes in manpage
119+
hdparm-4.5
120+
- ENDIAN tidyup, GETGEO fixes, Makefile fixes, mostly courtesy of Maciej W. Rozycki
121+
hdparm-4.4
122+
- add -b option, courtesy of Tim Hockin
123+
hdparm-4.3
124+
- display most fields as unsigned rather than signed values
125+
hdparm-4.2
126+
- completely new format/implementation of "-I" with much more detail
127+
- code cleanups for newer libs/compilers
128+
hdparm-4.1
129+
- merge some changes from Andre
130+
- code cleanups from Neil Macvicar and others
131+
- improved output from -i for newer features
132+
- incorporate RedHat-7.0 patches
133+
hdparm-4.0
134+
- no such release
135+
hdparm-3.9
136+
- added IDE_MAJOR[6-9]
137+
- nuked the LBAsects display (again!)
138+
hdparm-3.8
139+
- fix display of drive capacity (Stephane Eranian <[email protected]>)
140+
- new -E "set cdrom speed" option (Matthias Oster <[email protected]>)
141+
- new -R and -U "(un)register hwif" options (Christian Lademann <[email protected]>)
142+
- new contrib subdirectory with contributed scripts from users.
143+
- support for display of newer PIO and DMA/UDMA modes
144+
hdparm-3.7
145+
- use O_NONBLOCK for open(), to handle drives with media removed
146+
- make "HDIO_DRIVE_CMD failed" messages slightly more verbose
147+
- get rid of "HDIO_GET_MULTCOUNT failed" from -i on non-disks
148+
hdparm-3.6
149+
- added new -V (version) option
150+
- removed confusing LBA "remapping" geometry calculation
151+
- small fix to "-I"
152+
- Courtesy of Andrzej Krzysztofowicz <[email protected]>:
153+
- added support for old XT drives
154+
- transfer display in kB/s rather than in MB/s for slow disks
155+
- fixed -v for SCSI disks
156+
- added -L to lock/unlock door of removeable harddisks
157+
- added udma modes 3,4,5..
158+
- updated Makefile to use "destdir" prefix -- Ytiddo <[email protected]>
159+
hdparm-3.5
160+
- fixed compilation under older kernels
161+
- fixed udma mode info under older kernels
162+
hdparm-3.4
163+
- added udma mode info
164+
- added support for SCSI_DISK_MAJOR{0-7}
165+
- fix -h (help) to show -y instead of -Y for "standby"
166+
- fix display of drive SerialNo: 20 chars instead of just 8
167+
- modify -C -y -Y to each try both possible command codes
168+
- add interpretations for use of -X to set UltraDMA modes
169+
- add -D for enable/disable drive defect-mgmt
170+
hdparm-3.3
171+
- add -C, -y, and -Y flags for IDE power management
172+
hdparm-3.2
173+
- force BLKFLSBUF after -T or -t -- [email protected]
174+
- fix minor -T/-t mixup in manpage -- [email protected]
175+
hdparm-3.1
176+
- permit "-p" with values larger than 5 (for cmd640 readahead)
177+
- updated version number on manpage (was way out of date!)
178+
hdparm-3.0
179+
- always touch each sector in read_big_block() -- Jon Burgess
180+
- move cache timings to new -T option -- [email protected]
181+
hdparm-2.9:
182+
- updated author's email address
183+
hdparm-2.8:
184+
- fixed compilation against older kernels
185+
- changed "KB" to "kB"
186+
- support for "-t" on "md" devices (from [email protected])
187+
- removed "Estimating raw driver speed" message from "-t"
188+
because it is likely very incorrect on faster systems
189+
- added "-I" to re-issue IDENTIFY command to drive
190+
hdparm-2.7:
191+
- fixed .lsm file
192+
- fixed "hdparm -c" (broken in 2.6) (kudos to [email protected])
193+
hdparm-2.6:
194+
- tidied up manpage
195+
- added support for HDIO_SET_PIO_MODE (kernel 1.3.61+)
196+
- reduced codesize by combining fprintf's in help
197+
hdparm-2.5:
198+
- fixed -i display of eight character fwrev field
199+
- rearranged output of -v
200+
hdparm-2.4:
201+
- added flag to turn on/off "using_dma" flag (kernel 1.3.22+)
202+
- added warnings about CMD-640B and RZ1000 bugs to manpage ("-u1")
203+
- cleaned up output from -c, added text interpretations
204+
- added -c functionality to -v
205+
- removed -a functionality from -v for scsi drives
206+
- added -n flag for ignoring the "write error" bit from a drive
207+
- moved binary from /usr/local/bin to /usr/local/sbin
208+
- added support for 3rd/4th IDE interfaces
209+
hdparm-2.3:
210+
- added -c flag for controlling 32-bit chipset features with 1.2.9+
211+
- fixed error messages when -t used on SCSI drives
212+
- fixed date on man page to read 1995 rather than 1994 (late change)
213+
hdparm-2.2:
214+
- fixed a memory problem in my PC, and now BLKFLSBUF seems safe again
215+
- fixed "help" line for "-v"
216+
hdparm-2.1:
217+
- fixed formatting of DMA info line
218+
- added "(DANGEROUS)" to -u,-X,-W options in "hdparm -h"
219+
- changed order in which settings are applied: placed standby last
220+
hdparm-2.0:
221+
- added this file to the distribution
222+
- added -f and -q flags to hdparm.c and hdparm.8
223+
- added -N to gcc in makefile
224+
- changed installation paths to /usr/local/* in makefile
225+
- removed meaningless CPU% measures
226+
- removed -s and -x flags
227+
- added new -AKPSWXZ flags using new HDIO_DRIVE_CMD ioctl
228+
- removed BLKFLSBUF ioctl from everywhere except -t
229+
(there may be a kernel bug in the implementation of BLKFLSBUF
230+
when used on an active (mounted rw) filesystem).
231+
- most features now require (E)IDE driver v2.6 or higher
232+
(ide-2.6.patch.65+.gz)

LICENSE.TXT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
BSD-Style Open Source License:
2+
3+
You may freely use, modify, and redistribute the hdparm program,
4+
as either binary or source, or both.
5+
6+
The only condition is that my name and copyright notice
7+
remain in the source code as-is.
8+
9+
Mark Lord ([email protected])

Makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Makefile for hdparm
2+
3+
# DESTDIR is for non root installs (eg packages, NFS) only!
4+
DESTDIR =
5+
6+
binprefix =
7+
manprefix = /usr
8+
exec_prefix = $(binprefix)/
9+
sbindir = $(exec_prefix)sbin
10+
mandir = $(manprefix)/share/man
11+
oldmandir = $(manprefix)/man
12+
13+
ifndef CC
14+
CC = gcc
15+
endif
16+
CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
17+
18+
19+
LDFLAGS = -s
20+
INSTALL = install
21+
INSTALL_DATA = $(INSTALL) -m 644
22+
INSTALL_DIR = $(INSTALL) -m 755 -d
23+
INSTALL_PROGRAM = $(INSTALL)
24+
25+
all: hdparm
26+
27+
hdparm: hdparm.o identify.o hdparm.h
28+
$(CC) $(LDFLAGS) -o hdparm hdparm.o identify.o
29+
30+
install: all hdparm.8
31+
if [ ! -z $(DESTDIR) ]; then $(INSTALL_DIR) $(DESTDIR) ; fi
32+
if [ ! -z $(DESTDIR)$(sbindir) ]; then $(INSTALL_DIR) $(DESTDIR)$(sbindir) ; fi
33+
if [ ! -z $(DESTDIR)$(mandir) ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir) ; fi
34+
if [ ! -z $(DESTDIR)$(mandir)/man8/ ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8/ ; fi
35+
if [ -f $(DESTDIR)$(sbindir)/hdparm ]; then rm -f $(DESTDIR)$(sbindir)/hdparm ; fi
36+
if [ -f $(DESTDIR)$(mandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(mandir)/man8/hdparm.8 ;\
37+
elif [ -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ; fi
38+
$(INSTALL_PROGRAM) -D hdparm $(DESTDIR)$(sbindir)/hdparm
39+
if [ -d $(DESTDIR)$(mandir) ]; then $(INSTALL_DATA) -D hdparm.8 $(DESTDIR)$(mandir)/man8/hdparm.8 ;\
40+
elif [ -d $(DESTDIR)$(oldmandir) ]; then $(INSTALL_DATA) -D hdparm.8 $(DESTDIR)$(oldmandir)/man8/hdparm.8 ; fi
41+
42+
clean:
43+
rm -f hdparm *.o core
44+

Makefile.cygwin

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Makefile for hdparm for Cygwin
2+
3+
DESTDIR =
4+
5+
binprefix = /usr
6+
manprefix = /usr
7+
exec_prefix = $(binprefix)/
8+
sbindir = $(exec_prefix)sbin
9+
mandir = $(manprefix)/share/man
10+
oldmandir = $(manprefix)/man
11+
12+
CC = gcc
13+
CFLAGS = -O2 -W -Wall
14+
15+
LDFLAGS = -s
16+
INSTALL = install
17+
INSTALL_DATA = $(INSTALL) -m 644
18+
INSTALL_DIR = $(INSTALL) -m 755 -d
19+
INSTALL_PROGRAM = $(INSTALL)
20+
21+
all: hdparm
22+
23+
hdparm.o: hdparm.h fs.h hdreg.h rawio.h shm.h version.h
24+
25+
identify.o: hdparm.h
26+
27+
rawio.o: rawio.h fs.h hdreg.h
28+
29+
shm.o: shm.h
30+
31+
hdparm: hdparm.o identify.o rawio.o shm.o
32+
$(CC) $(LDFLAGS) -o $@ hdparm.o identify.o rawio.o shm.o
33+
34+
install: all hdparm.8
35+
if [ ! -z $(DESTDIR) ]; then $(INSTALL_DIR) $(DESTDIR) ; fi
36+
if [ ! -z $(DESTDIR)$(sbindir) ]; then $(INSTALL_DIR) $(DESTDIR)$(sbindir) ; fi
37+
if [ ! -z $(DESTDIR)$(mandir) ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir) ; fi
38+
if [ ! -z $(DESTDIR)$(mandir)/man8/ ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8/ ; fi
39+
if [ -f $(DESTDIR)$(sbindir)/hdparm ]; then rm -f $(DESTDIR)$(sbindir)/hdparm ; fi
40+
if [ -f $(DESTDIR)$(mandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(mandir)/man8/hdparm.8 ;\
41+
elif [ -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ; fi
42+
$(INSTALL_PROGRAM) -D hdparm $(DESTDIR)$(sbindir)/hdparm
43+
if [ -d $(DESTDIR)$(mandir) ]; then $(INSTALL_DATA) -D hdparm.8 $(DESTDIR)$(mandir)/man8/hdparm.8 ;\
44+
elif [ -d $(DESTDIR)$(oldmandir) ]; then $(INSTALL_DATA) -D hdparm.8 $(DESTDIR)$(oldmandir)/man8/hdparm.8 ; fi
45+
46+
clean:
47+
rm -f hdparm.exe *.o
48+

Makefile.mingw32

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Mingw-w64 win32 Makefile
2+
3+
CC = i686-w64-mingw32-gcc
4+
CFLAGS = -O2 -Wall -Wextra -ffunction-sections -fdata-sections -static
5+
LDFLAGS = -s -Wl,--gc-sections
6+
7+
8+
all: hdparm.exe
9+
10+
hdparm.exe: hdparm.o
11+
$(CC) -o hdparm.exe hdparm.o identify.o rawio.o shm.o timer.o $(LDFLAGS)
12+
13+
hdparm.o: identify.o rawio.o shm.o timer.o
14+
$(CC) $(CFLAGS) -o hdparm.o -c hdparm.c
15+
16+
identify.o:
17+
$(CC) $(CFLAGS) -o identify.o -c identify.c
18+
19+
rawio.o:
20+
$(CC) $(CFLAGS) -o rawio.o -c ./win32/rawio.c
21+
22+
shm.o:
23+
$(CC) $(CFLAGS) -o shm.o -c ./win32/shm.c
24+
25+
timer.o:
26+
$(CC) $(CFLAGS) -o timer.o -c ./win32/timer.c
27+
28+
29+
doc: hdparm.8.html hdparm.8.txt
30+
31+
hdparm.8.html: hdparm.8
32+
man2html hdparm.8 | sed 1d > hdparm.8.html
33+
34+
hdparm.8.txt: hdparm.8
35+
groff -man -Tascii -P'-bcou' < hdparm.8 > hdparm.8.txt
36+
37+
38+
clean:
39+
rm -f hdparm.exe *.o hdparm.8.html hdparm.8.txt

0 commit comments

Comments
 (0)