Last update: Oktober 11th 2025

IDE DSR - Version 18

Download the IDE DSR program
ti dsk image as zip file (ZIP)
Download the IDE DSR sources
ti dsk image as zip file (ZIP)


Inclusive an IdeLdr18.bin for the FinalGrom99 and a .DSK image for the MAME users and the latest version of IDELOAD (11/10/2025) that can be used with the Geneve without executing a ROMPAGE. This is necessary when loading the IDEDSR from DSK1, DSK2 or DSK3 using a TI or Corcomp diskcontroller.

Test programs written in TI-Basic used for the IDE (and HDX) DSR
zip file

You might also need:

The latest version of DU2K
The latest version of DM2K
The latest version of COPYFAT

This page contains information about the IDE-DSR I wrote for the IDE-CARD as designed by Th. Nouspikel.

A Device Service Routine for the IDE-CARD
Features
Hardware settings
Power up routine
Sectors and allocation units
Basic interface
Operation

A Device Service Routine for the IDE-CARD (Version 18)

This is my DSR for the IDE card as designed by Thiery Nouspikel. Also this DSR demands an IDE-drive capable of LBA. You also need Dm2k version 2.2 or newer (for file managing) and Du2k version 1.7 or newer(for initializing).

This version of the IDE-DSR was completely written and build on a PC with Windows-11 using my own written XA99 cross assembler and my own written linker L99. Preliminary tests and debugging was done on my emulator Ti994W. The final test was done on a Geneve with SCSI, HFDC and an IDE-card and of course a genuine TI99/4A with a disk controller and IDE-card.

ide dsr status
The IDE status in TI-basic.


Features

The IDE DSR supports:
  • A maximum of two devices.
  • A maximum of four simultaneous open files.
  • File time and date stamping.
  • A maximum of eight partitions per IDE device.
  • A maximum of eight device names IDE1 through IDE8.
  • DSK1 and DSK emulating on IDE1.
  • A few TI-basic calls.
  • The BQ4802 clock chip and external 512Kb ram.
  • The BQ4847 clock chip and external 512Kb ram.
  • The BQ4852 clock chip with internal 512Kb ram.

The level2 commands:
  • read/write sector (>80)
  • modify file protection(>82)
  • rename file(>83)
  • read file information (>84)
  • write file information (>85)
  • set current path (>87)
  • create directory (>88)
  • delete directory (>89)
  • rename directory (>8A)
  • identify drive (>8C)

The level3 commands:
  • Open (0)
  • Close (1)
  • Read (2)
  • Write (3)
  • Rewind (4)
  • Load (5)
  • Save (6)
  • Delete (7)
  • Status (9)

The level3 file I/O commands:
  • Reading and writing time and date to the clock chip.
  • Reading and writing to a NULL device.

The TI-basic calls:
  • CALL IDEST (display status of IDE card)
  • CALL IDESC (setting the real time clock)
  • CALL IDETD (display the time and data)
  • CALL IDEDSK (enable and disable DSK1 simulation)
  • CALL IDEDIR (display contents of a directory)
  • CALL IDEPWD (print working directory)
  • CALL IDELOAD (loading an assembler type 5 program)
  • CALL IDEOPT (set DSR options)

This DSR gives the IDE-card the same capabilities as i.e. a HFDC or a SCSI drive: a maximum of 260Mb of storage, a maximum of 127 files per directory and a maximum of 114 subdirectories per directory.


If the CRU address of the IDE-card is before the CRU-address of the disk controller (thus >1000), and a subdirectory DSK1 and DSK exists on the IDE-device, and an attempt is made to load a program file from DSK1. or DSK.DISKNAME. then first the subdirectory DSK1 or DSK on the IDE-device is searched. If the program file is found, it is loaded. If the program file isn't found the search continuous on the real DSK1. In this way the editor and assembler and TI-writer can be easily loaded from the IDE-device.

This same sequence is true when reading any kind of data file from DSK1. or DSK.DISKNAME. When writing data to a file on DSK1. or DSK.DISKNAME. and only when that file already exists in the subdirectory DSK1. or IDE1.DSK.DISKNAME then the data is written to that file. In every other case the data is written to the real DSK1.

