Back Up and Restore NVRAM Data With CD-i Link

Back Up and Restore NVRAM Data With CD-i Link

This article is a follow-up to my article from 2013 and explains how connect a Philips CD-i player to a modern Windows PC and how to back up and restore NVRAM data with CD-i Link. I will cover the other option CD-interlink in the next article.

Back then, I built a null-modem cable which I still use today. Over the years, I’ve used it to connect all my CD-i players with PCs and portable devices to transfer data and for debugging purposes. The cable was built according to the CD-i Nullmodem Cable Specification with a Mini-DIN-8 and a DE-9F connector and works with most of the CD-i players. Some players require additional adapters and/or different connectors: Top-loading players with only one port (e.g. CDI450) require a port splitter; professional CDI60x players require a cable with DE-9F connectors on both ends while LG/DVS players require a cable with a DE-9F and a DB-25F connector. You can find most of the usage scenarios and additional cable and adapters that I’ve built in the CD-i Archives.

Setup and function test

Almost no modern computers have a built-in serial port anymore. A cheap USB to serial adapter will work fine; for example, the DIGITUS DA-70156 with an FTDI FT232RL UART chip. Windows 10 will recognize it instantly and install the required drivers on its own.

DIGITUS DA-70156 USB to serial adapter
DIGITUS DA-70156 USB to serial adapter

Check the Windows device manager to see if the adapter has been installed and note the port number. The standard settings (9600/8-N-1) are exactly how it needs to be set up.

Next, we need a terminal emulation program. Since HyperTerminal is no longer included in Microsoft Windows, we will use the open-source program Tera Term instead. Again, check the settings and then connect to the serial port.

When connected, press and hold the space bar and turn your CD-i player on. If everything works as expected, it should display a low-level test menu.

DVS VE-200 Low-level test menu
DVS VE-200 Low-level test menu

If not – check cable, adapter and settings again until you can access the low-level test. Then, you can continue with the next section.

CD-i Link

CD-i Link (cdilink) is written by CD-i Fan, the author of the CD-i Emulator. It is a fast and versatile command-line tool with plenty of options for all your back up and restore needs. In this article, I will focus on file transfer options only. At the end you will find some more useful options, e.g. to dump ROM files. If you want to explore all options: The program archive includes a comprehensive documentation.

cdilink communicates via the “stub” protocol with CD-i players. Most players already have a subset of this protocol built-in and will download the full program when connected to a host computer where cdilink is executed. Players that don’t have this download subset need to load the program from a disc. I haven’t encountered any player so far that required this disc. In case you need it, the disc image is available here and here.

CD-i Link basics

Run this command first and turn on the CD-i player when prompted: cdilink -p 3 -k
p[ort] 3 uses the serial port #3. Change it to the port number that you have found in the device manager.
-k[eep] keeps the program active for further commands.

C:\cdilink\>cdilink -p 3 -k
CD-i Link version 0.5.2
Please reset your CD-i player!
Waiting for stub...
Downloading cdistub...
000087CC
Ending download stub...
CD-i Stub version 0.5.1
Done!

You want to back up a file from the NVRAM but don’t know what the file is called? Use this command to figure it out: cdilink -p 3 -c -di /nvr
-c[continue] continues the session that we started with the first command.
-di[rectory] /nvr displays the names of the files that are stored in the NVRAM.

C:\cdilink\>cdilink -p 3 -c -di /nvr
CD-i Link version 0.5.2
Checking for stub...
Listing /nvr directory...
LSN    Name
------ -----
    53 player_shell_settings.prf
   189 7th_Guest
  1221 csd

Done!

You have identified the name of the file. Use this command to copy it to your PC: cdilink -p 3 -c -uc /nvr/7th_Guest
-u[p]c[opy] /nvr/7th_Guest copies the save file of the game The 7th Guest from the CD-i player into the current directory of the host computer.

C:\cdilink\>cdilink -p 3 -c -uc /nvr/7th_Guest
CD-i Link version 0.5.2
Checking for stub...
Upcopying /nvr/7th_Guest...
Done!

To delete the file from the NVRAM, use this command: cdilink -p 3 -c -del /nvr/7th_Guest
-del[ete] /nvr/7th_Guest deletes the file 7th_Guest from the NVRAM of the CD-i player.

C:\cdilink\>cdilink -p 3 -c -del /nvr/7th_Guest
CD-i Link version 0.5.2
Checking for stub...
Deleting /nvr/7th_Guest...
Done!

To copy the file back to the NVRAM, use this command: cdilink -p 3 -c -dc /nvr/7th_Guest
-d[own]c[opy] /nvr/7th_Guest copies the file 7th_Guest from the current directory of the host computer into the NVRAM of the CD-i player.

C:\cdilink\>cdilink -p 3 -c -dc /nvr/7th_Guest
CD-i Link version 0.5.2
Checking for stub...
Downcopying /nvr/7th_Guest...
Done!

