DDC-I Logo

Sitemap  

DDC-I Ada Compiler System  
Accessing IDE disks in embedded environments.

Product Family: DACS
Target CPU: 80x86
Language: Any
Host: PC/Windows, PC/LynxOS, Sparc/Solaris, Sparc/SunOS, VAX/VMS

The need for mass storage is spreading into the embedded domain and with the advent of ruggedized disk drives as well as high capacity solid state "virtual" disks, the use of "disks" in embedded systems has become a viable option.

DDC-I has developed a package that can be used on embedded systems that are equipped with a formatted IDE disk either high level (using FAT16 files), or low level (accessing all the drive's sectors directly).

This note describes in more detail the features of this package. If you are interested in more details regarding this package, you are kindly requested to contact DDC-I support.

Operations offered

High level operations:

The package IDE_Driver allows data capture using files in the root directory of the disk connected to the embedded system (e.g. a PC). The files must have been created earlier, e.g. by having the target disk inserted as a secondary disk on a normal PC system (or - if a PC - booting the PC in DOS mode). The files are allowed to be somewhat (but not arbitrarily) fragmented, but it is recommended to have files allocated contiguously on the disk. This may be achieved using disk defragmentation tools on a PC.

Since the files are preallocated their maximum size cannot be exceeded. Files are considered as a set of sectors (of 512 bytes). The first sector of a file could be used to record the actual last sector written to the file, but this is left entirely to the application.

IDE_Open (file_handle, name)

Gains access to all the sectors in the file specified via a string that must name a file in the disk's root directory. The sectors are numbered from 1 and up. Exceptions will be raised, if the file cannot be found or is too fragmented. Currently only one file may be open at any time.
IDE_Close(file_handle)
Disconnects from the file.
IDE_Read(file_handle, buffer)
Reads a sector from the current position and updates this. A sector is the minimal unit of memory being handled by the IDE_Driver. The buffer may be specified as a System.Address value pointing to a user area. Exceptions will be raised, if outside the file, or hardware errors are detected. The operation is always awaited.
IDE_Write(file_handle, buffer)
Writes a sector to the current position and updates this. Exceptions will be raised, if outside the file, or hardware errors are detected. The operation is always awaited.
IDE_Index(file_handle), IDE_Set_Index(file_handle), IDE_File_Size(file_handle)
Reads the current position, sets the current position, and retrieves the size (in sectors) of the file.
IDE_Name(file_handle)
Retrieves the name of the open file as a string value.
IDE_End_Of_File(file_handle)
Returns TRUE, when next read or write would be outside the file, else FALSE.
IDE_Is_Open(file_handle)
Returns TRUE, when file describes an open file, else FALSE.
IDE_Status(file_handle)
Returns the low level status information available from the last operation.
Low level operations:
With these routines access to the IDE disk sectors is controlled by the application, and it may regard the disk as one huge file, if so desired. Read and write operations on sectors can be made anywhere on the disk surface in accordance with the disk's recorded geometry.

IDE_Geometry

Returns geometry information about the drive (cylinders, heads, sectors).
IDE_Reinitialize
Rereads geometry and resets general variables
IDE_PHY_Read(geometry, buffer)
Reads a sector from the specified 'geometry' position. Buffer may be a System.Address value pointing to a user area.
IDE_PHY_Write(geometry, buffer)
Writes a sector to the specified 'geometry' position
IDE_Status
Returns the low level status information available from the last operation. When using the low level routine, all operations should be checked to have no errors, using this call.

With the low level operations the disk can be handled totally unformatted, however with the risk that bad sectors may be present.

Special features
DDC-I's DACS-80x86 targeting bare PCs can define a DOS file to contain an application to be loaded at the next machine reset (boot). Tools are provided to set or replace this application, when the PC is started in DOS mode. This is done by changing the boot sector information on the drive. The tools allow for enabling or disabling the boot sector information, so it may be restored to its original value.

An embedded Ada application may also redefine the boot application, so that another application will be loaded next tyme the system is reset. This is achieved by having the boot code read a specific root directory file that in turn contains information about the file to boot load from (name in root directory, size information etc). By changing this controlling file, the embedded application can switch between several applications, and even receive a new application (perhaps an improved version of itself) via a serial line or some other channel, write it to a preallocated file with the use of the IDE_Driver package, define this downloaded file to be the next application to load, and eventually reboot the machine, so that this new application takes over.

In this way it is possible to update a series of remote, embedded PCs with the latest version of the software and have them switch to the new version after a successful download.

 

Contact
602-275-7172
sales@ddci.com

IDIQ Contract Vehicles:
--------------
AMCOM Express
DESP II
F2AST
R23G

Links

Support

Members Area
    -Member Login/Return
    -Login Help

Atlas Support Packages
    -Atlas Premium
    -Atlas Advantage
    -Atlas Choice

Complimentary Support

Submit a Software Trouble Report

Customer Quote:
"DDC-I has a good solution for us and your willingness to get down to the issues and help us get what we need has made it a clear choice."