Atari.Org
Click Here
HomeNewsServicesForumsSupport

Talk Atari

Atari.Org Forums


16/32-Bit

8-Bits

Classics

Emulation

Jaguar

Lynx

Classic Consoles Forum 8-Bits Forum 16/32 Forum
Emulation Forum Jaguar Forum Lynx Forum
 
 Subject: 0
Author: 0 (0)
Date:   -0

Hi!
If anyone cares, here's a shellscript to write .ST images to floppy on your PC in Linux... It does quite safe errorchecking - it rereads the written data and compares it with the .ST file...
I commented out 3 lines because my drive doesn't like using track 83 and 84, but if yours does you may uncomment them...
It also supports gzipped ST files.

It is only tested on Debian 2.2, but it should work on any distro with a recent version of fdutils.

Usage: stwrite.sh filename.st (or filename.st.gz)

----------- stwrite.sh ------------
#!/bin/sh

STFILE=$1
STK=$(echo $(zcat -f $STFILE|wc -c)/1024|bc)
CMPRANGE=0-$(echo $(zcat -f $STFILE|wc -c)-1|bc)
DEV=/dev/fd0

case $STK in
720) PRM='DS DD sect=9 cyl=80' ;;
729) PRM='DS DD sect=9 cyl=81' ;;
738) PRM='DS DD sect=9 cyl=82' ;;
# 747) PRM='DS DD sect=9 cyl=83' ;;
800) PRM='DS DD sect=10 cyl=80' ;;
810) PRM='DS DD sect=10 cyl=81' ;;
820) PRM='DS DD sect=10 cyl=82' ;;
# 830) PRM='DS DD sect=10 cyl=83' ;;
# 840) PRM='DS DD sect=10 cyl=84' ;;
*) echo "Unsupported disksize: $STK" ; exit 5 ;;
esac

echo Floppy parameters: $PRM
setfdprm $DEV $PRM

echo Formatting $DEV...
superformat $DEV $PRM -f

echo -n Writing $STFILE to $DEV...
cat $STFILE >$DEV
if [ $? -gt 0 ]; then
echo failed!
echo You may throw this disk in the trashcan...
exit 10
else
echo done.
fi

echo -n Comparing written data with $STFILE...
fdflush $DEV
cmp $STFILE $DEV &>/dev/null
if [ $? -gt 0 ]; then
echo failed!
echo You may throw this disk in the trashcan...
exit 10
else
echo done.
fi
echo $STFILE is successfully written to $DEV.

 Topics Author  Date
  Script to write .ST images in Linux.... new Per Wigren 11-16-2000 08:42 
   RE: Script to write .ST images in Linux.... new Damion Fat Rak Jones 11-21-2000 08:17 

 Reply To This Message
 Your Name:
 Your Email:
 Subject:
 Human verification:   What's this?
               _    __     _ _     
 _ __  ___ _ _| |_ / _|___| (_)___ 
| '_ \/ _ \ '_|  _|  _/ _ \ | / _ \
| .__/\___/_|  \__|_| \___/_|_\___/
|_|                                
    



Copyright © 1997-2024 Atari.Org 
Atari is registered trademark of Infogrames