Ahoj,
na teto adrese si muzete stahnout FSTOOL ver. 1.0 - http://ordoz.com/sharp/fstool/ver_1.0/fstool.exe
Jedna se o nastroj, ktery umi vytvaret, analyzovat a upravovat DSK. Dale je v nem plna podpora prace s MZ filesystemem. Avast pri pokusu o stazeni souboru hlasi ze je tam infekce DRep., coz znamena, ze se pokousite stahnout doposud neznamy exe z nezname domeny.
Program jsem prubezne testoval jen v Linuxu, ale neocekavam nejake vyznamne rozdily ve Win32 verzi. Zdrojak zatim jeste nikam nedavam, protoze tam chci pridat dalsi filesystemy a udelat par kosmetickych zmen. Pak to dam asi na SF. Kdyby jste si nekdo chtel nakompilovat vlastni, napr. Linux verzi, tak mi napiste a poslu vam aktualni kod.
Pri praci s DSK jsem zjistil, ze mnoho mych FSMZ
disket je ponekud rozmrvenych, coz ma zrejme na svedomi
pouzivani ipldisk vs. BASIC. Vetsinou z nich lze bez potizi cist
i do nich psat, ale nemusi sedet info o obsazenem miste. Prikazy
repairdinfo a defrag mohou mit na takovych disketach
destruktivni ucinky. S takovyma disketama bych asi doporucil
udelat "fstool --fsmz_ipldisk mzgetall ./adresar/", coz ulozi
veskery obsah diskety do jednotlivych MZF - ovsem bez konverze
ftype(!), takze napr. BASIC program bude mit ftype 0x02, misto
0x05.
Alespon pro zacatek, nez si praci s programem osvojite, tak doporucuji vytvorit si kopie DSK - samozrejme jen pro pripad DSK WRITE operaci.
Nejake priklady:
=============
Vyrob FSMZ disk s 80 stopama.
a) jednoduse:
$ fstool new_basic_disk.dsk dskbasic 160 --createdsk
b) slozite:
$ fstool new_basic_disk.dsk dskmake 160 16 256
0xff normal --createdsk
Naformatuj:
$ fstool new_basic_disk.dsk mzfastformat
Specialni low-level rormat:
======================
Vyrob disk typu Lemmings (nepamatuju si presnou lokalizaci a umisteni "tajneho" sektoru - treba 14. stopa a sectorID 0x27 ):
$ fstool --createdsk
new_lemmings.dsk dskcpm 160
$ fstool new_lemmings.dsk dskchange 14 10
512 0x00 "1, 2, 3, 4, 5, 6, 7, 8, 9, 0x27"
Overit (analyzovat disk):
$ fstool new_lemmings.dsk info
DSK and filesystem utility for Sharp MZ-800 disks,
version 1.0
Checking DSK format ... Result: DSK is OK!
Disk total tracks: 160
Disk sides: 2
Track rules:
From 0, count 1, sectors 9, size 512 B
From 1, count 1, sectors 16, size 256 B
From 2, count 12, sectors 9, size 512 B
From 14, count 1, sectors 10, size 512 B
From 15, count 145, sectors 9, size 512 B
Format test result: This disk has only FSMZ
bootstrap track
Prace s boot stopou:
=================
Kazdy disk se kterym je FSTOOL v ramci
FSMZ prikazu ochoten pracovat musi mit alespon
Sharp boot stopu. Vymyslel jsem 3 druhy umisteni
Sharp boot zavadece:
a) MINIBOOT - je maly, umisten v Sharp BOOT stope
- napr. cp/m, nebo MRS
b) MZBOOT - klasicky BASIC, ci ipldisk zavadec, ktery ma v boot stope jen IPLPRO header a samotny program se nachazi ve FSMZ filearea, cimz ubira misto ostatnim souborum
c) MZOVERBOOT - souborovy system FSMZ umi v diskinfo bitmape na standardne rozvrzene diskete popsat pouze 128 stop a zbyvajici cast diskety zustava nevyuzita presto, ze FSMZ si na tyto alokacni bloky umi bez problemu sahnout. Overboot program se tedy ulozi za oblasti filearea a tim padem zustava na disku vice mista pro standardni FSMZ soubory
Prace s bloky:
===========
Prikazy trsec, gettrsec, puttrsec, mzblock, mzgetblock a mzputblock umi podle lowlevel formatu aktualni stopy nastavit auto invert a pripadne konvertovat ASCII podle toho zda se nachazi nad FSMZ stopou, ci nikoliv. Toto chovani lze pomoci options v pripade potreby ovlivnit.
Prikladam kompletni help k programu:
DSK and filesystem utility for Sharp
MZ-800 disks, version 1.0
Usage: fstool [options] <dsk_file>
<command> [<command_params>]
Options:
========
--help: print this help message
--version: print version
--createdsk: create a new double-sided DSK
file
--createonsidedsk: create a new one-sided DSK
file
--overwrite: force overwrite file when new
DSK is created
--ro: forced read-only mode
--fixdsk: auto bugfix DSK (only in R/W mode)
--cnv: force enable Sharp ASCII conversion in
hexdump output
--nocnv: force disable Sharp ASCII conversion
in hexdump output
* output from FSMZ tracks is naturaly
auto ASCII converted
This option disable FSMZ auto ASCII
conversion.
--inv: force enable data inversion for
hexdump and put/get data from sector or block
--noinv: force disable data inversion for
hexdump and put/get data from sector or block
* operations on FSMZ and FSMRS tracks
are data auto inverted
This option disable FSMZ auto
inversion.
--fsmz_ipldisk: switch FSMZ to IPLDISK
extended directory mode
IPLDISK FSMZ directory is alocated in
16. - 31. block.
Normal FSMZ directory is alocated in 16.
- 23. block and
blocks 24. - 31. are filled with zeros.
* Be carefull! Use this option on each
disk that has in
any block from 24. to 31. some non
zero values.
--forcefsmz: forced FSMZ format
Good choice for exotic format discs.
DSK low-level format commands:
==============================
dskmake <total_tracks>
<sectors_per_track> <sector_size>
<filler> [<sector_order> or
<sector_map>]
Use this command for customized DSK low
level format. You can use --createdsk or
--createonesidedsk option and
--overwrite option, if DSK already exist.
All numeric values can be decimal, or
hexadecimal with '0x' prefix.
total_tracks - recomended value is 160
or 80 tracks.
* the maximum number of tracks on
the disc is 204
* total number tracks of the
double-sided disk must always be even
sectors_per_track - value in interval
<1 - 29>
filler - value of the byte to fill a new
sectors <0 - 255>
sector_size - sector size in bytes 128,
256, 512, 1024
sector_order - determines way how to
assign sectors ID. Value may be:
normal - sectors are numbered in
ascending order
lec - interlaced with interval 2
lechd - interlaced with interval 3
sector_map - list of a unique numeric
sector IDs separated by a comma.
dskchange <track>
<sectors_per_track> <sector_size>
<filler> [<sector_order> or
<sector_map>]
Use this command for change any existing
track in DSK file.
The parameters are similar as on the
'dskmake' command.
track - value in interval <0 -
203>
dskappend <count_tracks>
<sectors_per_track> <sector_size>
<filler> [<sector_order> or
<sector_map>]
Add anoter tracks to the end of DSK
file.
The parameters are similar as on the
'dskmake' command.
dskshrink <total_tracks>
Reduce total number of tracks.
Overlapping tracks at the end of DSK
image will be discarded.
dskbasic <total_tracks>
Create new DSK with FSMZ low level
format (16 sectors by 256 B).
total_tracks - recommended value is 80
or 160 (must be divisible by 2)
* this command may be used only with
--createdsk option
dskcpm <total_tracks>
Create new DSK with cp/m low level
format (9 sectors by 512 B) and
with FSMZ boot track.
total_tracks - recommended value is 160
(must be divisible by 2)
* this command may be used only with
--createdsk option
dskcpmhd <total_tracks>
Create new DSK with cp/m low level
format (18 sectors by 512 B) and
with FSMZ boot track.
total_tracks - recommended value is 160
(must be divisible by 2)
* this command may be used only with
--createdsk option
FS general commands:
====================
info
Print info about disc low level and
about logical format.
discmap
Print disc map from the recognizable
area.
trsec <tt> <ss>
Print hex dump of the sector on absolute
track.
tt - abs. track <0 - 203> (decimal
or 0xNN for hex)
ss - sector <1 - 29> (decimal or
0xNN for hex)
gettrsec <file> <tt> <ss>
[size]
Save data from sector into local file.
tt - abs. track <0 - 203> (decimal
or 0xNN for hex)
ss - sector <1 - 29> (decimal or
0xNN for hex)
* default size is the same as sector
size
puttrsec <file> <tt> <ss>
[size] [file_offset]
Load data from local file into sector.
tt - abs. track <0 - 203> (decimal
or 0xNN for hex)
ss - sector <1 - 29> (decimal or
0xNN for hex)
* If size is 0 or is not set, than
default size = file_size - offset.
boot
Print info about IPLPRO bootstrap.
clrboot
Clear IPLPRO block (track:0, sector:1).
* Intended for non FSMZ disks with
MINIBOOT on FSMZ boot track,
or full FSMZ disk with OVERBOOT.
miniboot <mzf>
Load MZF and install into boot track as
MINIBOOT ( max: 0x0f00 bytes ).
* For non FSMZ disks with FSMZ bootstrap
track.
getboot <mzf>
Save boootstrap loader (any type) into
MZF file.
FS-MZ commands:
===============
* you can set/reset FSMZ lock atribute for
individual directory items,
but this attribute is not taken account in FSTOOL
* FSTOOL do not make any conversion of the file
type parameter when is
loading or saving the MZF file.
E.g. the correct filetype for the BASIC program
in the MZF is 0x05,
but in FSMZ is the same file identified as
filetype 0x03.
mzdir
Print all FSMZ dir items with ftype >
0x00 (not deleted).
mzdirtype <nn>
Print all FSMZ dir items with ftype = nn
(decimal or 0xNN for hex).
mzfile <name>
Print FSMZ dir item by name.
* filename in FSMZ is case sensitive!
mzid <id>
Print FSMZ dir item by ID.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
mzren <name> <newname>
Rename FSMZ file by name to newname.
* filename in FSMZ is case sensitive!
mzrenid <id> <newname>
Rename FSMZ file by ID to newname.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
mzera <name>
Erase FSMZ file by name.
* filename in FSMZ is case sensitive!
mzeraid <id>
Erase FSMZ file by ID.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
mzlock <name> <lck_state>
Set or reset FSMZ lock file attribute by
name.
lck_state - <0,1> (0 = unlocked, 1
= locked)
* filename in FSMZ is case sensitive!
mzlockid <id> <lck_state>
Set or reset FSMZ lock file attribute by
ID.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
lck_state - <0,1> (0 = unlocked, 1
= locked)
mzchftype <id> <file_type>
Change FSMZ file type by ID.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
file_type - <0 - 0xff> (decimal or
0xNN for hex)
Known item types in K&P Basic V
1.5A:
0x00 - deleted file (unused file
item)
0x01 - OBJ (machine code)
0x02 - BTX (basic program)
0x03 - BSD (basic sequential data)
0x04 - BRD
0x05 - RB
0x06 - ASC
0x07 - LIB
0x08 - PTX
0x09 - PSD
0x0A - SYS
0x0B - GR
0x0C - LOG
0x0D - PIC
* file type value with 7. bit set as 1
(0x80 and higher) has probably some any
special importance, but I do not know
what the meaning :)
mzrmboot
Remove FSMZ bootstrap loader, update
FSMZ disc map and
clear IPLPRO block
* Intended only for full FSMZ disks
(NORMALBOOT and OVERBOOT)!
mzputboot <mzf>
Load MZF and install into FSMZ bootstrap
as NORMALBOOT.
* This is default boot type for full
FSMZ disks.
mzputoverboot <mzf>
Load MZF and install into FSMZ bootstrap
as OVERBOOT.
* This is experimental bootstrap
location intended only for
full FSMZ disks width more than 128
tracks.
This option saves space in the
standard FSMZ file area.
mzgetfile <name> <mzf>
Save FSMZ file by name into MZF file.
* filename in FSMZ is case sensitive!
mzgetid <id> <mzf>
Save FSMZ file by ID into MZF file.
FSMZ ID = <0; 62> (decimal or 0xNN
for hex)
FSMZ IPLDISK ID = <0; 126>
(decimal or 0xNN for hex)
mzgetall <directory>
Save all files from FSMZ filearea into
local directory.
mzputfile <mzf>
Load MZF file into FSMZ.
mzblock nn
Print hex dump from FSMZ block nn
(decimal or 0xNN for hex).
mzgetblock <file> <block> [size]
Save data from FSMZ block into local
file.
* Default size is 256 bytes (FSMZ block
size).
mzputblock <file> <block> [size]
[file_offset]
Load data from local file into FSMZ
block.
* If size is 0 or is not set, than
default size = file_size - offset.
mzfastformat
Fast FSMZ format.
* rewrite IPLPRO, FSMZ disc map and
directory blocks.
mzrepairdinfo
Repair FSMZ disc map and block usage
info from directory items.
mzdefrag
Defragmentation of FSMZ disc.