This also works on a Geneve (in TI-mode off course) with HFDC @ >1100, and IDE @ >1000!!!

Operation

With this DSR the IDE-card can be used with a TI99/4A or a Geneve 9640. Select a CRU address with the rotary encoder.

First time loading the DSR

Set all dip-switches to off, and place switch SW1 in the position off and SW2 in the position TI99 or Geneve.


Re-loading the DSR

The DSR loader for V16 or newer scans all peripheral cards to find the address of the IDE-card.
If your system still boots then leave SW1 in the on position. If the IDE DSR is damaged and your system doesn't boot then place SW1 in the off position.



Loading the DSR

A loader program is supplied with the DSR. Place the disk with the DSR and loader program in DSK1, DSK2 or DSK3 or copy the loader program to a directory called DSR on a hard disk device like WDS1, SCS1 or HDX1. Use the Editor/Assembler module to run loader program. Select option "5 Run program file" and enter: DSK1.IDELOAD (or the path you used) for the program to start. When the loader program is started place switch SW1 of the IDE-card from the off position in the TI99 or Geneve position. Next, select the device name in witch the DSR and loader program is located: 1 for DSK1 and 2 for DSK2, ect. If asked for, enter the second digit of the CRU address as selected with the rotary switch. If all goes well, the DSR will be loaded.



Set the Time and Data

Select "Set IDE clock". With this option the Real Time Clock (RTC) of the IDE-card can be set. In the header of the page the type of the RTC is displayed (BQ4802, BQ4847 or BQ4852) and an indication if the time and date is set or not set.
If the display current time looks okay but it is indicated that the time and date is not set then please set the time and date because file time stamping only takes place if the RTC time and date is set properly.


Set options

Select "Set options" to enable or disable some DSR options. These options are:

  1. DSK1 emulation (default on)
  2. DIR reclen 146 (default off)
  3. Hardware reset (default off)
  4. HW reset timer (default 9)
  5. Software reset (default off)
  6. SW reset timer (default 6)
These options can also be set from TI-BASIC with a CALL IDEOPT command. See the paragraph "Basic interface" for a description of these options.


Loading the IDE DSR in a nutshell:
  1. Make sure your IDE card is working properly.
  2. Download the IDE software and put it on a diskette or other device.
  3. Use the Editor/Assembler module option 5 to run IDELOAD.
  4. Select the device where the loader can find the DSR.
  5. Enter the last digit of your IDE-cards CRU address.
  6. Hopefully the DSR loads without any errors.
  7. Use the Editor/Assembler module option 5 to run DU2K.
  8. Choose option 3 Initialize disk.
  9. Select 1 for IDE and select your IDE drive.
  10. Enter volume label and password (INITIALIZE) and hope for no errors.
  11. Use the Editor/Assembler module option 5 to run DM2K.
  12. Enjoy ...

In case of problems

In some cases the TI99/4A system immediately looks like it is crashed when powered up with the IDE-CARD in the peripheral expansion box and no DSR is loaded yet. I found out that the clock chip can generate a power-fail interrupts when the peripheral expansion box is switched on. To prevent this from happening and to be able to load the DSR, the interrupt pin of the clock chip must be left outside of the IC-socket. For the BQ4847 clock chip this will be pin #5 and for the BQ4852 clock chip this will be pin #34. After the DSR is loaded successfully the interrupt pin can be placed back but this is not necessary.


                BQ4802                              BQ4847                          BQ4852
           ._____    _____.                    ._____    _____.                ._____    _____.
           |     \__/     |                    |     \__/     |                |     \__/     |
      VOUT |  1        28 | VCC           VOUT |  1        28 | VCC       /RST |  1        36 | VCC
        X1 |  2        27 | /WE             NC |  2        27 | /WE         NC |  2        35 | NC
        X2 |  3        26 | /CEin           NC |  3        26 | /CEin      A18 |  3        34 | /INT <<--
      /WDO |  4        25 | /CEout        /WDO |  4        25 | /CEout     A16 |  4        33 | A15
