diff --git a/doc/disk-40track_drive.md b/doc/disk-40track_drive.md deleted file mode 100644 index 203628f8..00000000 --- a/doc/disk-40track_drive.md +++ /dev/null @@ -1,15 +0,0 @@ -40track_drive -==== -## Adjust configuration for a 40-track drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to read from 40-track, 48tpi 5.25" drives. You have to tell it because there is -no way to detect this automatically. - -For example: - -``` -fluxengine read ibm --180 40track_drive -``` - diff --git a/doc/disk-apple2_drive.md b/doc/disk-apple2_drive.md deleted file mode 100644 index e631d138..00000000 --- a/doc/disk-apple2_drive.md +++ /dev/null @@ -1,16 +0,0 @@ -apple2_drive -==== -## Adjust configuration for a 40-track Apple II drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to adjust the pinout and track spacing to work with an Apple II -drive. This only works on Greaseweazle hardware and requires a custom -connector. - -For example: - -``` -fluxengine read apple2 --160 apple2_drive -``` - diff --git a/doc/disk-shugart_drive.md b/doc/disk-shugart_drive.md deleted file mode 100644 index 086e1d39..00000000 --- a/doc/disk-shugart_drive.md +++ /dev/null @@ -1,15 +0,0 @@ -shugart_drive -==== -## Adjust configuration for a Shugart drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to adjust the pinout to work with a Shugart drive. This only works -on Greaseweazle hardware. - -For example: - -``` -fluxengine read ibm --720 shugart_drive -``` - diff --git a/doc/drives.md b/doc/drives.md index 452b69a5..522c6ce5 100644 --- a/doc/drives.md +++ b/doc/drives.md @@ -36,10 +36,10 @@ Forty track formats on a forty track drive ------------------------------------------ If you actually have a forty track drive, you need to tell FluxEngine. This is -done by adding the special profile `40track_drive`: +done by adding `--drivetype=40`: ``` -fluxengine write ibm --360 40track_drive -i image.img -d drive:0 +fluxengine write -c ibm --360 --drivetype=40 -i image.img -d drive:0 ``` It should then Just Work. This is supported by both FluxEngine and Greaseweazle @@ -47,24 +47,6 @@ hardware. Obviously you can't write an eighty-track format using a forty-track drive! -Apple II drives ---------------- - -The Apple II had special drives which supported microstepping: when commanded -to move the head, then instead of moving in single-track steps as is done in -most other drives, the Apple II drive would move in quarter-track steps. This -allowed much less precise head alignment, as small errors could be corrected in -software. (The Brother word processor drives were similar.) The bus interface -is different from normal PC drives. - -The FluxEngine client supports these with the `apple2_drive` profile: - -``` -fluxengine write apple2 apple2_drive -i image.img -d drive:0 -``` - -This is supported only by Greaseweazle hardware. - Shugart drives -------------- @@ -77,14 +59,32 @@ the drives must be jumpered to configure them. This was mostly used by older 3.5" drives, such as those on the Atari ST. [the How It Works page](technical.md) for the pinout. -The FluxEngine client supports these with the `shugart_drive` profile: +The FluxEngine client supports these with `--bus=shugart`: ``` -fluxengine write atarist720 shugart_drive -i image.img -d drive:0 +fluxengine write -c atarist720 --bus=shugart -i image.img -d drive:0 ``` -(If you have a 40-track Shugart drive, use _both_ `shugart_drive` and -`40track_drive`.) +(If you have a 40-track Shugart drive, use _both_ `--bus=shugart` and +`--drivetype=40`.) + +This is supported only by Greaseweazle hardware. + +Apple II drives +--------------- + +The Apple II had special drives which supported microstepping: when commanded +to move the head, then instead of moving in single-track steps as is done in +most other drives, the Apple II drive would move in quarter-track steps. This +allowed much less precise head alignment, as small errors could be corrected in +software. (The Brother word processor drives were similar.) The bus interface +is different from normal PC drives. + +The FluxEngine client supports these with `--drivetype=160 --bus=appleii`. + +``` +fluxengine write -c apple2 --drivetype=160 --bus=appleii -i image.img -d drive:0 +``` This is supported only by Greaseweazle hardware. diff --git a/doc/using.md b/doc/using.md index 3fd5ee73..b36f3f71 100644 --- a/doc/using.md +++ b/doc/using.md @@ -108,13 +108,13 @@ encoder { } } } -$ fluxengine write ibm --1440 config.textpb -i image.img +$ fluxengine write -c ibm --1440 -c config.textpb -i image.img ``` ...or you can specify them on the command line: ``` -$ fluxengine write ibm --1440 -i image.img --encoder.ibm.trackdata.emit_iam=false +$ fluxengine write -c ibm --1440 -i image.img --encoder.ibm.trackdata.emit_iam=false ``` Both the above invocations are equivalent. The text files use [Google's @@ -128,7 +128,7 @@ files as you wish; they are all merged left to right. You can see all these settings by doing: ``` -$ fluxengine write ibm --1440 --config +$ fluxengine write -c ibm --1440 --show-config ``` The `--config` option will cause the current configuration to be dumped to the @@ -159,27 +159,13 @@ more common tools. disk). `` is a reference to an internal output configuration file describing the format. - - `fluxengine rawread -s -d ` - - Reads flux (possibly from a disk) and writes it to a flux file without doing - any decoding. You can specify a profile if you want to read a subset of the - disk. - - `fluxengine rawwrite -s -d ` Reads flux from a file and writes it (possibly to a disk) without doing any encoding. You can specify a profile if you want to write a subset of the disk. - - `fluxengine merge -s -s -d -c -h -B` + - `fluxengine inspect -s -t -h -B` Reads flux (possibly from a disk) and does various analyses of it to try and detect the clock rate, display raw flux information, examine the underlying @@ -198,14 +184,8 @@ more common tools. There are other tools; try `fluxengine --help`. -**Important note on `rawread` and `rawwrite`:** You can't use these tools to +**Important note on `rawwrite`:** You can't use theis tool to copy disks, in most circumstances. See [the FAQ](faq.md) for more information. -Also, `rawread` is not guaranteed to read correctly. Floppy disks are -fundamentally unreliable, and random bit errors may occur at any time; these -can only be detected by performing a decode and verifying the checksums on the -sectors. To perform a correct read, it's recommended to do `fluxengine read` -with the `--copy-flux-to` option, to perform a decode to a filesystem image -while also writing to a flux file. ### Flux sources and destinations diff --git a/lib/algorithms/readerwriter.cc b/lib/algorithms/readerwriter.cc index 389f464a..51f6acc7 100644 --- a/lib/algorithms/readerwriter.cc +++ b/lib/algorithms/readerwriter.cc @@ -741,38 +741,3 @@ void readDiskCommand( *diskflux->image, globalConfig()->decoder().write_csv_to()); writer.writeImage(*diskflux->image); } - -void rawReadDiskCommand(FluxSource& fluxsource, FluxSink& fluxsink) -{ - log(BeginOperationLogMessage{"Performing raw read of disk"}); - - if (fluxsource.isHardware() || fluxsink.isHardware()) - measureDiskRotation(); - auto physicalLocations = Layout::computePhysicalLocations(); - unsigned index = 0; - for (const auto& physicalLocation : physicalLocations) - { - log(OperationProgressLogMessage{ - index * 100 / (int)physicalLocations.size()}); - index++; - - testForEmergencyStop(); - auto trackInfo = Layout::getLayoutOfTrackPhysical( - physicalLocation.cylinder, physicalLocation.head); - auto fluxSourceIterator = fluxsource.readFlux( - trackInfo->physicalTrack, trackInfo->physicalSide); - - log(BeginReadOperationLogMessage{ - trackInfo->physicalTrack, trackInfo->physicalSide}); - auto fluxmap = fluxSourceIterator->next(); - log(EndReadOperationLogMessage()); - log("{0} ms in {1} bytes", - (int)(fluxmap->duration() / 1e6), - fluxmap->bytes()); - - fluxsink.writeFlux( - trackInfo->physicalTrack, trackInfo->physicalSide, *fluxmap); - } - - log(EndOperationLogMessage{"Raw read complete"}); -} diff --git a/lib/algorithms/readerwriter.h b/lib/algorithms/readerwriter.h index 93f35090..10360d2d 100644 --- a/lib/algorithms/readerwriter.h +++ b/lib/algorithms/readerwriter.h @@ -111,6 +111,5 @@ extern std::shared_ptr readDiskCommand( FluxSource& fluxsource, Decoder& decoder); extern void readDiskCommand( FluxSource& source, Decoder& decoder, ImageWriter& writer); -extern void rawReadDiskCommand(FluxSource& source, FluxSink& sink); #endif diff --git a/src/build.py b/src/build.py index f8b2f583..30a89f17 100644 --- a/src/build.py +++ b/src/build.py @@ -19,11 +19,9 @@ cxxprogram( "./fe-getfileinfo.cc", "./fe-inspect.cc", "./fe-ls.cc", - "./fe-merge.cc", "./fe-mkdir.cc", "./fe-mv.cc", "./fe-putfile.cc", - "./fe-rawread.cc", "./fe-rawwrite.cc", "./fe-read.cc", "./fe-rm.cc", diff --git a/src/fe-merge.cc b/src/fe-merge.cc deleted file mode 100644 index 44e9d9ff..00000000 --- a/src/fe-merge.cc +++ /dev/null @@ -1,64 +0,0 @@ -#include "lib/core/globals.h" -#include "lib/config/flags.h" -#include "lib/data/fluxmap.h" -#include "lib/data/sector.h" -#include "lib/config/proto.h" -#include "lib/data/flux.h" -#include "lib/external/fl2.h" -#include "lib/external/fl2.pb.h" -#include "src/fluxengine.h" -#include - -static FlagGroup flags; - -static std::vector inputFluxFiles; - -static StringFlag sourceFlux({"-s", "--source"}, - "flux file to read from (repeatable)", - "", - [](const auto& value) - { - inputFluxFiles.push_back(value); - }); - -static StringFlag destFlux( - {"-d", "--dest"}, "destination flux file to write to", ""); - -int mainMerge(int argc, const char* argv[]) -{ - flags.parseFlags(argc, argv); - - if (inputFluxFiles.empty()) - error("you must specify at least one input flux file (with -s)"); - if (destFlux.get() == "") - error("you must specify an output flux file (with -d)"); - - std::map, TrackFluxProto> data; - for (const auto& s : inputFluxFiles) - { - fmt::print("Reading {}...\n", s); - FluxFileProto f = loadFl2File(s); - - for (auto& trackflux : f.track()) - { - auto key = std::make_pair(trackflux.track(), trackflux.head()); - auto i = data.find(key); - if (i == data.end()) - data[key] = trackflux; - else - { - for (auto flux : trackflux.flux()) - i->second.add_flux(flux); - } - } - } - - FluxFileProto proto; - for (auto& i : data) - *proto.add_track() = i.second; - - fmt::print("Writing {}...\n", destFlux.get()); - saveFl2File(destFlux.get(), proto); - - return 0; -} diff --git a/src/fe-rawread.cc b/src/fe-rawread.cc deleted file mode 100644 index ac0f933c..00000000 --- a/src/fe-rawread.cc +++ /dev/null @@ -1,52 +0,0 @@ -#include "lib/core/globals.h" -#include "lib/config/config.h" -#include "lib/config/flags.h" -#include "lib/algorithms/readerwriter.h" -#include "lib/data/fluxmap.h" -#include "lib/decoders/decoders.h" -#include "lib/data/sector.h" -#include "lib/config/proto.h" -#include "lib/fluxsink/fluxsink.h" -#include "lib/fluxsource/fluxsource.h" -#include "lib/imagewriter/imagewriter.h" -#include "fluxengine.h" -#include -#include - -static FlagGroup flags; - -static StringFlag sourceFlux({"-s", "--source"}, - "flux file to read from", - "", - [](const auto& value) - { - globalConfig().setFluxSource(value); - }); - -static StringFlag destFlux({"-d", "--dest"}, - "destination flux file to write to", - "", - [](const auto& value) - { - globalConfig().setFluxSink(value); - }); - -int mainRawRead(int argc, const char* argv[]) -{ - globalConfig().overrides()->set_tracks("0-79"); - - if (argc == 1) - showProfiles("rawread", formats); - globalConfig().overrides()->mutable_flux_source()->set_type(FLUXTYPE_DRIVE); - flags.parseFlagsWithConfigFiles(argc, argv, formats); - - if (globalConfig()->flux_sink().type() == FLUXTYPE_DRIVE) - error("you can't use rawread to write to hardware"); - - auto fluxSource = FluxSource::create(globalConfig()); - auto fluxSink = FluxSink::create(globalConfig()); - - rawReadDiskCommand(*fluxSource, *fluxSink); - - return 0; -} diff --git a/src/fluxengine.cc b/src/fluxengine.cc index 4538712d..477b6662 100644 --- a/src/fluxengine.cc +++ b/src/fluxengine.cc @@ -16,11 +16,9 @@ extern command_cb mainGetFile; extern command_cb mainGetFileInfo; extern command_cb mainInspect; extern command_cb mainLs; -extern command_cb mainMerge; extern command_cb mainMkDir; extern command_cb mainMv; extern command_cb mainPutFile; -extern command_cb mainRawRead; extern command_cb mainRawWrite; extern command_cb mainRead; extern command_cb mainRm; @@ -51,10 +49,8 @@ static std::vector commands = { "write", mainWrite, "Writes a sector image to a disk.", }, { "fluxfile", mainFluxfile, "Flux file manipulation operations.", }, { "format", mainFormat, "Format a disk and make a file system on it.", }, - { "rawread", mainRawRead, "Reads raw flux from a disk. Warning: you can't use this to copy disks.", }, { "rawwrite", mainRawWrite, "Writes a flux file to a disk. Warning: you can't use this to copy disks.", }, { "convert", mainConvert, "Converts a flux file from one format to another.", }, - { "merge", mainMerge, "Merge together multiple flux files.", }, { "getdiskinfo", mainGetDiskInfo, "Read volume metadata off a disk (or image).", }, { "ls", mainLs, "Show files on disk (or image).", }, { "mv", mainMv, "Rename a file on a disk (or image).", },