VERSION 0.4.0.80 (ALPHA STAGE!) (March 8th, 2009)
NOTE: This software is in a early state, although its main parts are working. However, not all parts are working as they should.
This version has been given out to some people who want to test it. Unfortunately, I did not have the time to update this page yet.
You should not edit the opencbm.conf file anymore, neither on Windows, nor on Linux. If you want to use this version, please write me a mail, and I will explain it to you. This text would be a good basis for an update of this page. ;)
VERSION 0.4.0.62 (ALPHA STAGE!) (May 6th, 2007)
NOTE: This software is in a VERY early state. Parts are not yet working as they should. Do not use this version unless you really, really want to test the software.
This version fixes a nasty bug which prevented tools using the old APIs to work. (for example, flash, morse, but also mnib/nibtools did not work.)
VERSION 0.4.0.60 (ALPHA STAGE!) (May 1st, 2007)
Additionally to the 0.4.0.51 version, this version added --adapter/-@
command-line options to cbmctrl, cbmcopy, d64copy, cbmformat, cbmforng, and
cbmrpm41. This options is not yet shown in the help, but it is there.
You can use it this option to select the plugin. That is, "-@ xu1541" selects
the xu1541, "-@ xa1541" selects the xa1541 plugin, respecively. Of course, for
this to take effect, they have to be available in the /etc/opencbm.conf
file. The name is the one that is specified between in the [...] lines.
There is also the possibility to specify a port number. Take, for example, you
have two parallel ports. Then you can specify -@ xa1541:1 for LPT1, and -@
xa1541:2 for LPT2.
If this parameter is ommitted, the default value of the opencbm.conf file will
be used.
The API functions cbm_open_driver() and cbm_get_driver_name() are obsolete now.
use the newer cbm_open_driver_ex() and cbm_ger_driver_name_ex() functions instead.
They let you specify the adapter in the same format as --adapter/-@. You can give a NULL
pointer, in which case the default adapter will be used.
Note: These new APIs are not yet available in the VDD. This is still to be
done.
The 0.4.0.51 version added support for the XU1541 cable, which was invented and implemented by Till Harbaum.
Note: I did not take much time to update this site, this, some information may be outdated!
Installation
First of all, you must download the latest version of OpenCBM to use v0.4.0.80.
Windows
XA1541/XM1541 part (Windows)
If you are using the XA1541/XM1541 part of OpenCBM, the installation did not change elementarly from the earlier, official 0.4.0 release. The only things you have to consider are:
- generate a opencbm.conf file, as explained below.
- On Windows, you must copy the plugin opencbm-xa1541.dll into the directory c:\windows\system32\opencbm-xa1541.dll
Note, however, that instcbm might report an erroneous "There were errors in this installation", which you can safely ignore.
XU1541 part (Windows)
If you want to install the XM1541/XA1541 and the XU1541 on Windows, do the following:
- install the XM1541/XA1541 part, as with version 0.4.0.
- Install the needed driver for the XU1541. You can download it from Download/xu1541-drv.zip. Unpack it, plug-in the xu1541 in a free USB slot, and give the "Found New Hardware" wizard the directory of the unpacked drivers files to find the files.
- Copy the opencbm-xu1541.dll file to C:\Windows\System32.
- generate a opencbm.conf file, as explained below.
If you want to use the xu1541 part only, do the following:
- Install the needed driver for the XU1541. You can download it from Download/xu1541-drv.zip. Unpack it, plug-in the xu1541 in a free USB slot, and give the "Found New Hardware" wizard the directory of the unpacked drivers files to find the files.
- Copy the opencbm.dll and the opencbm-xu1541.dll file to C:\Windows\System32 (you can ommit this step if you always run the OpenCBM tools from the directory where opencbm.dll is installed, and if you adjust the path to the opencbm-xu1541.dll in the opencbm.conf file you have to generate in the next step).
- generate a opencbm.conf file, as explained below.
Linux
At the moment, Installation on Linux is easier than on Windows. Do the following:
XA1541/XM1541 part (Linux)
If you want to use the XA1541/XM1541 plugin only, compile OpenCBM as you did with previous versions. After having done the "make -f LINUX/Makefile" command, issue an "make -f LINUX/Makefile plugin-xa1541", and after the "make -f LINUX/Makefile install" command, issu a "make -f LINUX/Makefile install-plugin-xa1541" command. After doing this, generate a opencbm.conf file, as explained below.
XU1541 part (Linux)
If you want to use the XU1541 plugin only, you need the libusb driver installed. Note that most distributions already have that driver.
After this, compile OpenCBM as you did with previous versions. After having done the "make -f LINUX/Makefile" command, issue an "make -f LINUX/Makefile plugin-xu1541", and after the "make -f LINUX/Makefile install" command, issu a "make -f LINUX/Makefile install-plugin-xu1541" command. After doing this, generate a opencbm.conf file, as explained below.
If you want to use both plugins, you can use "make -f LINUX/Makefile plugin" and "make -f LINUX/Makefile install-plugin".
opencbm.conf file
Starting with v0.4.0.50, OpenCBM supports a plugin concept. This way, you can install different transport cable support routines (XU1541 vs. XM1541/XA1541) on one machine.
In order to use the plugins, you have to generate a opencbm.conf file. On Linux, this file must be available as /etc/opencbm.conf, while on Windows, it should reside in C:\Windows\System32\opencbm.conf. This files gives some locations for the plugins needed by the OpenCBM shared library (DLL).
On Linux machines, this file /etc/opencbm.conf should look like:
[xa1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xa1541.so [xm1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xa1541.so [xu1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xu1541.so [plugins] default=xu1541
On MacOS X, the file resides in $(PREFIX)/etc/opencbm.conf (normally, /usr/local/lib/etc/opencbm.conf), and it looks like:
[xa1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xa1541.dyn [xm1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xa1541.dyn [xu1541] location=/usr/local/lib/opencbm/plugin/libopencbm-xu1541.dyn [plugins] default=xu1541
On Windows machines, this file c:\windows\system32\opencbm.conf (replace c:\windows with the appropriate windows directory if you did not install Windows there; If you do not know the location, try echo %WINDIR% on a command prompt) should look like:
[xa1541] location=c:/windows/system32/opencbm-xa1541.dll [xm1541] location=c:/windows/system32/opencbm-xa1541.dll [xu1541] location=c:/windows/system32/opencbm-xu1541.dll [plugins] default=xu1541
Note that with both examples, you will be usinig the xu1541 plugin for transfer. If you want to use the XA1541/XM1541 plugin, change the last line to "default=xa1541" instead. Additionally, note that the installation and the cable selection will be made easier in some future version.
Some more notes: There is no XM1541 plugin available. The entries [xm1541] and the following location line define an alias xm1541 for the xa1541 plugin. The name between the [...] is the name to specifiy in the --adapter/-@ command-line parameters. That's the reason why this alias is defined in these samples.
VERSION 0.4.0 (Apr 28th, 2006)
This release adds some functions, as well as bug fixes to cbm4win. Additionally, it is a release for cbm4linux. Have a look at the changes.
This project is hosted on . Thanks for the service.
Contents
- New version
- Contents
- Introduction
- History
- OpenCBM/CBM4WIN user manual
- Download
- Frequently asked questions (FAQ)
- External links (NEW: June 9th, 2006)
- Where to buy ready cables (NEW: February 1st, 2006)
Introduction to cbm4win
What is cbm4win?
cbm4win is a port of cbm4linux to Windows. It allows for access to a VIC 1540, 1541, 1570, 1571, or even 1581 floppy drive from the PC on Windows NT, 2000 and XP.
What can I do with cbm4win?
The most important things you can do is to copy D64 or D71 images from a real drive to the PC, or from the PC to a real drive with the help of d64copy. Furthermore, you can copy single files in both directions, too. Some more tools (for example, cbmctrl) are given, too.
Is there 3rd party support for cbm4win?
VICE will have support for cbm4win in the next version. There is an internal version of YAPE which supports cbm4win, too. Other people have already showed interest in supporting cbm4win in their products, too.
What hardware is needed in order to use cbm4win?
Of course, you need a PC running Windows NT, 2000, XP, or 2003. Furthermore, you need a real drive, like the VIC 1540, 1541, 1570, 1571, or 1581 (1581 not fully supported). Then, you need an XA1541, XM1541, XAP1541 or XMP1541 cable in order to connect the driver with the PC.
Where can I find a list of frequently asked questions (FAQ)?
Simply go to the end of this web page, or use the link.
History
The following history applies to the various versions of CBM4WIN
v0.4.0 (April 28th, 2006)
The changelog is no longer maintained here. It can be found at changes
v0.1.0a (May 29th, 2005)
This version fixes some errors. Some of them are SECURITY ISSUES, thus, I
highly recommend upgrading to that version.
Furthermore, d64copy wrote d64 files which were "wrong" if there were errors on
the disk.
Another issue is a fixed performance problems, which occurred especially with
multiprocessor machines (SMP) or Hyperthreading machines (HT), but also with
NT4.
In more detail, the following changes have been applied from 0.1.0:
- drivers (cbm4wdm.sys/cbm4nt.sys):
- performance fix for some machines, especially SMP, HT, and NT4. This fixes #1070112.
- Allow for specifying the cable type via the registry (instead of auto-detecting).
- cbmctrl:
- Fixed 2 format string vulnerabilities
- Do not allocate a 64KB buffer on the stack anymore which might allow for a stack overflow.
- instcbm:
- Do not allocate a 128KB buffer on the stack anymore which might allow for a stack overflow.
- Fixed 3 "off-by-one" buffer accesses, resulting in access to non-allocated memory.
- Fixed some more possible accesses to uninitialized variable.
- d64copy:
- cbmcopy:
- Fixed rare shutdown problem. This fixes #1070076 for cbmcopy.
- cbmformat:
- New drive routine with probing. This fixes #1066199.
- all:
- a misplaced if() statement could lead to access of uninitialized variable space. Fixed that.
- Error in debugging output could result in multiple evaluations of some functions. Fixed that.
December 6th, 2004
Added a section for Frequently asked questions (FAQ) on this web site.
v0.1.0 (November 28th, 2004)
The following changes have been applied from 0.0.12:
- cbmctrl detect (and the function cbm_identify() which is used in the API) left one byte in the command buffer. Because of this, a cbmctrl status command afterwards returned nothing. Fixed this.
- Added documentation how to build the source packages. See doc\COMPILE.TXT file.
Download
You can download cbm4win 0.4.0.80 (ALPHA!) from http://www.trikaliotis.net/Download/opencbm-0.4.0.80/opencbm-0.4.0.80-i386.zip (i386, iA32) or http://www.trikaliotis.net/Download/opencbm-0.4.0.80/opencbm-0.4.0.80-amd64.zip (AMD64).
Currently, the sources are ONLY available from the SourceForge CVS.
Acknowledgements, thanks and links
Cbm4win is heavily based on cbm4linux, written by Michael Klein. Cbm4linux itself uses work from Star Commander, written by KOVÁCS Balázs a.k.a. "Joe Forster". I like to thank both for their steady help and their patience.
The xu1541 work as done by Till Harbaum.
Furthermore, I want to thank the following people:
- Michael Klein for cbm4linux and many discussions. I do not know if I would have started this project without this.
- KOVÁCS Balázs a.k.a. "Joe Forster" for Star Commander, his advice, and for giving me cables for free to work on this project;
- Wolfgang Moser for steady discussions, testing, and bug reports, as well as giving me some more needed equipment;
- all of my testers for steady tests, reports, and discussions.
Contact, bug tracking, mailing lists
Feel free to contact me if you have questions, suggestions, or you just want to confirm that something does work or does not. Specifically, if you are using cables not specified above, or drives not specified above, I would like to hear if CBM4WIN works with this combo.
More specifically, I have setup a project page on sourceforge. If you want to submit bug reports, I would be thank you for submitting to the bug tracking system over there. There are even two mailing lists available for announcements and for user discussions.
If you want to contact me directly, just contact me at cbm4win@trikaliotis.net, or go to my homepage at http://www.trikaliotis.net/.
Frequently asked questions (FAQ)
Many thanks to Wolfgang Moser for maintaining the FAQ!
Hardware related
Cable related
Q: Is there any reason why you're not supporting the quasi standard XE1541 cable?
A: See answer to the next questions
Q: Why are the X1541 or XE1541 cables not supported?
A: Technical implications prevent reliable use of these cable types.
If I want to transfer to a VIC drive, the drive is allowed to block the transfer for as long as it needs (the so-called "listener hold off", T_H in the C64 Programmer's Reference Guide). If the drive is ready, it signals this with the DATA line. The controller - in this case the PC - has to react to this in not more than T_NE, "non-eoi response", with setting CLK active. T_NE is rather short, it must not exceed 200 us. Typically, it should be something around 40 us. If the controller exceeds this 200 us bound, the listener - the drive - thinks that we wanted to signal an End-Of-Information, thus, there is no more data. For the PC to be able to cope with that very low time bound, there are two options:
- busy waiting
- use interrupt
No. 1, busy waiting, is not really an option. If we would do this, then we would have to monopolize the whole machine for the whole time. That is, you would not be able to hear music, work with MS Word, or even abort the transfer! Now, what would happen if the drive does not answer at all, for example, because it crashed? Well, yes, your PC would not be usable at all, thus, you would have to reboot that one, too. (This is not entirely true: Switching the drive off and on would help, too).
OTOH, if we use the interrupt, this is not a problem anymore. When the driver signals DATA, the parallel port generates an interrupt. In the interrupt routine, we react to this by setting CLK, and then, we wake up the (sleeping) main routine, which does the rest of the work. This way, we do not monopolize the whole CPU of the PC, which is very good in terms of overall stability of the system.
Now, the PC's parallel port cannot generate an interrupt on every line. With an XE cable, it can generate an interrupt on a RESET - this does not make much sense, does it? Because of this, the XM cable exchanges RESET and DATA w.r.t. the XE cable. This way, using an XM cable, the DATA line can generate interrupts, as needed.
Thus, to sum it up: It is very unlikely that an XE cable will ever be supported.
Q: Can a XE1541 cable be converted into a XM1541 cable and how is this done?
A: Yes, a XE1541 can easily be converted into a XM1541 cable
- You only need to exchange lines 5 and 6 (RESET and DATA) at the DIN-Plug side of your XE1541 cable to convert it into a XM1541.
- You also might consider building an adaptor, which just consists of two DIN plugs (one male, one female) which crosses the lines 5 and 6 (RESET and DATA). This way, you have a XE1541 if you operate your cable without the adaptor, or a XM1541 if it is operated with the adaptor.
- The same idea (for being operated with an XEP adaptor) is available at The Commodore serial cable, twisted version
By the way, as easy as converting a XE1541 cable into a XM1541 is converting a XM1541 into a XE1541 with the very same methods described above.
Software problems
Installation issues
Q: cbm4win refuses to work on my machine, what can I do?
A: Try enabling the "Legacy Plug+Play Detection" for the parallel port. It was reported that on a Sony Vaio laptop with Windows 2000 installed, cbm4win could be installed without a problem, but none of the commands affected the connected 1541 disk drive in any way. Different parallel port settings in the BIOS were double checked without any help. The reporting user found that enabling the "Legacy Plug+Play Detection" for the LPT port helped to establish the communication with cbm4win and the connected disk drive.
To enable "Legacy Plug+Play detection" for your LPT port, where the 1541 disk drive is connected to (with a XM1541 or XA1541 cable), follow these steps:
- Log in as administrator
- Right click on "My Computer"->"Properties"
- Select the "Hardware" tab
- Click to "Device Manager"
- Open the "Ports (COM and LPT)" tree
- Right click on "LPT1"->"Properties" (or the LPT port you are using for cbm4win)
- Select the "Port Settings" tab
- Enable the "Enable Legacy Plug+Play Detection" checkbox by clicking onto it
- Clock the "Apply" button to activate this setting
This may not help in any circumstances. From the user's report it is known that this was only needed for his Sony Vaio laptop. Other machines which also run Windows 2000 do not need this.
Using the tools
Q: Where are all the commands listed that can be used with cbm4win?
A: Please refer to the cbm4linux.txt manual in the "doc" directory. Alternatively you may visit the cbm4linux 0.3.2 Users Guide, since proper user documentation for cbm4win is not available yet.
Q: Where can I find a description for all the subcommands and options of the different tools (cbmctrl, d64copy, cbmcopy, cbmformat, instcbm)?
A: Each of the user commands above knows the option "--help", which explains parameters and subcommands in short, e.g.: "cbmctrl --help"
Q: But if I enter the command "cbmctrl --help", then a black window opens for a second or so and disappears immediately. I can't read any of the informations, what is going wrong here?
A: You need to open a dedicated command line console (a.k.a. "DOS-console").
What did you do? Entering the command "cbmctrl --help" via the Start->Execute dialog? Please enter the command "cmd" within this dialog box. This opens a dedicated command window. Change into the directory, where you extracted the cbm4win tools (if you didn't place them into Windows' search path) and enter e.g. the command "cbmctrl --help" within the console window.
(NEW: July 4, 2005) Q: cbmctrl and other commands work fine. Anyway, whenever I use d64copy or cbmcopy with --transfer=parallel, the transfer hangs.
A: For using the parallel transfer options, you need to own an XP1541 companion cable additionally to your XA1541 or XM1541 cable. The parallel transfer will not work without that cable. Thus, to be able to transfer data, use serial2 (if you have only one attached drive simultaneously) or serial1 (in any other case).
External links
Here, I will start adding additional links to useful software which is related to cbm4win. For a start, there is just one:
- GUI for CBM4WIN (thank you, Leif!) (ONLY WORKS WITH CBM4WIN 0.1.0 and 0.1.0a; for 0.4.0, use the version from http://sourceforge.net/project/showfiles.php?group_id=122047.
- mnib36 can be used with cbm4win and cbm4linux.
Where to buy ready cables?
If you want to use cbm4win, you need an XA1541 active cable or an XM1541 multitasking cable, as mentioned above. I do not manufacture them or sell them. Anyway, as a service, I list shops where these cables can be bought. Please, do NOT understand this as a suggestion from me to buy them there. These are just starting points. I am not aligned to anyone there, nor do I have any profit if you buy any cable there. I do not know most shops myself, thus, I cannot tell you about the quality of the cables or delivery times. If you need to buy a cable, please pick a shop which you think you can trust. Think yourself!
- The X1541 shop. This is Joe Forster's shop. In fact, this is where I got my 2nd XA1541 and my XP1541 cable from. There is also a German section as well as the USA/Canada section of this shop available. Here, you can get all types of cables.
- In the PC section of DoD's shop, you can get X1541 and XE1541 cables (which do NOT work with cbm4win!) and the XM1541 cable. In fact, he is the manufacturer of the cables from Protovision-Online.
- There is a hardware shop over at http://www.commodore16.com/ which sells XE1541, XM1541 and XA1541 cables.