/-->> /INT |  5        24 | BC       -->> /INT |  5        24 | NC         A14 |  5        32 | A17
|nc   /RST |  6        23 | WDI           /RST |  6        23 | WDI        A12 |  6        31 | /WE
        A3 |  7        22 | /OE             A3 |  7        22 | /OE         A7 |  7        30 | A13
        A2 |  8        21 | /CS             A2 |  8        21 | /CS         A6 |  8        29 | A8
        A1 |  9        20 | VSS             A1 |  9        20 | NC          A5 |  9        28 | A9
        A0 | 10        19 | DQ7             A0 | 10        19 | DQ7         A4 | 10        27 | A11
       DQ0 | 11        18 | DQ6            DQ0 | 11        18 | DQ6         A3 | 11        26 | /OE
       DQ1 | 12        17 | DQ5            DQ1 | 12        17 | DQ5         A2 | 12        25 | A10
       DQ2 | 13        16 | DQ4            DQ2 | 13        16 | DQ4         A1 | 13        24 | /CE
       VSS | 14        15 | DQ3            VSS | 14        15 | DQ3         A0 | 14        23 | DQ7
           |______________|                    |______________|            DQ0 | 15        22 | DQ6
                                                                           DQ1 | 16        21 | DQ5
                                                                           DQ2 | 17        20 | DQ4
                                                                           VSS | 18        19 | DQ3
                                                                               |______________|



BQ4802

For a new batch of IDE-cards Chris Schneider has created a daughter board for the BQ4802 clock chip with external CR2032 3 Volt battery. The interrupt pin is not connected on this board, so no problems here.

BQ4802 daughter board components
The BQ4802 daughter board components.

Power up routine

After switching on your computer or after a reset, the power up routine is executed. The power up routine tries to read sector 0 of both devices. If sector 0 can be read and the default AU-number of the root directory (>0040) divided by the number of sectors per AU found in sector 0 equals the pointer to the file descriptor record, then the DSR assumes that the device is initialized and all level-2 and level-3 routines can be used. If a device is not initialized, only the level-2 routines read sector, write sector and identify drive can be used so that Du2k is able to initialize the device.



Sectors and allocation units

The first 32 sectors of an IDE disk are used for the allocation units (AU) free/used table. The second 32 sectors is a mirror of the first 32 sectors. File descriptor records (FDR) and directory descriptor records (DDR) are placed before AU >800, until no more free AU can be found in this section. File data are placed beyond AU >800. When copying files to the IDE device, precisely enough AU's are allocated. When opening a file for writing, a number of 10 AU's are allocated every time new storage space is required. Searching for new AU's starts at the last AU used for that file. If the next block of 10 AU's is directly after the last used AU chain, this chain can then simply expand with the new AU's else a new chain is started. When a file is closed unused AU's are not freed! This is done to prevent to much fragmenting of files.



Basic interface

The following basic statements are implemented in the IDE-DSR:


Displays the IDE status: CALL IDEST

The following information will be print on the screen:

IDEDSR Vxx CRU:>xxxx

IDE1 STATUS:>xxxx
     MAXUA :>xxxx SEC/AU:>xx
IDE2 STATUS:>xxxx
     MAXUA :>xxxx SEC/AU:>xx
     ..
     ..
IDE8 STATUS:>xxxx
     MAXUA :>xxxx SEC/AU:>xx

CLOCK CHIP    : BQ48xx
BATTERY LEVEL : OK
DSK1 EMULATION: ON
The current version and CRU address

The status of the first device
The maximum number of allocation units and sectors per allocation units
The status of the second device
The maximum number of allocation units and sectors per allocation units
..
..
The status of the eight device
The maximum number of allocation units and sectors per allocation units

The type of installed realtimeclock functions: BQ4802, BQ4847 or BQ4852
The battery status of the realtimeclock: OK or LOW
DSK1 and DSK emulation status: ON or OFF

A status of >0000 means that the device didn't respond to the power up routine, a status of >XY01 means that the device did respond to the power up routine. The nibble X with a value of 1 or 2 means that the device is a partition on the master IDE device (1) or slave IDE device (2) respectively. The nibble Y shows the partition number. A value of 0 means the device has no partitions and a value of 1, 2, 3 through 8 gives the partition number. A maximum allocation units of >0000 and/or the number of sectors per allocation unit of >00 means that the IDE-device (or partition) is not initialized. A device can only be initialized if the device responds to the power up routine.



