Kjetil's Information Center: A Blog About My Projects

IBM P70 Hard Disk Imaging

The IBM P70 luggable PS/2 computer is based on the Micro Channel Architecture and uses the rare ESDI hard disk interface. I wanted to make a image of the hard disk, and in order to do this I booted a minimal custom Linux distribution and transferred the image over the network.

I used the 3Com EtherLink/MC network card, also known as 3c523, and needed to patch two bugs in the Linux kernel version 2.4 to make this work properly. The first problem was that the card was detected eight times, as eth0 through eth7, which seemed to be caused by the driver being built-in instead of loaded as a kernel module. The second problem was a NULL-pointer dereference caused by a interrupt occurring before all data had been initialized.

Here is the patch required for the 3c523 driver:

--- 3c523.c.orig	2024-09-16 20:36:35.921558858 +0200
+++ 3c523.c	2024-09-16 20:37:15.001557388 +0200
@@ -415,6 +415,7 @@
 int __init elmc_probe(struct net_device *dev)
 {
 	static int slot;
+	static int found = 0;
 	int base_addr = dev->base_addr;
 	int irq = dev->irq;
 	u_char status = 0;
@@ -428,6 +429,10 @@
 	if (MCA_bus == 0) {
 		return -ENODEV;
 	}
+	/* Prevent being found multiple times if module is built-in. */
+	if (found) {
+		return -ENODEV;
+	}
 	/* search through the slots for the 3c523. */
 	slot = mca_find_adapter(ELMC_MCA_ID, 0);
 	while (slot != -1) {
@@ -585,6 +590,7 @@
         dev->flags&=~IFF_MULTICAST;     /* Multicast doesn't work */
 #endif
 
+	found = 1;
 	return 0;
 err_out:
 	release_region(dev->base_addr, ELMC_IO_EXTENT);
@@ -685,7 +691,7 @@
 	p->scb->cbl_offset = make16(tdr_cmd);
 
 	p->scb->cmd = CUC_START;	/* cmd.-unit start */
-	elmc_attn586();
+	elmc_id_attn586(); /* Interrupt can arrive here, so disable it! */
 
 	s = jiffies;
 	while (!(tdr_cmd->cmd_status & STAT_COMPL)) {
          


I based the Linux distribution on my earlier work but added the necessary PS/2 hardware support for this task. You can download the build scripts, configuration and patches here or pre-built binaries for the kernel and root file system here. The distribution can be easily booted with LOADLIN directly from DOS or by making a floppy disk.

I used Netcat and DD to transfer the image. The receiving Linux host is set up with the following command, which will write all data to a file:

nc -l -p 31337 > diskimage.dd
          


Once the custom Linux distribution has been booted, a command like the following can be used to send the complete /dev/eda ESDI disk over the network:

dd if=/dev/eda bs=512 conv=noerror,sync | nc 192.168.0.111 31337
          


In case you do not have a network card, it is also possible to use SLIP to create a IP network on the serial port, but this is quite slow.

One endpoint is typically setup like this, assuming /dev/ttyS0 is a working serial port:

slattach -s 115200 /dev/ttyS0 &
ifconfig sl0 10.0.0.1 pointopoint 10.0.0.2
          

And the other endpoint with the IP addresses swapped:

slattach -s 115200 /dev/ttyS0 &
ifconfig sl0 10.0.0.2 pointopoint 10.0.0.1
          


Here is a "screenshot" of the nice orange gas plasma screen of the P70 after the finished disk transfer:

IBM P70 gas plasma screen.


Topic: Scripts and Code, by Kjetil @ 04/10-2024, Article Link