I use many old parallel SCSI(-1/-2) devices (many "Fast SCSI-2", 10MB/s, 8 bit wide), which I want to attach to a modern computer via a classic Adaptec PCI SCSI host adapter in "target mode". It should emulate an HD drive of arbitrary size (or better: multiple devices at once). The data lives in image files on real HDDs or RAM.

I've crawled through the web to find any helpful information to make a (probably simple?) goal reality. While it seems that both GNU/Linux and FreeBSD offer such possibilities and also seem to be configured quite easily, there's a serious lack of documentation / man pages here. The two or three proposals I've found online and tried in my local setup all didn't work. So, after weeks of trying, I thought it might be good idea to put my problem here and directly ask professionals.

What I'm NOT after: Anything iSCSI and network target stuff - this is about vintage computing. I know of several different (mostly hardware) solutions, including SCSI2SD, ACARD converters and so on, but those are not providing what I want. I also don't want any kind of embedded solution, hardware hacks etc. - the only solution I'm interested in is the one described above: SCSI card & PC & free / open OS (no Windows solutions for me, please - but you may put them here for others). There's a (rather hacked-together-ish) tool ("scsi_target" IIRC) with free code, that's quite unstable in the long run and slow, too - that's no suitable solution.

What I have: I have an IBM PC with a suitable Adaptec AHA-2940/SE card supporting "target mode". It is also activated in it's BIOS extension and has been given a host ID there. (Open to alternative PCI parallel SCSI host adapter card recommendations if this one was a bad choice) The hard drive contains a recent FreeBSD with a custom kernel (with all modules activated that support / are required for "target mode" SCSI) and a recent headless Ubuntu with SCST.

I got none of those solutions working.

Related links to resources I followed, tried or read only to learn from: https://www.vogons.org/viewtopic.php?t=66955, http://web.archive.org/web/20141021111304/http://www.tenox.net/docs/scsi/the_programmers_guide_to_scsi_brian_sawert.pdf, and http://scst.sourceforge.net/

Common problems: Unfortunately, but naturally of course for this tech, there's some confusion - while searching for information with keywords "Target" / "Target mode", I get lots of hits in the iSCSI-Bubble, which is not my topic here. Even when adding "parallel scsi" / "pscsi". There's a "pscsi scst extension" mentioned on their massively outdated website, but I didn't find anything related to it, apart from some unfinished stuff. By tendence, it's unclear how to write up the config files; often lacking information about options, possible values, their meanings, etc. I lack some knowledge on commands / tools to use for debugging, monitoring and scanning scsi bus and whether the software is configured correctly, too. I also often don't know how to find the correct SCSI bus location (like 1:3:0:0 or only 3:0:0 - I know it's bus:target:lun, but how am I supposed to count / find out / be sure, and what's the first digit on a 4-number path?).

I'd appreciate gaining some knowledge here, getting helpful answers and possibly see some of you put up setup instructions and different example config files for mentioned frameworks / OSses to learn from and eventually get a working system.

Thank you for your attention and stay safe!

  • 2
    Possibly the retrocomputing stackexchange would be more appropriate for this question. What driver does your Adaptec get under Linux? Because the driver needs to support target mode to have a chance to get an application running which emulates a harddisk, so the first step is to take a close look at the documentation for the driver.
    – dirkt
    Feb 16 at 21:35
  • 1
    @dirkt Thank you; I also thought about putting it in retro computing but eventually decided to put it here first. (I hope that's okay for now :-/ ) Concerning the driver: I tried to find any information about target mode and those few bits I came across say it'd be supported by the standard one. Also crawled the kernel's menuconfig for any related option; if I found some, I activated them as far as it made sense and compiled it (don't remember, that happened at the beginning of this odyssey ;) ) .. so: standard driver or standard with target mode options enabled. ("Aic7xxx")
    – Zod
    Feb 16 at 21:46
  • 1
    @dirkt I edited my question to make clear that the adapter card may be replaced by a more suitable / compatible one, as long as it is PCI bus.
    – Zod
    Feb 16 at 21:53

Very very preliminary answer:

Googling for the aic7xxx driver (using aic7xxx target mode keywords) finds this email exchange from 2001, which concerns a AHC_TARGET_MODE define in the source code of the driver. From this, it looks like the driver source code was adapted from BSD for Linux, and target mode at least back then only worked on BSD.

Looking at the driver code current in the Linux kernel still finds the AHC_TARGET_MODE checks, but no file where it is actually defined (unless that happens during some configuration -- I didn't actually try to compile that driver).

So my assumption would be that target mode still doesn't work under Linux, and you need to go to BSD. But I may be wrong here.

The mail mentions that

FreeBSD's SCSI layer (CAM) has explicit support for target mode operations.

I do not know much about FreeBSD, but if this was my project, as the next step I'd install FreeBSD, look at the CAM SCSI layer, see if it already has something to emulate harddrives (likely, Linux has several projects for that, and yes, they also can be used with iSCSI and other SCSI transport mechanisms, so don't dismiss that), and then find out how to connect this to the CAM layer so that the aic7xxx driver is at the other end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.