Enable or disable DSK1 and DSK emulation: CALL IDEDSK()

The following arguments must be supplied:

CALL IDEDSK(MODE)



If mode is equal to 0 (null) DSK1 and DSK emulation is disabled,
any other value will enable DSK1 and DSK emulation.


If the CRU address of the IDE card is lower than the CRU address of the disk controller card and if DSK1 and DSK emulation is on and an attempt is made to load a program file from DSK1. or DSK.DISKNAME. then first the subdirectories IDE1.DSK1. or IDE1.DSK.DISKNAME. is checked for the program file to load. If, in some cases this behavior is undesired, CALL IDEDSK(0) can be used to temporarily disable DSK1 and DSK emulation. Also when reading and/or writing sectors from a real floppy with i.e. Du2k, it can be necessary to disable DSK1 and DSK emulation.



Set the time and date of the IDE clock: CALL IDESC(19,23,36,1,6,2024)

The following arguments must be supplied:

CALL IDESC(HH,MM,SS,MM,DD,YEAR)


Hours from 0 through 23, minutes and seconds from 0 through 59.
The month 1 through 12, day of the month 1 through 31 and the year
2000 through doomsday (which apparently is around the year 9999!)

Since IDE DSR V08 the day of the week is calculated with Zellers formula for the Gregorian calendar and written to the real time clock (RTC) automatically.
Zellers formula:
  A = int((year-1)/100)
  B = year-1-100*A
  D = 799+B+int(B/4)+int(A/4)-2*A
  D = (D mod 7)+1

  D= day of week: 1=SU, 2=MO, 3=TU, 4=WE, 5=TH, 6=FR and 7=SA.

The time and date parameters are all checked against their range and the date must exist. The real-time-clock will be set for a 24-hour clock and initialized with the given time and date. The time and date will be used for time stamping of files only when a correct time and date is set after loading the DSR.


Time and date can also be set by writing to the file IDE.TIME:

  100 OPEN #1:"IDE.TIME",INTERNAL,FIXED
  110 PRINT #1:SEC$,MIN$,HOUR$,DAY$,MONTH$,YEAR$
  120 CLOSE #1

Every string value is checked against their range and the date must exist. Every string variable can have a maximum of 5 characters. If the given time or date is incorrect an I/O error 6 (device error) is returned.



Displays the time and date of the IDE clock: CALL IDETD

The following information will be print on the screen:

HH:MM:SS Day MM-DD-YEAR



Hours from 00 through 23, minutes and seconds from 00 through 59.
The day of the week: SU, MO, TU, WE, TH, FR or SA.
The month 01 through 12, day of the month 01 through 31 and the year
2000 through doomsday (which apparently is around the year 9999!)

Time and date can also be read by reading the file IDE.TIME:

  100 OPEN #1:"IDE.TIME",INTERNAL,FIXED
  110 INPUT #1:SEC$,MIN$,HOUR$,DAY$,MONTH$,YEAR$,DAYOFWEEK$
  120 CLOSE #1

Hours from 00 to 23, minutes and seconds from 00 to 59. The day of the week: 01 to 07, Sunday=01. The month 01 to 12, day of the month 01 to 31 and the year 2000 to 9999.



Displays the contents of a directory on a IDE device: CALL IDEDIR("pathname")

The following information will be print on the screen:

Directory off:
IDEx.path.

SIZE=  <sect> USED=  <sect>

Name      Size Type
----------------------------
FILENAME  SIZE TYP    RECL P
DM2K        34 PGM    8192
SRC        123 D/V      80  

Device name IDE1 through IDE8 and working directory

The size in sectors and number of used sectors

The contents of the directory with filenames and or subdirectory
names. The number of sectors the file or directory occupies on the
drive (max 6 digits), the file type  D/F D/V I/F I/V PGM or DIR
and the record length. In case of a program file the total file size
is shown in bytes

It is only possible to display the contents of directories of an IDE device!