Up and down indicate the direction of the transfer. upcopy transfers files from the CD-i player to the host computer while downcopy transfers files from the host computer to the CD-i player.

Caution:
Files with the same name will be overwritten without confirmation! Files will be deleted without confirmation!
If a file is write-protected (very rare), OS-9 error 000:214 will be displayed.

When you are done copying files, simply turn the player off. Alternatively, you can run this command: cdilink -p 3 -c -e
-e[nd] ends the session and resets the player.

C:\cdilink\>cdilink -p 3 -c -e
CD-i Link version 0.5.2
Checking for stub...
Ending stub...
Done!

CD-i Link advanced

To automate the whole process, you can save a list of files names to a batch file and add upcopy or downcopy options. This will allow you to back up or restore the entire content of the NVRAM with a single command. Here’s a sample batch file to get you started. Note the placement of quotation marks; they are mandatory when a file name contains a space.

cdilink -p 3 -k
cdilink -p 3 -c -uc /nvr/7th_Guest
cdilink -p 3 -c -uc /nvr/Apprentice
cdilink -p 3 -c -uc /nvr/BURNCYCLE_A
cdilink -p 3 -c -uc /nvr/cdi_Tetris
cdilink -p 3 -c -uc /nvr/Lost_Eden_game1
cdilink -p 3 -c -uc "/nvr/Xplora 1"
cdilink -p 3 -c -uc /nvr/csd
cdilink -p 3 -c -uc /nvr/player_shell_settings.prf
cdilink -p 3 -e

I’ve used batch files like that to fill and compare the contents of the NVRAM while I was working on the NVRAM upgrade.

More useful options:
-roms – this will upload the ROMs of the CD-i player and the DVC into the current directory to the host computer.
-info[rmation] – this will write a text file with lots of information about the CD-i player into the current directory of the host computer.
-i[nteractive] – this will start the interactive command mode. You can enter all options directly as commands.
-q[uit] – ends the interactive command mode.

Continue with CD-interlink in the next article.

15 thoughts on “Back Up and Restore NVRAM Data With CD-i Link”

  1. The original ROM download protocol is documented in the CDI 605 and CDI 605T technical documentation that is now on ICDIA here: http://www.icdia.co.uk/techdocs/index.html.

    I actually “retconned” that protocol into my “stub” protocol when I wrote cdilink in 2005. The protocol should have been included with the cdilink distribution as “stub.txt” but it appears to have been accidentally omitted. I will rectify that for a future version.

    All Philips players have the download protocol in ROM. At the time I wrote cdilink I thought that non-Philips players would still have serial port handling sufficiently like the Philips ones that just starting cdistub from a CD-i disc would work, but that has turned out to be not the case. The Sony players and the Kyocera are supposed to have a serial port, but I have so far been unable to figure out how to use them with cdistub.

    1. Thanks for the information, I will add some of it to the article later.

      What about the Portable CD-i Board / MC68341 Integrated CD-i Engine? I could swear that I’ve used cdilink with my DVS VE-200 without disc before. Now, it just gives me the OS-9/68K System Bootstrap and won’t proceed until I insert the disc and use the -nostub option.

  2. Noob here with a noob question. I’m hoping to backup the save files for my games and I’ve got everything set up so that on Windows 10 I’ve got the Low Level Test displaying. I then open up CDi Link and get a list of commands that says press any key to continue at the bottom, but when I do, it just exits the program.

    Is there a step I’m missing? Should I first be selecting one of the options in the Low Level Test?

    1. The Low-Level Test is not needed for data backup. But shows you that your connection is working, which is a good start!
      cdilink is a command-line program – if you just double-click on it, it will display a bunch of text and exit when you press a key.
      You have to extract it first (e.g. into the directory where you want to save your files in).
      Then, start the Windows Command Prompt (cmd.exe), navigate to the directory with cdilink and run it from there.

      1. Thanks! I think I’m getting closer. I was able to get cdilink to run, but when I type out the command, I get the following message:
        EscapeCommFunction RESETDEV
        SetCommTimeouts
        Cannot change baudrate to 9600

        Under device manager, the port speed is listed at 9600 the same as in your example photo. Any idea what I’m doing wrong?

        1. Which CD-i player do you have? (model/version)
          Did you turn the player off before running the first cdilink command? Turn it on again when you’re asked to reset the player.

          1. Philips 220/97C. I turned it on while holding spacebar in the Tera Term app to bring up the Low Level Test, but kept it as-is after that. Went into cmd and, to simplify things, put the cdilink files into the default directory cmd begins with. Typed out the cdilink -p 4 -k command (my port was COM4 instead of 3) and got the message about the baudrate.

          2. Ok, your player should be fine with cdilink.
            The problem here is Tera Term – only one program at a time can access a serial port.
            Please close it and also turn the player off, then run cdilink again.

    1. You’re welcome! And thanks for the feedback.
      I’ll add a note about this issue the next time I’ll update this article.

Leave a Reply

Your email address will not be published. Required fields are marked *