Tools for backing up a Project Oberon SD card image

General discussions about using the Astrobe IDE to program the FPGA RISC5 cpu used in Project Oberon 2013
Post Reply
Site Admin
Posts: 467
Joined: Fri Dec 31, 2010 12:30 pm

Tools for backing up a Project Oberon SD card image

Post by cfbsoftware » Tue Apr 13, 2021 10:20 pm

The tool I use to backup Project Oberon SD card images to my PC using Windows 10 is called DD for Windows:

The command I use to read 320 MB (the 256MB DOS partition and the 64MB Project Oberon file system) from the SD card is, for example:

Code: Select all

dd if=\\.\PhysicalDrive6 of=Embedded.img bs=1M count=320 --progress
Where drive 6 is the 'physical drive' number of the SD card on my PC. You can use Windows ‘Disk Management’ tool to find out the actual physical drive number of your SD card drive.

In theory you should just be able to save / restore the Project Oberon section by skipping the first 256 MB. However, the image 'zips' up to about 700KB so it’s hardly worth the hassle of remembering to use a card that already has a 256 MB DOS partition on it.

Unfortunately I haven’t yet been successful using DD to write a saved disk image to the SD card so I use the Win32 Disk Imager software to do that. If anybody has been able to use DD to write to the SD card on their system I’d be interested to know how to do it,

Posts: 84
Joined: Tue Feb 12, 2019 2:59 am
Location: Mauritius

Re: Tools for backing up a Project Oberon SD card image

Post by gray » Wed Apr 14, 2021 12:51 am

I also use Win32 Disk Imager and the 'dd' command line tool. Here's my backup approach.

I use Disk Imager to initially create an SD card to boot Embedded Oberon, using the disk image as downloaded from the Astrobe website, eg. 'Embedded200812.img'. Thereafter, I have an SD card with a 256 MB FAT partition, plus the 64 MB Oberon partition. From this point onwards, I only use 'dd'.

To backup the SD card, I first run

Code: Select all

dd --list
which produces a long listing of all connected storage devices. Luckily, only the bottom part is relevant, for example:

Code: Select all

  link to \\?\Device\Harddisk3\DR11
  Removable media other than floppy. Block size = 512
  size is 7948206080 bytes
  link to \\?\Device\HarddiskVolume25
  Removable media other than floppy. Block size = 512
  size is 267386880 bytes
  link to \\?\Device\HarddiskVolume26
  Removable media other than floppy. Block size = 512
  size is 67108864 bytes
The SD card is 'Disk 3' in the Windows Disk Management tool, so I assume 'Harddisk3' in the above listing refers to the same number. I haven't tested this with different configurations, but it was valid up to now OMM.

The above listing shows all the valid partitions of the 8 GB SD card. 'Partition0' seems to refer to the whole disk (7948206080 bytes), 'Partition1' to the FAT volume (267386880 bytes), and finally 'Partition2' to the Oberon partition (67108864 bytes). The rest of the card shows as 'Unallocated' in the Windows Disk Management tool, and does not appear in the above list.

Now, to actually do the backup, I run

Code: Select all

dd if=\\?\Device\HarddiskVolume26 of=oberonrts-2021-04-15.img bs=1M count=64 --progress
Note that 'HarddiskVolume26' is from the above output listing of drives. This creates a 64 MB backup file on my disk, in the working directory where I ran the 'dd' command.

Whenever I re-insert the SD card, 'HarddiskVolume26' will have changed. With no other USB storage devices having been used in the meantime, it will be 'HarddiskVolume28', ie. plus 2, on the subsequent use of an Oberon SD card. I usually run 'dd --list' again, but in case I forget, the "plus 2 rule" has always worked. And 'dd' will print an error message otherwise, without doing any harm.

I know I am stating the obvious here, but it's important with respect to the ease of use: I don't have to re-type the different commands all the time, I just use the 'cursor up' and 'cursor down' keys to scroll through the command history, and can then edit the command line, eg. to quickly change 'HarddiskVolume26' to 'HarddiskVolume28', or to change the date of the backup file name, or to find the latest the backup or restore commands. Some of the history is preserved between launches of the command shell.

To restore, I run

Code: Select all

dd of=\\?\Device\HarddiskVolume28 if=oberonrts-2021-04-15.img bs=1M count=64 --progress
Note the swapped 'if' and 'of' parameters. Both backing up and restoring just take a few seconds. As a general approach, I work with two SD cards, and whenever I make a backup, I immediately restore it to the other SD card, and use this latter card to continue, so I am sure the backup on the Windows disk is valid. As said, it's very quick with 'dd'. If I work on system files, or on files that are required for my Oberon system to even boot, I back up before uploading a major change that could break the system start or the upload machinery, so I have a quick fallback in case of an issue. I never overwrite an old backup, and I keep backups a few days backwards. Old habits die hard, I guess.

Post Reply