The last directory path used is saved. CALL IDEDIR can be used in a few forms. If a directory path is defined in the call a trailing '.' is not mandatory. If a directory paths is preceded with a single '.' then this path is added to the previous path used. If a directory path is preceded with a '..' then this path is added to the previous path used but one directory back. If a directory path is preceded with a '...' then this path is added directly after the device name of the current path. If a directory path is not preceded with a single '.' and the path does not start with 'IDE1', 'IDE2', ..., 'IDE8' then this path is also added to the previous path used. In this case the preceding '.' is not mandatory.

Examples:

CALL IDEDIR("IDE1.")
CALL IDEDIR("IDE1")
CALL IDEDIR("IDE1.DIR1.DIR2")
CALL IDEDIR(".DIR3")
CALL IDEDIR("..DIR4")
CALL IDEDIR("...DIR5")
CALL IDEDIR("DIR6")
CALL IDEDIR
Catalog of the root of IDE1.
Same as above, trailing '.' is not mandatory
Catalog of IDE1.DIR1.DIR2.
Catalog of IDE1.DIR1.DIR2.DIR3.
Catalog of IDE1.DIR1.DIR2.DIR4.
Catalog of IDE1.DIR5.
Catalog of IDE1.DIR5.DIR6., leading '.' is not mandatory
Catalog of IDE1.DIR5.DIR6. using the path saved from the last call



Load a program file directly from BASIC: CALL IDELOAD("path.filename")

The following information will be print on the screen:

CALL IDELOAD("IDE2.UTL.DM2K")

The program file DM2K is loaded from subdirectory
IDE2.UTL. and executed immediately.

It is only possible with this call to load program files from IDE devices! When the program file has ended control is returned to the master title screen.

When this call is used on a Geneve, it sometimes works and sometimes don't and sometimes the IDEDSR is destroyed. I really don't know why this happens!

For CALL IDELOAD the same rules apply for the path as with CALL IDELOAD. The last used path is save and single, double or tripple '.' may be used.

Examples:

CALL IDELOAD("IDE1.PGM")
CALL IDELOAD("IDE1.DIR1.DIR2.PGM")
CALL IDELOAD(".DIR3.PGM")
CALL IDELOAD("..DIR4.PGM")
CALL IDELOAD("...DIR5.PGM")
CALL IDELOAD("DIR6.PGM")
CALL IDELOAD("PGM")
Start program PGM found in the root of IDE1.
Start program PGM found in the directory IDE1.DIR1.DIR2.
Start program PGM found in the directory IDE1.DIR1.DIR2.DIR3.
Start program PGM found in the directory IDE1.DIR1.DIR2.DIR4.
Start program PGM found in the directory IDE1.DIR5.
Start program PGM found in the directory IDE1.DIR5.DIR6.
Start program PGM found in the directory IDE1.DIR5.DIR6.



Print the working directory: CALL IDEPWD

The following information will be print on the screen:

CALL IDEPWD
IDE2.BASIC.PROGRAMS.GAMES.

Print the working directory.
The working directory is the directory last accessed by a CALL IDEDIR
or CALL IDELOAD.



Set DSR options: CALL IDEOPT(n, v)

With this call it is possible to enable or disable some DSR options. These options are:
  1. DSK1 emulation (default on)
  2. DIR reclen 146 (default off)
  3. Hardware reset (default off)
  4. HW reset timer (default 9)
  5. Software reset (default off)
  6. SW reset timer (default 6)

The CALL IDEOPT can be called in a few forms:

CALL IDEOPT
CALL IDEOPT(n)
CALL IDEOPT(n, v)
No arguments; Displays the current setting of all options.
Option number only; Displays the current option value.
Option number and value; Changes and displays the option value.

The option number is from 1 through 6.
Boolean option: A value of 0 disables the option and a value of 1 or higher enables the option.
Numeric options: The supplied value from 0 through 65535 is assigned to the option.



Option 1: DSK1 emulation CALL IDEOPT(1, v)

This option is the same as CALL IDEDSK().

