The HPDir Project
There are two main reasons for the HPDir program:
- Binary images of HP 9845 media have to be handled in order to create, duplicate and initialize image files, and to maintain all the files which are stored in the binary image.
- Original vintage mass storage peripherals and media shall be controlled, read and written directly from a PC without any other vintage system involved.
Typical HPDir Setup
The HPDir program is much like a swiss pocket knife for vintage HP drives, media and data. It is able to list the contents of file systems and to extract files from drives connected via HP-IB, files included in binary images and files from old non-standard HP floppy discs. It can convert files from one file to another, including the conversion of data and program files, so that they get readable and editable on a PC. It can dump sector-by-sector images from HP-IB drives or floppy disks in order to archive the original media content. It can also restore original media from these images. It can initiate diagnostics on the HP-IB bus, on drives connected via HP-IB bus or on vintage floppy media. It works both with 9845 and LIF file systems, handles hard disc drives as well as tape drives and supports access to non-standard floppies in standard PC floppy disc drives. For vintage HP drives it supports all the AMIGO and the CS/80 or SS/80 command sets. And it can be used to prepare images for the HPDrive program, an HP-IB mass storage emulator.
When designing the 9845, HP developed a new concept they called the "unified mass storage model". Before the 9845, HP experimented with mass storage concepts which were more or less media-centric. For example a standard format for tape drives was created, the so-called SIF (Standard Interchange Format), which was not really portable to other types of media. With the 9845, HP wanted to create a system where most mass storage routines could be implemented independently from the underlaying hardware and media. This would not only have the advantage of re-usable code, but also simplified data transfer from one media to another and provided a standardized user interface for mass storage operations.
This concept did fit well into the hardware concept of the HP 9845, which was very generic, too. The file structure is almost the same for all peripherals. The basic entity is the record, a 256 byte block of data. The generic view on mass storage is in principle just that of a linear seqence of records, starting with record zero. This is similar to the view on modern disc drives with their Logical Block Address (LBA) scheme.
In fact the 9845 file system was identical to that of the HP 250/260 integrated multi-user computer system. The HP 250 had been developed in Fort Collins/Colorado, where also the HP 9845 was born, and adopted many of the concepts of the HP 9845, including the hybrid processor and, of course, the file system format.
The HP 9845 file system is based on different areas on the medium: a single system record, a file directory, an availability table and the area where the file data is stored. The system record is always the first record on each media. File directory and allocation table follow the system record and can be doubled with a spare directory and allocation table. The file data area follows the allocation table, or, if directory and allocation table are mirrored, the spare allocation table.
The system record consists of a 'magic' identification word which marks the system under which the medium had been initialized (always $0500 hexadecimal for HP 9835 and HP 9845), some information about the disc geometry, the position of the directory table and the allocation table, the position of the last record of the allocation table, the number of system and data tracks and the interleave factor of the drive. Since the linear record scheme is independent from the the drive geometry or the interleave factor, this data is more or less bonus information.
Compared to modern file systems like FAT32 or NTFS the 9845 file system is very simply structured. All files are situated in the root directory, subdirectories are not supported. All file names are restricted to 6 characters maximum, and are case sensitive.
File data can't be fragmented, all data associated with a file must be in a continuous storage area. The availability table doesn't identify the records which belong to a certain file (as FAT does), but rather describes the free "holes" between the files. Each entry in the allocation table identifies position and length of one continuous free block on the medium. The last entry in the allocation table is followed by an end marker ($FFFF hexadecimal).
Each entry in the directory table holds the file name, the file position and length, the logical block size (also known as defined record size), the file type and a protection attribute. Again, the last directory enty is followed by an end marker.
Here is the structure of the HP 9845 disc file system in detail:
HP 9845 Disc File System Structure
This structure is used for all disc media (both floppy and hard disc). The tape cartridge version of the HP 9845 file system differs a little bit: due to the limited space all the file information is stored compressed in directory entries of just 12 bytes or 6 words. And there is no system record, instead the first record is unused (filled with zeros) and the directory starts with the 'magic' word. The tape file system does provide a spare directory, but no allocation tables.
Here is the structure of the 9845 tape file system in detail:
HP 9845 Tape File System Structure
The 426 blocks have all a size of 256 bytes and spread along two tracks (block 0 to block 212 on track 0, blocks 213 to 425 on track 1). As mentioned above, the tape file system doesn't have a system block or allocation tables. Instead, the first record is kept unused (probably for reliability reasons) and filled with zeros. The directory starts with a $0500 marker, followed by the first directory entry. The directory occupies 2 blocks or 512 bytes. Each directory entry uses 6 words or 12 bytes, so the directory has room for up to 42 file entries. The directory is followed by an identical copy which is used as spare directory in case the first directory has errors.
HP 9845 Disc and Tape Directory Format
The Sys Flags were set according to the system on which the entry was created: 1=HP9835, 2=HP9831, 3=HP250/260, 4=HP9845A, 5=unused, 6=HP9845B/C. The Location MSB was in fact used only with drives storage greater than 16 MB.
The fact that the HP 9845 file system did not allow fragmented files made it hard to use dynamically allocated files which grow with the amount of data that is written to the files. Another disadvantage was that each time a file was purged, it produced a 'hole' of free storage. The hole could be later on used by another file, but since the new file generally had another size, more and more storage was wasted during long term use. However, utilities were provided in order to re-pack the files in a HP 9845 file system.
In contrast to MS-DOS or Windows, files are not typed by file extension but through a file code which is stored in the directory entry. The files in a HP 9845 file system belong to either of the following types:
|File Type||File Type Code*||Purpose|
File type for backups (used with the DBMS ROM)
General pupose data container (this is the standard data file type for BASIC programs, and as well used for portable BASIC programs saved in ASCII format)
Standard file type for storing BASIC programs in a compact, but system specific format
File type for saving special function key definitions/macros
File type for packed binary data as used by the FREAD and FWRITE statements (available with the Mass Storage ROM)
File type for saving complete system dumps (including loaded programs, variables, key definitions, binary routines, and display content)
File type for saving binary routines (all currently loaded binaries are saved into one file)
General purpose container for all other option ROMs, the data structure is defined by the option specific ROM (note: the object code file produced by the assembler is of this type when stored on tape instead of disc)
File type for data base root file (same code as ASMB above, used with the DBMS ROM)
File type for data base file containing a data set (used with the DBMS ROM)
File type for saving object code routines produced with the Assembly Execution and Development ROM
*hexadecimal result of masking word 6 in disc directories with hex 1F80. File type codes for tape directories are the same, however only the high byte is used as a single byte code.
For the object code files of the Assembler Execution and Development ROM, the handling differs slightly between disc and tape storage. They are stored on disc as type ASMB, and on tape as type OPRM.
Special HP 250/260 note:
The HP 250 and HP 260 added some extensions to the file system described above, for instance volume labels or pointers for an on-disc hardware diagnostic program. CS/80 devices, which could provide 300 MB and more of mass storage, were initialized with 32 bit allocation table values instead of 16 bit as used by the 9845 file system (= 4 16-bit words per entry instead of 2 words). An additional flag in word 13 (the DA flag) indicated which values were used for the allocation table. HPDir looks at this flag and handles HP 250/260 file systems appropriately. Also, if the system is selected as HP 250/260, CS/80 and SS/80 drives are automatically initialized with 4-word availability table entries.
The Logical Interchange Format, or LIF is probably one of the least documented file systems ever, although this proprietary file system (which was introduced by HP during the late 70's, I think the first systems which used this format were the Series 80 computers) was targeted as a completely device independent, easy to implement exchange format, especially for pocket calculators like the 41C. This file system format was broadly used especially by HP's later computers, calculators and instruments, and it is still supported by HP-UX, but it never left the world of HP.
The roots of LIF seem to go back to the HP 9845 file system format as they share most restrictions. The most important refinements were a six-character volume label (similar to MSDOS), a maximum file name length of up to 10 characters, a time stamp and a free purpose field, which could add application specific data. Just like the HP 9845 file system format, LIF did not allow subdirectories or the fragmentation of file data. LIF uses both the linear record scheme and a system record for general file system information, but neither uses spare directories nor allocation tables. For the identification of suitable free storage areas, the complete directory had to be scanned.
Here is the structure of the LIF file system in detail:
LIF File System Structure
For some systems the LIF filenames are case senstitive, for others not. File types are system dependend, there is no general rule how the file types are encoded, except that code 0 denotes plain ASCII files. Most common file types were plain ASCII, binary data (BDAT) and binary programs (BPRG). The only file type, which can be used by all systems was plain ASCII. This file format was used in all cases where portability was important. Unfortunately, the HP 9845 DATA format is not compatible to the LIF ASCII format.
LIF Directory Format
The General Purpose field is something special. There are probably no two systems which use this field in the same way. Due to the lack of documentation, only a few definitions of that field are known.
The Type field holds a 16-bit value which provides information on the type of the file. In contrast to e.g. FAT or NTFS, the file type is not determined by the file name extension, but rather part of the file node meta data, so that file names may be chosen without consideration for the usage of the file. The possible range of hex 0000 to FFFF had been devided into ranges, which again have been assigned to HPs development & manufacturing divisions (which again had been responsible for certain products):
0x0000-0x7fff: General purpose
0xdc00-0xdfff: CSD (64000)
0xe000-0xe3ff: CVD (Series 80)
0xe400-0xe7ff: DTD (Terminals)
0xe800-0xebff: 9845/9835, 98X6, 500
0xfc00-0xfffe Special interdivisional file types
So the MSB can be used nicely to determine the system the file has been originally intended for. The LSB then describes the specific file type for that system, which in general is system dependent. As an example the 16-bit code for a PROG file (code 0x20) for a Series 80 computer (code 0xE000) works out to 0xE020. HPDir offers a convenient way to specify both system and type information without having to know the 16-bit code with the -s and -t optons, e.g. -s SE80 -t PROG for the above example.
The most comprehensive description of LIF probably can be found in the HP64000 floppy reference manual. See here for a LIF specification excerpt from that manual.
There have been different tools provided for handling LIF discs. Still quite useful are the LIF Utilities for DOS from HP. The LIF utilities support the handling of LIF floppy discs in standard PC floppy disc drives and drives connected via HP-IB similar to the HPDir program. A DOS-based graphical user interface covers functions like initializing LIF discs, copying files from DOS to LIF and vice versa, purging files as well as editing LIF discs with a hex editor. The LIF Utilities work under DOS and Windows 9x, but not under NT based Windows like XP or Vista. The HP-IB operation is restricted to HP's own HP-IB interface cards (namely the HP82335A, the HP82990A and the HP88500A interfaces) and can communicate only with drives supporting the CS80/SS80 command sets. Drives based on the AMIGO command set are not supported, neither are non-HP IEEE488/GPIB controllers. The LIF Utilities are available for download from keysight.com (look here for download). The manual for this software can be separately downloaded here.
Another LIF tool, also provided by HP, are the Standard Data Format (SDF) Utilities. Although originally intended for the exchange of data with HP analyzer instruments, there are two programs included (LIF.EXE and LIFDIAG.EXE) for LIF access, file conversion and diagnostics. Just like the LIF Utilities those programs allow initializing LIF discs as well as file copying, deletion, conversion and listing both using standard floppy disc drives and drives connected via HP-IB. The SDF utilies support the SS80, but not the AMIGO command set. However, in contast to the LIF utilities those programs support the PCII and AT-GPIB IEEE488/GPIB cards from National Instruments in addition to the HP88500A and HP82335 interfaces. The SDF Utilities are also available for download from keysight.com (look here for download).
Tony Duell's LIF Utilities for Linux are more intended for the handheld HP calculators/computers like the 41C or the 71B, but provide useful routines for LIF disc access or file conversion under Linux. More about this utility collection can be found at hpcc.org (look here).
Finally, there is still a basic support for LIF under HP-UX. For a certain period, the LIF format was used as bootstrap format (an initial execution vector was added in the system record for this purpose).
Other File Systems by HP
Whereas the 9845/AMIGO file system was intended just for the HP 9845 and the HP 300/250/260, the LIF file system was used widely among several systems like the series 80, the series 200/300 and the 64000. LIF support is still available even witin the latest HP-UX versions.
However the 9845/AMIGO file system and the LIF file system were not the only file systems developed by Hewlett-Packard. Especially with the development of HP-UX, support for multiple file systems got into the scope. Both the 9845/AMIGO and the LIF file system, and even the 64000 file system did not provide support for subdirectories, which was a no-go for HP-UX system volumes. So HP first implemented the (ate the time) standard Bell file system, plus two own file systems, the Structured Directory Format (SDF) and the High performance File System (HFS). The simpler SDF file system finally was restricted to the series 500, whereas the more complex HFS got the standard HP-UX file system first for the series 200/300 and later for any other system running HP-UX.
Series 200/300 HP-UX storage volumes all contain a leading 8 kByte LIF section, followed by either a LIF file area or an HFS partition.
Please note that HPDir is not (yet) capable of dealing with SDF and HFS file systems.
All of HP's HP-IB mass storage devices apply to the same device architecture, which is based on different components such as hosts, interfaces, devices, units, and volumes:
HP-IB Mass Storage Model
|Logical Component||Description||Physical Implementation|
The host is the computer which is talking to peripheral devices.
With the focus of this web site, this is the HP 9845 mainframe. Generalized, it also can be a HP 85, 9826 or 9000/300, or any other computer capable of talking to HP-IB periperhals (including PCs).
Interfaces connect both the host and the device to a common communication medium (in this case, the HP interface bus, or HP-IB) for data exchange. So both the host and the peripheral device each need at least one interface to communicate with each other.
Hosts can use more than one interface (e.g. for connecting to different peripheral bus systems). Also, devices can have more than one interface (e.g. HP-IB and RS-232) to use different communication mechanisms.
Every interface on the host side is identified by a so-called select code (SC), which for HP-IB interfaces is 7 by default, and an HP-IB address, which normally is 21. From the host view, every interface on the device side is represented by one or more HP-IB address(es), which for HP's mass storage devices normally is restricted by the common mass storage protocols to a range between 0 and 7, but in principle can use any free HP-IB address between 0 and 30.
For the HP9845, this is the 98034 interface. For other hosts like the 9000/300 or a PC, this can be a plug-in board.
Peripheral devices in general have their interface(s) built-in, mostly implemented by one of the common HP-IB controller chips (HP PHI, NEC7210, TMS9914) in combination with an HP-IB transceiver.
Devices provide mass storage to the host. The host talks to them via a common communication medium (here: the HP-IB). There is no need for the host to know anything about the device but the address(es) of its HP-IB interface, since the host in fact talks to interfaces, not to devices.
Each device has at least one unit, and one interface, but in principle can be implemented with both. Sometimes there are master devices and slave devices. In that case, the master device connects to the host, and shares some of its components to the slave, e.g. for sharing the same HP-IB interface or drive controller(s).
The device is the housing box which encloses all the drives, with a power switch, a product label which identifies the model, and plugs for power and connection to the host etc.
There can be more than one unit (even of different type like a hard disc and a floppy disc) in the same housing box, which is then called a combo device.
Master devices connect to the host, and share to the slave the same HP-IB interface and/or drive controller (which in general makes the slave system cheaper).
Units in terms of HP's mass storage concept provide a certain type of mass storage medium, e.g. a hard disc, a floppy disc or a magnetic tape or some other type.
Each unit represents exactly one mass storage medium, however with auto-changers, multiple media can be accessed without user action.
Units can be identified by the unit number, which can be between 0 and 9, and defaults to 0 in case there is just one single unit in a device.
Units are implemented by a drive as a combination of a drive controller, the drive hardware, and a medium (like a hard disc, a floppy disc, a magnetic tape, a paper tape or a paper card). For slave devices or drives, the central drive controller of the master can be shared.
Media can be either fixed mounted or removable.
There can be more than one unit (even of different type like a hard disc and a floppy disc) in the same housing box, which is then called a combo device.
Volumes are subdivisions on a medium (same as a partition), which allow especially very large mass storage media to get subdivided into manageable parts. This can be of special importance if the used file system does not support hiearchical directory structures.
Volumes can be identified by the volume number, which can be between 0 and 9 and defaults to 0 in case there is just one single volume in the medium.
Volumes can be either soft-implemented as tables on the storage medium, where location, size etc. of a volume is written by the formatting software, or hard-implemented by firmware and/or fixed formatting of the medium. Most media, however, implement exactly one volume.
The AMIGO protocol does support multiple identical drives, but not drives of different type in a combo device under the same HP-IB address, so in order to provide e.g. a floppy drive and a hard disk drive in one housing (like the 9133A), each has to be identified with its own HP-IB address.
The thing is different with the SS/80 and CS/80 protocols. Both protocols describe the device characteristics on unit and volume level, too. So peripherals supporting the SS/80 or CS/80 protocols (such as the 9133D) can provide drives of different type simply as distinct units behind the same HP-IB address.
The addressing for HP-IB periperals is performed with the so-called mass storage unit specifier, or msus. The msus as used with HPDir must be of the form
<select-code> as one-digit-number identifies the interface in the host, which is connected to the peripheral (7 by default),
<hpib-address> as two-digit-number denotes the HP-IB address of the peripheral device (normally between 0 and 7 for mass storage),
<unit> as optional one-digit-number defines which drive/medium shall be used in the peripheral device (e.g. floppy vs. hard disk in a CS80 combo device) and defaults to 0 if omitted,
<volume> as optional one-digit-number selects the volume on the medium (in case there is more than one volume defined) and defaults to 0 if omitted.
Please note that the trailing colon (":") is mandatory.
700: denotes peripheral device with HP-IB address 0 connected to the host via interface with select code 7 (the most common msus). Note that since <unit> and <volume> are omitted, they both default to 0.
80621: this fully qualified msus specifies to access volume 1 of unit 2 on the peripheral device with HP-IB address 6 connected to the host via interface with select code 8.
The main idea behind the HPDir program was to provide means for working with HP 9845 file systems - independent whether those file systems are stored in binary images, on vintage HP-IB drives or on floppy disc media in standard PC floppy drives. Just like HP's unified mass storage concept for the HP 9845, HPDir can be run the same way on all supported media (image files, HP-IB drives and standard floppy disk drive). The appropriate source is identified by an msus-like specifier.
For working with older HP-IB drives from the HP 9845 era, support for the AMIGO command set has been added. Another requirement was to provide a utility which can be used under modern operating systems and which could be integrated into an explorer-like environment. For the latter, integration into the well-known Total Commander was preferred over integration into the Windows explorer, since the Total Commander is by far the more versatile file system utility.
Sample Directory Listing of an HP 9845 File System
In order to enable even more general application, LIF is supported in addition to the HP 9845 file system format, and the CS/80 and SS/80 command sets are supported in addition the the AMIGO command set. All functions available for the HP 9845 file system and AMIGO based HP-IB drives are also applicable to LIF file systems and CS/80 or SS/80 based peripherals.
HPDir comes in two flavors. One is a console application running under 32-bit-Windows. The other is provided for working with a common graphical user interface via two different plugins for the well-known Total Commander file manager: a packer plugin and a file system plugin. The packer plugin is useful for working with binary image files only, and is very similar to the use of e.g. ZIP archives. The file system plugin supports the full range of media, including binary image files, drives connected via HP-IB and vintage floppy disc media in the standard PC floppy disc drive, and it has some additional features, like setting file attributes.
HPDir should work under all 32-bit Windows versions (9x/ME/NT/2000/XP/Vista/Windows7).
Direct floppy disc access will work with the majority of standard floppy disc drives as long as the form factor matches. In some (rare) cases, however, the installed floppy hardware may not be able to read non-DOS discs. In those cases, HPDir also will not be able to read them.
For IEEE488/GPIB boards currently supported see the following table:
|API's and Chipsets||Boards successfully tested with HPDir||Boards which should work with HPDir but have not yet been tested||Boards which are known not to work with HPDir|
|NI 488.2||NI PCI-GPIB (large board with TNT4882C)||
All boards supported by NI's standard NI 488.2 driver (current version 2.7.1, use 2.2.4 for Windows 98/ME):
1) no Vista support
|Custom TNT4882/ TNT5004 Driver||
NI PCI-GPIB (large board with TNT4882C)
|NI-PCI-GPIB+ (board with analyzer option)|
|NEC µPD7210||NI GPIB-PCIIA||All PCII/IIA compatible boards|
|TI TMS9914A||Ziatech 9914/9914A||All TMS9914 compatible ISA boards|
|NI NAT4882||NI AT-GPIB|
|NI TNT4882C||NI AT-GPIB/TNT, NI AT-GPIB/TNT PnP|
Note that due to different capabilities of those boards, hardware which don't work with HPDir may work with HPDrive and vice versa (see the HPDrive section for details). Also note that HPDrive in particular doesn't support the NI 488.2 API and the NI 488.2 driver cannot coexist with the custom TNT4882 driver on the same machine.
If you make your own experience with IEEE488/GPIB boards and HPDir, please send me your reports with the contact feature, and I'll include your results in the above list.
HPDir directly accesses the hardware registers, so be careful in using multiple instances of HPDir on the same GPIB hardware or in using other drivers in parallel.
No special installation is required for using HPDir within Windows 9x/ME. The same
applies within Windows NT/2000/XP/Vista/Windows7 if HPDir is used with image files
Operations on HPIB drives need (of course) a GPIB/IEEE488 interface board.
HPDir needs additional drivers installed in the following cases:
- If you are running HPDir under Windows NT/2000/XP/Vista, AND you are using an ISA GPIB board (such as a NI GPIBII/IIA) with HPDir, please install the DlPortIO driver package before use.
- If you are using HPDir with an arbitrary standard NI 488.2 compatible board, please make sure the standard NI 488.2 driver is properly installed.
- If you are using HPDir in combination with a TNT4882C or TNT5004 based PCI-GPIB board, please make sure either the standard NI 488.2 driver OR the custom TNT4882/TNT5004 driver is installed (note that another utility, HPDrive, won't support the NI 488.2 driver, so if you want to use both utilities, the custom TNT4882/TNT5004 driver is recommended instead of the NI 488.2 standard driver).
- If you are planning to use HPDir with direct floppy disc access
under Windows NT/2000/XP/Vista/Windows7, please install the FDRAWCMD driver
In all other cases, HPDir will run without any additional drivers.
The standard NI 488.2 driver normally comes with the National Instruments boards. The latest NI 488.2 driver can be obtained from NI's web site www.ni.com.
The FDRAWCMD driver is part of the HPDir distribution package. The custom TNT4882/TNT5004 driver can be downloaded from this page (see the HPDrive section or the README for installation instructions).
The DlPortIO driver package can be downloaded from different places. Since they are frequently changing, please use google search on "DriverLinx" if you need that package.
You can check for compatible IEEE488/GPIB hardware by executing
within a console window from the directory where hpdir.exe resides. If this won't show any boards HPDir can work with although your board is listed as supported in the above table (see section System Requirements), there might be besome additional configuration required for you board.
PCI based boards in general don't need special configuration (they are 'plug-and-play'). If you are using an ISA board, please please set the boards I/O base address as follows:
|Board Type||I/O base address|
|NI PCIIA and compatibles (NEC µPD7210 or NAT4882)||
|NI PCII and compatibles (NEC µPD7210 or NAT4882)||02B8 (default)|
|NI AT-GPIB and compatibles (NAT4882)||02C0 (default)|
|NI AT-GPIB/TNT and compatibles (TNT4882)||02C0 (default)|
If required, use the -port option for setting the base address manually.
hpdir -scan -port 0x3e0
tests for compatible boards on base address 03E0.
Please note that NI's PnP ISA boards like the AT-GPIB/TNT PnP are configured by the OS in combination with NI's own NI-488.2 driver (rather than by jumper or DIP-switch). So for configuring the board to one of the addresses shown above, you first have to install NI's NI-488.2 software (I am using version 1.70 which at least supports Windows up to XP), then go to the Windows device manager, select the NI PnP hardware, uncheck "Automatic Configuration" and select a resource setup with the I/O address of your choice (ideally one of the defaults in the table above). You can keep the NI-488.2 software installed, since HPDir does not interfere with NI's driver (unless you are performing e.g. data acquisition with NI's software in parallel to running HPDir).
Interrupt and DMA setting are of no relevance for the HPDir program, however you should make sure both interrupt and DMA settings do not conflict with other hardware installed in your system.
Some boards like the NI PCII/PCIIA should be configured into 7210 mode manually before use. For example, some PCII/PCIIA boards support both 7210 and 9914 mode, to configure those boards into 7210 mode, set switch #8 on the DIP-switch to the ON-position (=position 1). For other boards, consult the documentation delivered with those boards.
If your board offers the choice for operating as device or system controller, chose 'system controller' for using HPDir (ability for acting as system controller is prerequisite for using HPDir).
HPDir can be widely configured with a larger number of command line options (see the following sections for details). If you need a permanent change in configuration, you can provide a configuration file hpdir.ini to HPDir. When invoked, HPDir first looks for this configuration file in the current directory, and then in the directory where the hpdir.exe executable resides. If found, the settings in this file are applied. Since precedence of command line options ist higher than those of the configuration file, config file settings can still be overwritten by using command line options.
The configuration file is also useful for defining new media types for which there is no built-in support by simply adding your own media definitions in this file.
Note that, if a configuration file is present, only the media presets defined in this file are applied, and all built-in media information is disabled. So if there is a hpdir.ini file, but no media presets are defined in there, no media types will be available for initialization or conversion. This is a point which will probably be changed in the future. Use hpdir with the -presets option to get a list of the effectivly available media types.
See the sample hpdir.ini file provided with the HPDir package for details on the configuration options available. Use the hpdir -info command for assistance.
HPDir also can use an Fdio configuration file for direct floppy access if present. See the Fdio Project for more information.
Binary images as used by the HPDir and the HPDrive program are quite generic. They are just 1:1 images from the records on the media they represent, just as they are produced with the UNIX dd command. So each image file has exactly the same size as the overall sector or track data on the disc or tape they are created from. The binary images contain no information about the source medium, especially nothing about the original drive geometry (sector size, sectors/track, sector interleave etc.). Binary images are just a linear collection of 256-bytes-records, starting at record 0.
This is exactly the view of the HP 9845 operating system unified mass storage concept, and makes it easy to abstract from the original drive hardware. The suggested Windows filename extension is .hpi (for HP image).
The source selector (msus) for image files is just a reference to the image file path, preferably but not necessarily with the extension .hpi, e.g.:
lists the file content of the image file c:\tmp\image.hpi.
HPDir can also be used for accessing drives connected to the PC via GPIB/HP-IB. This requires a compatible IEEE488/GPIB card (see "Supported IEEE488/GPIB Cards" below). The way the HP-IB drive is connected has to conform to the IEEE-488 rules for cable length and cable stacking. The IEEE488/GPIB interface in the PC has to be configured as system controller in order to play the role of the host system.
The following steps all have to be executed in a console window from the directory where your hpdir.exe resides.
You can check for compatible IEEE488/GPIB hardware by executing
Mass storage devices should generally be configured to a GPIB primary address between 0 and 7, and up to 10 units are supported for each device, and each unit can hold up to 8 volumes. The source selector (msus) for an HP-IB device is of the form
where the first digit is the controller number (always 7), the next two digits (xx) are the primary address of the HP-IB drive, followed by the optional unit (y) and volume numbers (z). The brackets just identify optional parts of the msus.
A list of the peripherals currently connected to the GPIB can be obtained by executing
The connection to a specific HP-IB drive can be initially checked with the diagnostic feature of HPDir. If the tested drive has the GPIB primary address 0, execute
hpdir -diag 700:
and select the first entry "GPIB diagnostics (loopback test)" from the menu, then just press ENTER to use the default value for the loop count. HPDir will now send data over the GPIB to the drive, receive a copy and compare it to the original data sent. In case errors orccur during this operation, HPDir will give an appropriate error message.
If everything works fine, just quit the menu, insert a valid medium in the HP-IB drive and execute
which lists the content of the storage (assuming the address of the drive is 0 and there is an already initialized file system on the medium).
There are some HPDir commands which are only used in combination with HP-IB drives, but not with images or the with the standard PC floppy drive:
|hpdir -clear <msus>||sends a Selected Device Clear (SDC) message followed by an AMIGO Clear to the device. Use "7:" as <msus> to send an Universal Device Clear (DCL) to the whole bus.|
|hpdir -unload <msus>||sends a command to the device to eject the loaded media (if applicable)|
|hpdir -query||looks for all devices currently connected to the GPIB|
Sometimes there is the need for handling original floppy discs, maybe because there is no suitable vintage drive hardware available, or there is no possibility to connect to the drive via GPIB. Generally, the use of vintage media as long-term storage is deprecated, since no one knows how long those media will work error-free. In order to archive floppy contents, at least an image should be created, but in principle, HPDir offers for floppy discs the same functionality as for binary images and HP-IB drives.
HP used a floppy sector format which is not supported by DOS or Windows. If you try to access such a vintage disc within DOS or Windows, you'll get an error message accordingly. Although many standard PC floppy disc drives can be tuned to read even those non-standard formats by directly programming the floppy disc controller (direct floppy disc access), there is no guarantee that it works with your specific drive hardware.
The source selector (msus) for direct floppy disc access is of the form
where X is any digit between 0 and 3. 0 addresses the first drive (normally mapped to DOS or Windows drive A:), 1 the second drive (mapped to B:) and so on. Example:
tries to access the first floppy drive and then lists the directory content of the floppy disc in this drive. Note that "hpdir A:" will not work, since A: as DOS/Windows drive identifier is reserved for specification of a binary image file path.
The functions for direct floppy disc access are borrowed from another utility, the Fdio program (see the Fdio Project). If you run into problems, use the more comprehensive options or the troubleshooting procedures of the Fdio program. In general, HPDir will try to determine the floppy disc format automatically. If this automatic detection should fail and you are sure about the specific floppy disc format, you can use the Fdio utility to create an image which then can be used by HPDir. With Fdio, you can specifiy the format either from a number of presets or by setting the media parameters manually.
There are two plugins available for the popular Total Commander, a powerful replacement of the Windows Explorer. The plugins are intended for those who prefer a graphical user interface over console applications with their command line options or who just want to use the highly productive features of the Total Commander.
Total Commander is a shareware file manager for Windows 9x up to Windows 7 (even runs under Windows 3.1) and can be downloaded here.
There are two different types of plugins. The packer plugin allows access to a binary image file in a way very similar to ZIP archives or ISO CD-ROM images. Binary images as used with HPDir or HPDrive schould have the file name extension .hpi in order to activate the right packer plugin. The file system plugin allows access to whole HP 9845 or LIF file systems via the network neighborhood. You should install both plugins and use them as appropriate.
How to install and use the HPDir packer plugin:
- Download the HPDir package and copy the files hpdir.wcx and HPDirDialog.dll to any directory you like
- In Total Commander, choose 'Configuration - Options'
- Open the 'Packer' page
- Click 'Configure packer extension WCXs'
- Type 'hpi' as the extension for the plugin into the upper right drop-down field
- Click 'New type', and select the hpdir.wcx file
- Click OK in all open dialog boxes. You can now use the plugin via 'Files - Pack' (or by opening archives of this type).
And here is how to install the HPDir file system plugin:
- Download the HPDir package and copy the files hpdir.wfx and HPDirDialog.dll to a directory of your choice.
- In Totalcmd, choose 'Configuration - Options - Operation - FS-Plugins'
- Click on 'Add'
- Choose the hpdir.wfx file and click OK. You can now access the new file system via the Network Neighborhood.
If Total Commander complains one of the plugins is 'not a valid plugin' you probably forgot to copy the HPDirDialog.dll file.
The packer plugin is normally activated by just opening a binary image file with extension .hpi with Total Commander. Total Commander will then show the directory content of this image and allows you to apply the known Total Commander file operations like copying files to and from the image, view or delete individual files or edit them with your favorite editor.
Total Commander with HPDir Packer Plugin
In order to preserve the original HP 9845 or LIF file type, appropriate extensions will be appended to the original file name when showing the content of the image file. So if there is a file TEST of type DATA, it will be listed in Total Commander as TEST.DATA (in the example above which is taken from the first HP 9845 System Exerciser tape, REvid4 is of type DATA, TAPE of type PROG and the binary program MEMTST of type BPRG). When extracted from an image, this file name extension is added to the original file name.
Vice versa, when copying a Windows file into an image, known file type extensions are used to set the right file type in the image and stripped accordingly. Also note that if a file has another defined record size than the standard 256 bytes, the defined record size is added just before the typed extension with an ampersand ('&') as prefix. (in the example above, the files DATA1 to DATA5 have a defined record size of 128 bytes, and the file DIRECT has a defined record size of 10 bytes, all other files have the standard defined record size of 256 bytes).
The file system plugin works much the same as the packer plugins. However, with the file system plugin you can also change the file attributes like creation/change time (LIF only) and protection, and you can activate or deactivate automatic file type conversion and the use of file name extensions for the preservation of 9845 or LIF file types. More important, the file system plugin works not only on binary image files, but can be addressed to any valid source selector (msus), which includes drives connected via HP-IB and direct floppy disc access.
Selecting the HPDir Filesystem Plugin in Total Commander
The file system plugin is activated by first chosing the network neighborhood from the Total Commander drive selector, and then selecting the HPDIR plugin.
A small dialog then asks you for the source selector/msus (which is the same as for the console version of HPDir). You can enter either the path of an image file (as it is done in the example below), or a direct access floppy disc drive (e.g. with "0:" for the first drive), or a mass storage device connected via HP-IB/GPIB (e.g. with "701:" for the device with GPIB address 1). In this dialog, you can also specify whether typed file name extensions shall be used and whether automatic file conversion is switched on or off.
HPDir Filesystem Plugin Dialog
Automatic file conversion looks each time a copy is done to or from a 9845 or LIF file system, whether the file type is convertable to or from plain text format or not. If it is convertable (which is currently the case for 9845 DATA files and LIF ASCII files), the file content is translated to and from standard Windows text format. So it is for example possible to edit 9845 BASIC programs on a PC as text file and write them back into the original DATA format automatically (transparent use of 9845 or LIF files).
HPDir Filesystem Plugin View
Finally the filesystem plugin's view in the Total Commander is pretty close to that of the packer plugin. Note that it is now possible to connect also to remote HP-IB drives, to set the file attributes and to use automatic file content conversion (e.g. converting HP 9845 DATA files such as BASIC program listings towards normal Windows text files and vice versa).
Please note that the Total Commander Plugins both operate on file level. See the next section on how to use the whole functionality of HPDir beyond the plugins, including creating, duplicating and initializing of whole media, file systems or images.
The console version of HPDir with its command line options is a little bit more complex than the plugins described above, but it also offers many more options. Under Windows 9x/ME HPDir is run in a command shell, under Windows NT/2000/XP/Vista/Windows7 in a cmd shell. All functions are completely identical under both Windows types.
Rather than providing a separate executable for each HPDir operation (as e.g. DOS does), all commands are implemented in one single executable and can be executed in the form
If the <command> specifier is omitted, HPDir uses the -list command as default.
All HPDir commands need a target file system or device to work on. The target file system or device is specified with a source selector (msus). If the source selector is omitted, HPDir asks for the msus interactively. There are thre different types of selector, one for binary image files, one for direct floppy disc access, and one for drives connected via GPIB:
hpdir <command> <image_selector>
hpdir <command> <fd_selector>
hpdir <command> <gpib_selector>
The binary image selector is just the Windows path to the appropriate image file.
The selector for direct floppy disc access <fd_selector> is a single digit for the drive number which shall be used. Drive 0 refers to Windows drive A:, drive 1 to Windows drive B: and so on.
The selector for drives connected via GPIB consists of a GPIB board identifier (always 7), a two-digit identifier for the primary GPIB address of the device, and, optionally, the selected unit and volume, with one digit each. If unit and/or volume are omitted, they default to unit 0 volume 0.
Both the <fd_selector> and the <gpib_selector> are terminated with a colon (':').
lists the directory content of the binary image file c:\temp\image.hpi.
lists the directory content of the floppy in the first disc drive.
lists the directory content of the GPIB device with the primary address 0, the unit 1 and the volume 2.
Below is a summary of all commands. Execute HPDir with the -h option for a summary. Also have a look into the README file for up-to-date information.
|-list <msus> [<filespec>]||Generate a directory listing from the selected source. For HP 9845 file system, the output is the same as for a HP 9845 host system. For LIF file systems, the SRM directory listing format is used. This command is also assumed as default if no command is specified at all.|
|-extract <msus> [<filespec>]||Extract file(s) from file system. If a file already exists, the user is interactively asked for overwrite. An existing file will automatically be overwritten if the -y option is used.|
|-add <msus> [<filespec>]||Adds file(s) to file system. If a file already exists, the user is interactively asked for overwrite. An existing file will automatically be overwritten if the -y option is used.|
|-remove <msus> [<filespec>]||Removes file(s) from file system (doesn't care whether file have the protected attribute or not)|
|-copy <msus> <filespec> <target>||Copies file(s) within a file system. If a file already exists, the user is interactively asked for overwrite. An existing file will automatically be overwritten if the -y option is used. Note that -copy can't be used to copy files between two different filesystems or media or between Windows and another file system (use -add or -extract instead).|
|-attrib <msus> [<filespec>]||Sets attributes for a file. Possible attributes are protection, system and file type (see the -p, -s and -f options). Setting file creation time is LIF specific and currently not supported.|
|-rename <msus> <filespec> <target>||Renames one single file or moves one or more file(s) to another location. <target> specifies either the new filename or an existing target location (directory or msus).|
|-create <msus> <file> <size>||Creates one file of size <size>. Size is measured in blocks, so the actual file size in bytes depends from the blocksize used (see -b option).|
Creates a new file system on the specified image or device. The appropriate file system type can be specified with the -lif, -disk45 or -tape45 options. Default file system is the HP 9845 disk file system. All existing file data will be overwritten.
If an image file is specified which does not yet exist, it will be automatically created. So the -initialize option is the perfect way to create initialized images with one single step.
|-format <msus>||Performs a low-level format of the selected media. Images and floppy discs will be zero'ed. The effect on HP-IB drives depends on the drive itself. Generally, factory-new media must be formatted before a file system can be created on the disc or tape. All existing file data will definitely be overwritten.|
Outputs detailed information about the selected image or device including the currently loaded media.
For setting up your own drive presets in both HPDir and HPDrive config files, drive data is also provided as suggested preset strings for use in hpdir.ini and hpdrive.ini, which then can be tuned to your needs.
|-clear <msus>||Sends a GPIB clear command to the device.|
|-unload <msus>||Sends the appropriate command for ejecting a currently loaded disc or tape.|
|-diag <msus>||Opens a menu for device, media and GPIB diagnostics. I call them 'mini-diags'. Helpful for problem identification in case of failures.|
|-defrag <msus>||Rearranges the files in a file system so that intermediate free storage areas are eliminated and the files are 'packed' closely together in order to gain more space on the medium. All file information and data will be preserved. On HP-IB/GPIB drives this operation may take several minutes.|
|-check <msus>||Tests the file system for consistancy for diagnostic purposes.|
|-dup <msus> <target>||
Creates a 1:1 copy of an existing file system, just like the UNIX dd command. Can be used to produce hpi images from media, restore media from images, or to make identical image and media copies. The media of the target msus must be at least as large as that from the source msus. Even works with CS/80 tape drives. If you need to make a 1:1 copy from floppy discs at media level (low level sector copy), use the Fdio utility.
Any error during the copy process will abort the duplication. Use the -nostream option to produce duplication of partly defective source media.
|-convert <msus> <target>||Very much the same as the -dup command, but allows to change the target file system with the -lif, -disk45 and -tape45 options. Can be used to convert one file system type into another, e.g. tape45 format into disk45 format. Also supports conversion of one media type into another (e.g. an 82901 image into a 9895A image). Note that unless -lif or -tape45 options are used, target file system is always disk45.|
|-presets||Lists the built-in presets for media formats. Used for -<mediatype> option.|
|-scan||Checks installed IEEE488/GPIB hardware for compatibility with HPDir|
|-query||Scans all possible primary GPIB addresses (0-30) on the GPIB bus for currently connected devices. Useful to see which devices are connected and whether they are supported by the HPDir utility.|
|-license||Show license info.|
Where <msus> is one of <image_selector>, <fd_selector> or <gpib_selector> (see above description) and <filespec> generally stands for one or more filenames, including wildcards. Note that filespecs with wildcards have to be enclosed in double quotes, otherwise they will be expanded by the shell. Also note that 9845 and sometimes LIF filenames are case sensitive and that the asterisk '*' is a valid part of a filename for 9845 or LIF files. Use the -nowc option below if asterisks are to be used in filenames.
Most commands can be tailored with one or more option. Below is a summary of all available options with reference to the commands they work with. Again, execute HPDir with the -h option for a summary. Also have a look into the README file for up-to-date information.
|-h||Output a summary of the command line options.|
|-a <address>||Select the primary GPIB address for the controller (default 21). Must be between 0 and 31.|
|-b <blocksize>||Specifiy the blocksize for a file (default 256). Applies to -add, -attribute and -create.|
Enables automatic file conversion between HP format and DOS/Windows format. Currently, conversion of DATA and ASCII files is supported in both directions. Default is no conversion (copy binary data without change).
Conversion from DOS/Windows text format does assume all input as string data, whereas conversion from DATA format to DOS/Windows text format converts also integer and floating point data. Also note that certain special control characters (as used for example for screen addressing in programs) of type DATA can't be translated into proper DOS/Windows characters, so check your program first for non-printable characters before doing the conversion.
If the source file contains data which doesn't apply to the 9845 DATA or ASCII syntax rules you'll get an error message.
|-d <destination>||Specifiy the target Windows directory or msus for -add and -extract. Default is the current directory or msus.|
|-i <interleave>||Select n:1 interleave factor, applies to -format and -initialize (default depends on the type of disc used)|
Specifies detail of HPDir's reporting. Possible values are
|-lf <logfile>||Log all output into <logfile>. On slow systems this option may be faster then console output.|
|-n <label>||Specify disc label, applies to -initialize (LIF format only)|
|-q||Selects quickformat option (i.e. does not perform a possibly time-consuming erase of the whole media surface), applies to -initialize|
Specify target system for file. Currently <system> is one of the following for the 9845 file system:
"9845" (= HP 9845B/C, this is the default)
For LIF, the following system types are supported:
"98X6" (= HP 9000 Series 200, this is the default)
Note that for LIF only known combinations of file type and system are allowed. For unknown file types, the default system (98X6) will be used.
Applies to -create, -add and -attribute. Affects system attribute only.
Specify file type. See the README for the file types currently supported.
Use -t #xxxx for directly setting the 16-bit xxxx file type code (system dependent, you have to know what you are doing)
|-v||Show version info.|
|-y||Don't ask for confirmations (just do it).|
Set 6 byte of auxdata for LIF files in combination with -attrib. Example:
hpdir -attrib -aux 8001fffc2512 boot51.hpi SYS_BAS51
|-lif||Force using the LIF file system|
|-disk45||Force using the 9845 file system (disc version)|
|-tape45||Force using the 9845 file system (tape version)|
|-notype||Disables the automatic use of filename extensions for preserving the file types|
|-nowc||Disables the expansion of wildcards in filenames. Useful if file names contain asterisks.|
|-nostream||Disable faster I/O streaming and use sector based I/O instead. Only used for diagnostic purposes or for copying partly defective volumes in combination with -dup.|
|-noparity||Disables generating odd parity for GPIB commands (default is parity enabled)|
|-board <board>||Selects the working board in case more than one compatible IEEE488/GPIB interface is installed. The first board has the number 0. See the -scan option for a list of installed boards.|
|-port <port>||Specifies the I/O port where HPDir should look for a compatible IEEE488/GPIB board. Useful if you are sure the board works with HPDir on a certain port address but the autodetect function fails.|
|-license||Show license info.|
If you want to create or initialize a file system with HPDir, a 9895A floppy is assumed by default. If you like to chose another drive type, you can select the desired drive type with the following options:
|-<mediatype>||use <mediatype> media format (default is 9895A floppy disc drive format).|
Specifiy custom disc geometry parameters manually (overrides autodetect) with the following parameters:
c: cylinders per disc
Click here for downloading HPDir (plugins and console version):
|HPDir 2.03 for Windows 9x/ME/NT/2000/XP/Vista/Windows7:||hpdir-203.zip|
|Custom TNT4882/TNT5004 Driver 2.0 for Windows XP/Vista/Windows7:||gpibdrv-20.zip|
This beta version may still have bugs. It is recommended to make copies from valuable images you are working on in case something goes wrong. Please use the contact feature to let me know if something doesn't work as expected.
The FDRAWCMD driver package is included in the distributions. Please make sure the FDRAWCMD version included in the distribution is used, it has been tested with HPDir and older versions may not work any more.
The DlPortIO driver package can be downloaded here.
Please note that, although non-commercial use is still provided free of charge and distribution is encouraged within the Creative Commons Public License, HPDir is no longer free software. If you plan to use HPDir within a commercial context, please use the contact feature to ask for commercial conditions.
The change in licensing has become necessary in order to provide a minimum of protection towards existing offers of other commercial solution vendors, since due to the support of contemporary GPIB hardware the functionality of HPDir and HPDrive is no longer restricted to pure vintage technology.
If you are looking for software to test HPDir with, I recommend a visit to hpmuseum.net. There is much software available, especially for the HP 9845 series. Note that the software there is packaged with Teledisk, an ancient disc image utility. I've written a program which does the transformation from Teledisk images into hpi images for most of the packages available at hpmuseum. See the Software Section on this site for more information.
Here are some hints for the most common problems:
|Supported GPIB Board is installed but not detected||Board is set to the wrong I/O base address (ISA boards only)||Either set the board to a supported I/O base or use the -port option|
|DLPortIO driver is not installed (ISA boards under NT/2000/XP/Vista only)||Install the DLPortIO driver|
|Custom TNT4882/TNT5004 driver is not installed (PCI boards only) and/or standard NI 488.2 driver still present||If present, uninstall NI 488.2 driver, install the custom TNT4882/TNT5004 driver|
|PCI-boards only: You have resumed your system from standby (suspend to RAM or S3 mode)||NI's PCI boards seem to have problems with this mode, simply restart your system|
|HPDir can't access devices on the bus||IEEE488 cabling restrictions violated||Check your GPIB cabling, connect host and PC exclusively|
|GPIB address duplication||Check for other devices on the bus with equal GPIB address. If necessary, use the -a option|
|Another system controller is active on the bus||Remove any other hosts from the bus or at least switch them off|
|There is a conflict with another controller or device||May happen e.g. with a PC-GPIB in combination with a 98034 HP-IB controller on the same bus. In that case, remove the 98034 HP-IB controller temporarily from the bus. Also, a 9895A may disturb accessing a 9121 on the same bus in combination with a PC-GPIB controller. The real cause is still not obvious.|
|Transmission errors during transfers||Same as above||
Same as above. Generally, the GPIB doesn't like devices on the bus which are not switched on. This applies especially for a 9121 drive.
You should never connect more than one system controller to the bus, even if only one system controller is switched on.
If you get a message like this
and you want to use an ISA based GPIB board, please install the complete DlPortIO driver package. If you are not using such kind of ISA board, please remove the DLPORTIO.DLL from your windows\system32 directory.
Also check the README in the HPDir package for troubleshooting procedures.
If you can't solve the problem, use the options "-l 4 -lf <logfile>" to create a detailed log of what has happened and sent it to me.