If the CRU address of the IDE card is lower than the CRU address of the disk controller card and if DSK1 and DSK emulation is on and an attempt is made to load a program file from DSK1. or DSK.DISKNAME. then first the subdirectories IDE1.DSK1. or IDE1.DSK.DISKNAME. is checked for the program file to load. If, in some cases this behavior is undesired, CALL IDEOPT(1, 0) can be used to temporarily disable DSK1 and DSK emulation. Also when reading and/or writing sectors from a real floppy with i.e. Du2k, it can be necessary to disable DSK1 and DSK emulation.

CALL IDEOPT(1)
CALL IDEOPT(1,0)
CALL IDEOPT(1,1)
Displays the current option value.
Disable DSK1 emulation
Enable DSK1 emulation



Option 2: DIR reclen 146 CALL IDEOPT(2, v)

With this option it is possible to change the default record length for reading a directory. By default the record length for reading a directory is 38 bytes (Name [11 bytes], Type [9 bytes], File record length [9 bytes], Size [9 bytes]). If the record length for reading a directory is set to 146 then also the file creation and file update time and date can be read. In this case the sequence of the file data is: NAME, TYPE, SIZE, RECORD LENGTH, Creation sec, min, hour, month, Day, year, Last updated sec, min, hour, month, day, year.
If the recrod length for reading a directory is set to 38 bytes it is still possible to read the files creation and last update time stamps. In this case the record length must be defined with the open statement, i.e.: "OPEN #1:IDE1.",INPUT ,INTERNAL,FIXED 146".

CALL IDEOPT(2)
CALL IDEOPT(2,0)
CALL IDEOPT(2,1)
Displays the current option value.
Disable DIR reclen 146, thus the record length is 38 bytes.
Enable DIR reclen 146, file timestamp can be read.



Option 3: Hardware reset CALL IDEOPT(3, v)

Whith this option it is possible to send a hardware reset signal to the IDE device(s). If this option is enabled the reset signal on the IDE port is held low for a certain time defined with option 4. For some IDE devices / CF-cards it is necessary to send a reset signal after power up.

Do not enable this option if your IDE device does not need it. Your IDE device does not need this option if it functions properly after a power up of your TI99/4A or Geneve system.

CALL IDEOPT(3)
CALL IDEOPT(3,0)
CALL IDEOPT(3,1)
Displays the current option value.
Disable the hardware reset option.
Enable the hardware reset option.



Option 4: HW reset timerCALL IDEOPT(4, v)

This option defines the time that the hardware reset signal to the IDE device is held low. The minimum time the reset signal must be held low is 25 micro seconds. The default value for this option is 9 which is about 88 uSec.

The time value for this option can be calculated with the formula: T = (v * 28 + 14) * 0,333 [uSec]

CALL IDEOPT(4)
CALL IDEOPT(4,10)
Displays the current option value.
Set the hardware reset timer value.



Option 5: Software reset CALL IDEOPT(5, v)

Whith this option it is possible to send a software reset command to the IDE device(s). If this option is enabled the reset bit in the control register of the IDE device(s) is set for a certain time defined with option 6. For some IDE devices / CF-cards it is necessary to send a reset command after power up.

Do not enable this option if your IDE device does not need it. Your IDE device does not need this option if it functions properly after a power up of your TI99/4A or Geneve system.

CALL IDEOPT(5)
CALL IDEOPT(5,0)
CALL IDEOPT(5,1)
Displays the current option value.
Disable the software reset option.
Enable the software reset option.



Option 6: SW reset timerCALL IDEOPT(6, v)

This option defines the time that the software reset to the IDE device is set. The minimum time the software reset must be set is 5 micro seconds. The default value for this option is 6 which is about 60 uSec.

The time value for this option can be calculated with the formula: T = (v * 28 + 14) * 0,333 [uSec]

CALL IDEOPT(6)
CALL IDEOPT(6,4)
Displays the current option value.
Set the software reset timer value.



Reading and writing to a NULL device:

The is a special file build into the DSR which is called NULL. Writing to the NULL device throws everything away and reading the NULL device always returns 0. This is just a file for test purposes.

  100 OPEN #1:"IDE.NULL",DISPLAY,VARIABLE
  110 INPUT #1:A$
  120 INPUT #1:B
  130 PRINT #1:"Throw this away"
  140 PRINT #1:1234.5678
  150 CLOSE #1



Warning: goto_ti99geek.html could not be included.