xferx 3.0.2__tar.gz → 3.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. {xferx-3.0.2/xferx.egg-info → xferx-3.2.0}/PKG-INFO +31 -3
  2. {xferx-3.0.2 → xferx-3.2.0}/README.md +30 -2
  3. xferx-3.2.0/tests/test_adss.py +233 -0
  4. xferx-3.2.0/tests/test_cos300.py +143 -0
  5. {xferx-3.0.2 → xferx-3.2.0}/tests/test_decsys.py +4 -4
  6. {xferx-3.0.2 → xferx-3.2.0}/tests/test_dms.py +6 -3
  7. {xferx-3.0.2 → xferx-3.2.0}/tests/test_misc.py +0 -37
  8. {xferx-3.0.2 → xferx-3.2.0}/tests/test_os8.py +9 -7
  9. {xferx-3.0.2 → xferx-3.2.0}/tests/test_rt11.py +43 -1
  10. xferx-3.2.0/xferx/VERSION +1 -0
  11. {xferx-3.0.2 → xferx-3.2.0}/xferx/abstract.py +55 -13
  12. xferx-3.2.0/xferx/apple2/abstract.py +51 -0
  13. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/appledosfs.py +32 -26
  14. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/disk.py +5 -17
  15. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/pascalfs.py +22 -18
  16. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/prodosfs.py +21 -14
  17. {xferx-3.0.2 → xferx-3.2.0}/xferx/cache.py +6 -6
  18. {xferx-3.0.2 → xferx-3.2.0}/xferx/commons.py +79 -26
  19. xferx-3.2.0/xferx/device/abstract.py +38 -0
  20. xferx-3.2.0/xferx/device/block.py +73 -0
  21. xferx-3.2.0/xferx/device/block_12bit.py +265 -0
  22. xferx-3.0.2/xferx/pdp7/block.py → xferx-3.2.0/xferx/device/block_18bit.py +60 -11
  23. {xferx-3.0.2/xferx → xferx-3.2.0/xferx/device}/rx.py +61 -1
  24. {xferx-3.0.2/xferx → xferx-3.2.0/xferx/device}/tape.py +20 -4
  25. xferx-3.2.0/xferx/imd.py +300 -0
  26. {xferx-3.0.2 → xferx-3.2.0}/xferx/native.py +7 -6
  27. {xferx-3.0.2 → xferx-3.2.0}/xferx/nova/dgdosdumpfs.py +15 -3
  28. {xferx-3.0.2 → xferx-3.2.0}/xferx/nova/dgdosfs.py +11 -15
  29. {xferx-3.0.2 → xferx-3.2.0}/xferx/nova/dgdosmagtapefs.py +39 -22
  30. xferx-3.2.0/xferx/pdp11/abstract.py +25 -0
  31. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/caps11fs.py +44 -36
  32. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/dos11fs.py +12 -15
  33. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/dos11magtapefs.py +49 -35
  34. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/files11fs.py +12 -15
  35. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/rstsfs.py +13 -16
  36. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/rt11fs.py +34 -25
  37. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/solofs.py +18 -37
  38. xferx-3.2.0/xferx/pdp15/adssfs.py +1509 -0
  39. xferx-3.2.0/xferx/pdp15/dos15fs.py +932 -0
  40. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp7/decsysfs.py +60 -30
  41. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp7/unix0fs.py +49 -15
  42. xferx-3.2.0/xferx/pdp8/__init__.py +0 -0
  43. xferx-3.2.0/xferx/pdp8/cos300fs.py +353 -0
  44. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp8/dmsfs.py +33 -18
  45. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp8/os8fs.py +168 -74
  46. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp8/tss8fs.py +55 -20
  47. {xferx-3.0.2 → xferx-3.2.0}/xferx/shell.py +2 -3
  48. xferx-3.2.0/xferx/unix/__init__.py +0 -0
  49. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/commons.py +15 -19
  50. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/unix1fs.py +6 -3
  51. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/unix4fs.py +6 -3
  52. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/unix7fs.py +6 -3
  53. {xferx-3.0.2 → xferx-3.2.0}/xferx/volumes.py +26 -2
  54. {xferx-3.0.2 → xferx-3.2.0/xferx.egg-info}/PKG-INFO +31 -3
  55. {xferx-3.0.2 → xferx-3.2.0}/xferx.egg-info/SOURCES.txt +16 -4
  56. xferx-3.0.2/xferx/VERSION +0 -1
  57. xferx-3.0.2/xferx/block.py +0 -169
  58. {xferx-3.0.2 → xferx-3.2.0}/LICENSE +0 -0
  59. {xferx-3.0.2 → xferx-3.2.0}/MANIFEST.in +0 -0
  60. {xferx-3.0.2 → xferx-3.2.0}/pyproject.toml +0 -0
  61. {xferx-3.0.2 → xferx-3.2.0}/setup.cfg +0 -0
  62. {xferx-3.0.2 → xferx-3.2.0}/setup.py +0 -0
  63. {xferx-3.0.2 → xferx-3.2.0}/tests/__init__.py +0 -0
  64. {xferx-3.0.2 → xferx-3.2.0}/tests/test_appledos.py +0 -0
  65. {xferx-3.0.2 → xferx-3.2.0}/tests/test_caps11.py +0 -0
  66. {xferx-3.0.2 → xferx-3.2.0}/tests/test_cmd.py +0 -0
  67. {xferx-3.0.2 → xferx-3.2.0}/tests/test_dos11.py +0 -0
  68. {xferx-3.0.2 → xferx-3.2.0}/tests/test_dos11dectape.py +0 -0
  69. {xferx-3.0.2 → xferx-3.2.0}/tests/test_dos11magtest.py +0 -0
  70. {xferx-3.0.2 → xferx-3.2.0}/tests/test_files11.py +0 -0
  71. {xferx-3.0.2 → xferx-3.2.0}/tests/test_native.py +0 -0
  72. {xferx-3.0.2 → xferx-3.2.0}/tests/test_nova_dgdos.py +0 -0
  73. {xferx-3.0.2 → xferx-3.2.0}/tests/test_nova_dgdosmagtape.py +0 -0
  74. {xferx-3.0.2 → xferx-3.2.0}/tests/test_pascal.py +0 -0
  75. {xferx-3.0.2 → xferx-3.2.0}/tests/test_prodos.py +0 -0
  76. {xferx-3.0.2 → xferx-3.2.0}/tests/test_rsts.py +0 -0
  77. {xferx-3.0.2 → xferx-3.2.0}/tests/test_solo.py +0 -0
  78. {xferx-3.0.2 → xferx-3.2.0}/tests/test_tss8.py +0 -0
  79. {xferx-3.0.2 → xferx-3.2.0}/tests/test_unixv0.py +0 -0
  80. {xferx-3.0.2 → xferx-3.2.0}/tests/test_unixv6.py +0 -0
  81. {xferx-3.0.2 → xferx-3.2.0}/xferx/__init__.py +0 -0
  82. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/__init__.py +0 -0
  83. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/commons.py +0 -0
  84. {xferx-3.0.2 → xferx-3.2.0}/xferx/apple2/ppm.py +0 -0
  85. {xferx-3.0.2/xferx/nova → xferx-3.2.0/xferx/device}/__init__.py +0 -0
  86. {xferx-3.0.2/xferx/pdp11 → xferx-3.2.0/xferx/nova}/__init__.py +0 -0
  87. {xferx-3.0.2/xferx/pdp7 → xferx-3.2.0/xferx/pdp11}/__init__.py +0 -0
  88. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp11/rad50.py +0 -0
  89. {xferx-3.0.2/xferx/pdp8 → xferx-3.2.0/xferx/pdp15}/__init__.py +0 -0
  90. {xferx-3.0.2/xferx/unix → xferx-3.2.0/xferx/pdp7}/__init__.py +0 -0
  91. {xferx-3.0.2 → xferx-3.2.0}/xferx/pdp7/codes.py +0 -0
  92. {xferx-3.0.2 → xferx-3.2.0}/xferx/uic.py +0 -0
  93. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/unix5fs.py +0 -0
  94. {xferx-3.0.2 → xferx-3.2.0}/xferx/unix/unix6fs.py +0 -0
  95. {xferx-3.0.2 → xferx-3.2.0}/xferx.egg-info/dependency_links.txt +0 -0
  96. {xferx-3.0.2 → xferx-3.2.0}/xferx.egg-info/entry_points.txt +0 -0
  97. {xferx-3.0.2 → xferx-3.2.0}/xferx.egg-info/requires.txt +0 -0
  98. {xferx-3.0.2 → xferx-3.2.0}/xferx.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xferx
3
- Version: 3.0.2
3
+ Version: 3.2.0
4
4
  Summary: XFERX is an utility for transferring files between various file systems.
5
5
  Home-page: https://github.com/andreax79/xferx
6
6
  Author: Andrea Bonomi
@@ -36,6 +36,8 @@ XFERX is an utility for transferring files between various file systems.
36
36
  | SOLO | Yes | Yes | Yes | Yes | N/A |
37
37
  | PDP-7 UNIX v0 | Yes | No | No | No | No |
38
38
  | PDP-7 DECSys | Yes | Yes | Yes | No | No |
39
+ | PDP-9/15 ADSS | Yes | Yes | Yes | Yes | N/A |
40
+ | PDP-15 DOS-15 | Yes | No | No | No | No |
39
41
  | UNIX v1 | Yes | No | No | No | No |
40
42
  | UNIX v5 | Yes | No | No | No | No |
41
43
  | UNIX v6 | Yes | No | No | No | No |
@@ -45,6 +47,7 @@ XFERX is an utility for transferring files between various file systems.
45
47
  | 4k Disk Monitor | Yes | Yes | Yes | Yes | N/A |
46
48
  | CAPS-8 | Yes | Yes | Yes | Yes | N/A |
47
49
  | TSS/8 | Yes | Yes | Yes | Yes | Yes |
50
+ | COS-300/COS-310 | Yes | Yes | Yes | Yes | N/A |
48
51
  | Apple II ProDOS | Yes | Yes | Yes | Yes | Yes |
49
52
  | Apple II Pascal | Yes | Yes | Yes | Yes | N/A |
50
53
  | Apple DOS 3.x | Yes | Yes | Yes | Yes | N/A |
@@ -227,11 +230,31 @@ PDP-7 DECSys
227
230
  * [DECSys-7 Operating Manual](http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp7/DEC-07-SDDA-D_DECSYS7_Nov66.pdf)
228
231
  * [Technical Notes on DECsys](https://simh.trailing-edge.com/docs/decsys.pdf)
229
232
 
233
+ PDP-9/PDP-15 Advanced Software System
234
+ -------------------------------------
235
+
236
+ * [PDP-9 Advanced Software System Monitors](https://bitsavers.org/pdf/dec/pdp9/DEC-9A-MAD0-D.pdf)
237
+ * [PDP-9 Advanced System Software Keyboard Monitor Guide](https://bitsavers.org/pdf/dec/pdp9/DEC-9A-NGBA-D.pdf)
238
+ * [PDP-15 Advanced Monitor Software System for PDP-1S/20/30/40 Programmer's Reference Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-MR2B-D_AdvMonPgmRef.pdf)
239
+
240
+ PDP-15 DOS-15
241
+ -------------
242
+
243
+ * [DOS-15 Users Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-ODUMA-A_DOS-15_Users_Manual_197212.pdf)
244
+ * [DOS-15 System Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-ODFFA-A_DOS15_SysMan.pdf)
245
+ * [PDP-15 Utility Programs](https://bitsavers.org/pdf/dec/pdp15/DEC-15-YWZA-D_PDP-15_Utility_Programs_196910.pdf)
246
+
230
247
  PDP-8 OS/8
231
248
  ----------
232
249
 
233
250
  * [OS/8 Software Support Manual](https://www.bitsavers.org/pdf/dec/pdp8/os8/DEC-S8-OSSMB-A-D_OS8_v3ssup.pdf)
234
251
 
252
+ PDP-8 PS/8
253
+ ----------
254
+
255
+ * [PS/8 8K Programming System User's Guide](https://bitsavers.org/pdf/dec/pdp8/software/DEC-08-MEFA-D_8k_Programming_System_Users_Guide.pdf)
256
+ * [PS/8 Software Support Manual](https://bitsavers.org/pdf/dec/pdp8/ps8/DEC-08-MEXB-D_PS8_SWSupMan.pdf])
257
+
235
258
  PDP-8 4k Disk Monitor
236
259
  ---------------------
237
260
 
@@ -239,12 +262,17 @@ PDP-8 4k Disk Monitor
239
262
  * [PDP-8 Disc System Builder](https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/dec-d8-sba/dec-d8-sbab-d.pdf)
240
263
 
241
264
  PDP-8 TSS/8
242
- -------------
243
-
265
+ -----------
244
266
 
245
267
  * [TSS/8 TIME-SHARING SYSTEM USER'S GUIDE](https://bitsavers.org/pdf/dec/pdp8/tss8/DEC-T8-MRFB-D_UserGde_Feb70.pdf)
246
268
  * [System Manager's Guide for PDP-8E TSS 8.24 Monitor](https://bitsavers.org/pdf/dec/pdp8/tss8/TSS8_8.24_ManagersGuide.pdf)
247
269
 
270
+ PDP-8 Commercial Operating System COS 300/310
271
+ ---------------------------------------------
272
+
273
+ * [COS 300 System Reference Manual, 1973](https://bitsavers.org/pdf/dec/pdp8/cos-300/DEC-08-OCOSA-E-D_COS_300_System_Reference_Manual_197303.pdf)
274
+ * [COS 300/310 System Reference Manual, 1975](https://bitsavers.org/pdf/dec/pdp8/cos-300/DEC-08-OCOSA-F_D_COS_300_310_System_Reference_Manual_Jul75.pdf)
275
+ * [COS 310 New user's Guide, 1978](https://www.pdp8online.com/pdp8cgi/query_docs/tifftopdf.pl/pdp8docs/aa-d758a-ta.pdf)
248
276
 
249
277
  Apple II ProDOS / Apple III SOS (Sophisticated Operating System)
250
278
  ----------------------------------------------------------------
@@ -15,6 +15,8 @@ XFERX is an utility for transferring files between various file systems.
15
15
  | SOLO | Yes | Yes | Yes | Yes | N/A |
16
16
  | PDP-7 UNIX v0 | Yes | No | No | No | No |
17
17
  | PDP-7 DECSys | Yes | Yes | Yes | No | No |
18
+ | PDP-9/15 ADSS | Yes | Yes | Yes | Yes | N/A |
19
+ | PDP-15 DOS-15 | Yes | No | No | No | No |
18
20
  | UNIX v1 | Yes | No | No | No | No |
19
21
  | UNIX v5 | Yes | No | No | No | No |
20
22
  | UNIX v6 | Yes | No | No | No | No |
@@ -24,6 +26,7 @@ XFERX is an utility for transferring files between various file systems.
24
26
  | 4k Disk Monitor | Yes | Yes | Yes | Yes | N/A |
25
27
  | CAPS-8 | Yes | Yes | Yes | Yes | N/A |
26
28
  | TSS/8 | Yes | Yes | Yes | Yes | Yes |
29
+ | COS-300/COS-310 | Yes | Yes | Yes | Yes | N/A |
27
30
  | Apple II ProDOS | Yes | Yes | Yes | Yes | Yes |
28
31
  | Apple II Pascal | Yes | Yes | Yes | Yes | N/A |
29
32
  | Apple DOS 3.x | Yes | Yes | Yes | Yes | N/A |
@@ -206,11 +209,31 @@ PDP-7 DECSys
206
209
  * [DECSys-7 Operating Manual](http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp7/DEC-07-SDDA-D_DECSYS7_Nov66.pdf)
207
210
  * [Technical Notes on DECsys](https://simh.trailing-edge.com/docs/decsys.pdf)
208
211
 
212
+ PDP-9/PDP-15 Advanced Software System
213
+ -------------------------------------
214
+
215
+ * [PDP-9 Advanced Software System Monitors](https://bitsavers.org/pdf/dec/pdp9/DEC-9A-MAD0-D.pdf)
216
+ * [PDP-9 Advanced System Software Keyboard Monitor Guide](https://bitsavers.org/pdf/dec/pdp9/DEC-9A-NGBA-D.pdf)
217
+ * [PDP-15 Advanced Monitor Software System for PDP-1S/20/30/40 Programmer's Reference Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-MR2B-D_AdvMonPgmRef.pdf)
218
+
219
+ PDP-15 DOS-15
220
+ -------------
221
+
222
+ * [DOS-15 Users Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-ODUMA-A_DOS-15_Users_Manual_197212.pdf)
223
+ * [DOS-15 System Manual](https://bitsavers.org/pdf/dec/pdp15/DEC-15-ODFFA-A_DOS15_SysMan.pdf)
224
+ * [PDP-15 Utility Programs](https://bitsavers.org/pdf/dec/pdp15/DEC-15-YWZA-D_PDP-15_Utility_Programs_196910.pdf)
225
+
209
226
  PDP-8 OS/8
210
227
  ----------
211
228
 
212
229
  * [OS/8 Software Support Manual](https://www.bitsavers.org/pdf/dec/pdp8/os8/DEC-S8-OSSMB-A-D_OS8_v3ssup.pdf)
213
230
 
231
+ PDP-8 PS/8
232
+ ----------
233
+
234
+ * [PS/8 8K Programming System User's Guide](https://bitsavers.org/pdf/dec/pdp8/software/DEC-08-MEFA-D_8k_Programming_System_Users_Guide.pdf)
235
+ * [PS/8 Software Support Manual](https://bitsavers.org/pdf/dec/pdp8/ps8/DEC-08-MEXB-D_PS8_SWSupMan.pdf])
236
+
214
237
  PDP-8 4k Disk Monitor
215
238
  ---------------------
216
239
 
@@ -218,12 +241,17 @@ PDP-8 4k Disk Monitor
218
241
  * [PDP-8 Disc System Builder](https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/dec-d8-sba/dec-d8-sbab-d.pdf)
219
242
 
220
243
  PDP-8 TSS/8
221
- -------------
222
-
244
+ -----------
223
245
 
224
246
  * [TSS/8 TIME-SHARING SYSTEM USER'S GUIDE](https://bitsavers.org/pdf/dec/pdp8/tss8/DEC-T8-MRFB-D_UserGde_Feb70.pdf)
225
247
  * [System Manager's Guide for PDP-8E TSS 8.24 Monitor](https://bitsavers.org/pdf/dec/pdp8/tss8/TSS8_8.24_ManagersGuide.pdf)
226
248
 
249
+ PDP-8 Commercial Operating System COS 300/310
250
+ ---------------------------------------------
251
+
252
+ * [COS 300 System Reference Manual, 1973](https://bitsavers.org/pdf/dec/pdp8/cos-300/DEC-08-OCOSA-E-D_COS_300_System_Reference_Manual_197303.pdf)
253
+ * [COS 300/310 System Reference Manual, 1975](https://bitsavers.org/pdf/dec/pdp8/cos-300/DEC-08-OCOSA-F_D_COS_300_310_System_Reference_Manual_Jul75.pdf)
254
+ * [COS 310 New user's Guide, 1978](https://www.pdp8online.com/pdp8cgi/query_docs/tifftopdf.pl/pdp8docs/aa-d758a-ta.pdf)
227
255
 
228
256
  Apple II ProDOS / Apple III SOS (Sophisticated Operating System)
229
257
  ----------------------------------------------------------------
@@ -0,0 +1,233 @@
1
+ from xferx.commons import ASCII, IMAGE, READ_FILE_FULL
2
+ from xferx.device.block_18bit import (
3
+ from_18bit_words_to_bytes,
4
+ from_bytes_to_18bit_words,
5
+ )
6
+ from xferx.pdp15.adssfs import (
7
+ DIRECTORY_BLOCK,
8
+ WORDS_PER_BLOCK,
9
+ ADSSDirectory,
10
+ ADSSDirectoryEntry,
11
+ ADSSFilesystem,
12
+ ascii_to_five_seven,
13
+ decode_block_format,
14
+ encode_block_format,
15
+ five_seven_to_ascii,
16
+ oct_dump,
17
+ )
18
+ from xferx.shell import Shell
19
+
20
+ DSK = "tests/dsk/adss.dtp"
21
+
22
+ # fmt: off
23
+ DIR = [
24
+ 0o777777, 0o777777, 0o777777, 0o777777, 0o777471, 0o630614, 0o306143, 0o061430,
25
+ 0o614306, 0o143041, 0o020410, 0o204102, 0o041021, 0o430614, 0o306143, 0o061430,
26
+ 0o614306, 0o143061, 0o430614, 0o306143, 0o061430, 0o614306, 0o143061, 0o437777,
27
+ 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777,
28
+ 0o561417, 0o010400, 0o021116, 0o400037, 0o040424, 0o000000, 0o021116, 0o400040,
29
+ 0o053005, 0o032524, 0o021116, 0o400041, 0o111624, 0o050105, 0o021116, 0o400043,
30
+ 0o111624, 0o161716, 0o021116, 0o400050, 0o220514, 0o050105, 0o021116, 0o400076,
31
+ 0o220514, 0o161716, 0o021116, 0o400077, 0o561411, 0o022200, 0o021116, 0o400105,
32
+ 0o061703, 0o011400, 0o021116, 0o400120, 0o000000, 0o000000, 0o000000, 0o000000,
33
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
34
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
35
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
36
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
37
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
38
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
39
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
40
+ 0o777777, 0o777742, 0o104777, 0o777777, 0o000000, 0o000000, 0o000000, 0o000000,
41
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
42
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o007777,
43
+ 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777, 0o777777,
44
+ 0o131571, 0o556165, 0o233123, 0o400000, 0o231320, 0o021413, 0o233123, 0o400042,
45
+ 0o111702, 0o141300, 0o233123, 0o400046, 0o230716, 0o021413, 0o233123, 0o400052,
46
+ 0o233123, 0o100116, 0o233123, 0o400056, 0o233123, 0o021413, 0o233123, 0o400061,
47
+ 0o562331, 0o231404, 0o233123, 0o400062, 0o021124, 0o150120, 0o233123, 0o400071,
48
+ 0o041122, 0o050324, 0o233123, 0o400100, 0o050411, 0o240000, 0o233123, 0o400644,
49
+ 0o201120, 0o000000, 0o233123, 0o400664, 0o150103, 0o221700, 0o233123, 0o400704,
50
+ 0o066400, 0o000000, 0o233123, 0o400742, 0o042403, 0o172031, 0o233123, 0o401001,
51
+ 0o042515, 0o200000, 0o233123, 0o401004, 0o252004, 0o012405, 0o233123, 0o401010,
52
+ 0o230705, 0o160000, 0o233123, 0o401020, 0o031001, 0o111600, 0o233123, 0o401051,
53
+ 0o200124, 0o031000, 0o233123, 0o401071, 0o000000, 0o000000, 0o000000, 0o000000,
54
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
55
+ 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000, 0o000000,
56
+ ]
57
+ # fmt: on
58
+
59
+
60
+ class MockFilesytem(ADSSFilesystem):
61
+
62
+ def __init__(self, t):
63
+ self.t = t
64
+
65
+ def read_words_block(self, block):
66
+ block_number = block if isinstance(block, int) else block.block_number
67
+ if block_number in self.t:
68
+ return self.t[block_number]
69
+ else:
70
+ raise ValueError(f"Invalid block number {block_number}")
71
+
72
+ def write_words_block(self, block, words) -> None:
73
+ block_number = block if isinstance(block, int) else block.block_number
74
+ self.t[block_number] = words
75
+
76
+
77
+ def test_five_seven():
78
+ """
79
+ Test conversion between ASCII and 5-7 encoding
80
+ """
81
+ data = [f"{i:>5} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" for i in range(10)]
82
+ for line in data:
83
+ lineb = line.encode("ascii")
84
+ words = ascii_to_five_seven(lineb)
85
+ tmp = five_seven_to_ascii(words)
86
+ assert lineb == tmp.rstrip(b"\0")
87
+
88
+
89
+ def test_18bit_words():
90
+ words = list(range(0, 2048))
91
+ tmp = from_18bit_words_to_bytes(words, IMAGE)
92
+ w2 = from_bytes_to_18bit_words(tmp, IMAGE)
93
+
94
+ words = list(range(0, 127)) * 26
95
+ tmp = from_18bit_words_to_bytes(words, ASCII)
96
+ w2 = from_bytes_to_18bit_words(tmp, ASCII)
97
+ assert words == w2
98
+
99
+
100
+ def encode_decode(content, mode, l=None):
101
+ blocks_content = list(encode_block_format(content, mode, words_per_block=WORDS_PER_BLOCK - 1))
102
+ if l is not None:
103
+ assert len(blocks_content) == l
104
+ tmp = bytearray()
105
+ for block_content in blocks_content:
106
+ tmp.extend(decode_block_format(block_content))
107
+ assert bytes(tmp) == content
108
+
109
+
110
+ def test_block_format():
111
+ """
112
+ Test encoding and decoding of block format
113
+ """
114
+
115
+ content = b"***Test***\n"
116
+ encode_decode(content, ASCII, 1)
117
+
118
+ content = ("\n".join([f"{i:>5} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" for i in range(50)]) + "\n").encode("ascii")
119
+ encode_decode(content, ASCII, 5)
120
+
121
+ content = b'\xb3\x80\xb8\xb5\xa3\xa3\xa6\x80\x96\xa6\xa9\xa3\xb4\x80\xa7\xa9\xa6\xb7\xa9\xb1\xa4\x8c\x80\x81\x9e\x96\xa9\xb9\x93\xb5\x80\x82\x9b\x80\x81\x90\x8c\x80\x82\x81\x90\x9e\xb6\xa6\xa9\xa4\xb1\x93\x80\xaf\x81\x82\xb8\x80\xb8\xb5\xa3\xa3\xa6\x9b\x80\x96\xa6\xa9\xa3\xb4\xad\x8f\x8f\x8c\x80\x83\x9e\xb5\xa5\xb4\x8f\x8f\x8c\x80\x84\x8d\x80\x81\x8e\x80\x80\x80\x80\x80'
122
+ words = list(range(0, 10))
123
+ content = from_18bit_words_to_bytes(words, IMAGE)
124
+ encode_decode(content, IMAGE, 1)
125
+
126
+ words = list(range(0, 127))
127
+ content = from_18bit_words_to_bytes(words, IMAGE)
128
+ encode_decode(content, IMAGE, 1)
129
+
130
+ words = list(range(0, 1000))
131
+ content = from_18bit_words_to_bytes(words, IMAGE)
132
+ encode_decode(content, IMAGE, 5)
133
+
134
+
135
+ def test_directory():
136
+ fs = MockFilesytem(
137
+ {
138
+ DIRECTORY_BLOCK: list(DIR),
139
+ }
140
+ )
141
+ d = ADSSDirectory.read(fs)
142
+
143
+ words = [0o777777, 0o777777, 0o777777, 0o777777]
144
+ e1 = ADSSDirectoryEntry.read(d, words, 0, 0)
145
+ oct_dump(words)
146
+ oct_dump(e1.to_words())
147
+ assert e1.to_words() == words
148
+
149
+ d.write()
150
+ print("-----")
151
+ oct_dump(DIR)
152
+ print("-----")
153
+ oct_dump(fs.read_words_block(DIRECTORY_BLOCK))
154
+ assert fs.read_words_block(DIRECTORY_BLOCK) == list(DIR)
155
+
156
+
157
+ def test_adss():
158
+ shell = Shell(verbose=True)
159
+ shell.onecmd(f"mount adss1: /adss {DSK}", batch=True)
160
+ fs = shell.volumes.get('ADSS1')
161
+ assert isinstance(fs, ADSSFilesystem)
162
+
163
+ shell.onecmd("dir adss1:", batch=True)
164
+ shell.onecmd("type adss1:f1;src", batch=True)
165
+
166
+ x = fs.read_bytes("b100;bin")
167
+ assert len(x) == 300
168
+ assert from_bytes_to_18bit_words(x, IMAGE) == list(range(0, 100))
169
+
170
+ x = fs.read_bytes("f100;src")
171
+ assert len(x) == 4400
172
+ for i in range(0, 100):
173
+ assert f"{i:5d} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".encode("ascii") in x
174
+
175
+ l = list(fs.filter_entries_list("*;SRC"))
176
+ assert len(l) == 3
177
+
178
+
179
+ def test_adss_init():
180
+ shell = Shell(verbose=True)
181
+ shell.onecmd(f"mount adss1: /adss {DSK}", batch=True)
182
+ shell.onecmd(f"create /allocate:1152 {DSK}.mo", batch=True)
183
+ shell.onecmd(f"init /adss {DSK}.mo", batch=True)
184
+ shell.onecmd(f"mount adss2: /adss {DSK}.mo", batch=True)
185
+ shell.onecmd("dir adss2:", batch=True)
186
+ shell.onecmd("copy adss1:*;SRC adss2:", batch=True)
187
+ fs = shell.volumes.get('ADSS2')
188
+
189
+ l = list(fs.filter_entries_list("*;SRC"))
190
+ assert len(l) == 3
191
+
192
+ shell.onecmd("delete adss2:F1;SRC", batch=True)
193
+ l = list(fs.filter_entries_list("*;SRC"))
194
+ assert len(l) == 2
195
+
196
+
197
+ def test_adss_write_file():
198
+ shell = Shell(verbose=True)
199
+ shell.onecmd(f"copy {DSK} {DSK}_2.mo", batch=True)
200
+ shell.onecmd(f"mount adss2: /adss {DSK}_2.mo", batch=True)
201
+ fs = shell.volumes.get('ADSS2')
202
+ assert isinstance(fs, ADSSFilesystem)
203
+
204
+ for l in (1, 10, 100, 1000):
205
+ words = list(range(0, l))
206
+ data = from_18bit_words_to_bytes(words, IMAGE)
207
+ filename = f"T{l};BIN"
208
+ fs.write_bytes(filename, data)
209
+ data_read = fs.read_bytes(filename)
210
+ assert data_read == data
211
+
212
+ for l in (1, 10, 100, 1000):
213
+ filename = f"T{l};BIN"
214
+ data = fs.read_bytes(filename)
215
+ words = from_bytes_to_18bit_words(data, IMAGE)
216
+ assert words == list(range(0, l))
217
+
218
+ for l in (1, 10, 100, 1000):
219
+ tmp = bytearray()
220
+ for i in range(0, l):
221
+ tmp.extend(f"{i:5d} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890\n".encode("ascii"))
222
+ data = bytes(tmp)
223
+ filename = f"T{l};SRC"
224
+ fs.write_bytes(filename, data)
225
+ data_read = fs.read_bytes(filename)
226
+ assert data_read == data
227
+
228
+ shell.onecmd("create /allocate:400 adss2:big;bin", batch=True)
229
+ big = fs.get_file_entry("BIG;BIN")
230
+ assert len(list(big.get_blocks())) == 400
231
+
232
+ shell.onecmd("dismount adss2:", batch=True)
233
+ shell.onecmd(f"del {DSK}_2.mo", batch=True)
@@ -0,0 +1,143 @@
1
+ import pytest
2
+
3
+ from xferx.pdp8.cos300fs import (
4
+ COS300DirectoryEntry,
5
+ COS300Filesystem,
6
+ OS8Segment,
7
+ ascii_to_cos_codes,
8
+ cos_codes_to_ascii,
9
+ from_12bit_words_to_bytes,
10
+ from_bytes_to_12bit_words,
11
+ )
12
+ from xferx.shell import Shell
13
+
14
+ # fmt: off
15
+ WORDS = [4091, 100, 3381, 2227, 3408, 3392, 4091, 110, 3955, 2468,
16
+ 3123, 2368, 4090, 120, 3965, 2352, 3503, 3405, 2195, 4088,
17
+ 130, 3965, 3062, 2979, 2483, 869, 1229, 3136, 4090, 140,
18
+ 3965, 2189, 2387, 849, 1088, 4093, 150, 3187, 3108, 4087,
19
+ 160, 3941, 2740, 3181, 2234, 594, 850, 850, 640, 4085,
20
+ 170, 2928, 3121, 893, 2410, 3377, 2914, 3721, 2189, 2189,
21
+ 1098, 4091, 180, 3940, 3126, 3061, 1954, 4085, 190, 3941,
22
+ 2740, 3181, 2234, 610, 866, 868, 3126, 3061, 640, 4091,
23
+ 200, 3946, 3044, 3265, 2176, 4082, 210, 3946, 2505, 2191,
24
+ 2918, 1007, 3502, 2278, 3274, 2608, 117, 3073, 2928, 3121,
25
+ 4093, 220, 2479, 2368, 0, 2368, 0, 2368, 0, 220, 2479,
26
+ 2368, 0, 220, 2479, 2368, 0, 3121, 4093, 210, 2479,
27
+ 2368, 0, 3265, 3433, 2432, 4056, 130, 1793, 3381, 3493,
28
+ 2479, 3393, 2544, 3265, 3433, 2229, 120, 2470, 2831, 65,
29
+ 3433, 2740, 106, 3329, 3508, 2469, 117, 3073, 3187, 2735,
30
+ 3393, 3433, 2433, 2922, 3381, 112, 2497, 3433, 2433, 3430,
31
+ 3009, 3302, 2228, 3119, 3329, 2176, 4058, 140, 1793, 3381,
32
+ 3493, 2479, 3393, 3618, 3329, 3381, 3503, 2561, 2223, 2369,
33
+ 3433, 2433, 2212, 3446, 2221, 111, 3502, 2278, 3265, 3433,
34
+ 2229, 117, 2662, 116, 3446, 2406, 3061, 120, 2228, 111,
35
+ 3125, 102, 3684, 3508, 2469, 4056, 150, 1793, 2547, 3118,
36
+ 99, 3713, 3433, 2662, 101, 2466, 3021, 2530, 2358, 2933,
37
+ 3725, 112, 3265, 3370, 3701, 2638, 2544, 3310, 2483, 961,
38
+ 117, 2662, 103, 2739, 3381, 103, 2743, 2433, 2227, 2433,
39
+ 2689, 2550, 2925, 105, 3126, 3316, 4069, 160, 1793, 3373,
40
+ 2737, 103, 3123, 2945, 3433]
41
+ WORDS1 = [4093, 210, 2479, 2368, 0, 3265, 3433, 2432, 4056, 130]
42
+ # fmt: on
43
+
44
+ DSK = "tests/dsk/cos300.tu56"
45
+ DSK1 = "tests/dsk/cos300.dsk"
46
+
47
+
48
+ def test_from_12bit_words_to_bytes():
49
+ byte_data = from_12bit_words_to_bytes(WORDS)
50
+ words = from_bytes_to_12bit_words(byte_data)
51
+ assert WORDS == words
52
+
53
+
54
+ def test_cos_codes_to_ascii1():
55
+ text = cos_codes_to_ascii(WORDS1).decode("ascii")
56
+ words = ascii_to_cos_codes(text.encode("ascii"))
57
+ assert words == WORDS1[: len(words)]
58
+
59
+
60
+ def test_cos_codes_to_ascii():
61
+ text = cos_codes_to_ascii(WORDS).decode("ascii")
62
+ assert text.startswith("0100")
63
+ assert "DISPLAY(1,1,1)" in text
64
+ assert text.endswith("END\n")
65
+ words = ascii_to_cos_codes(text.encode("ascii"))
66
+ assert words == WORDS[: len(words)]
67
+
68
+
69
+ def test_write_directory_entry():
70
+ words = [0, 0]
71
+ segment = OS8Segment(None)
72
+ segment.extra_words = 1
73
+
74
+ e = COS300DirectoryEntry.read(segment, words, 0, 0)
75
+ segment.entries_list.append(e)
76
+ assert segment.number_of_entries == 1
77
+ assert e.is_empty
78
+ words1 = e.to_words()
79
+ assert words == words1
80
+
81
+ assert len(words1) == 2
82
+ e.empty_entry = False
83
+ e.filename = "TEST"
84
+ e.extension = "TX"
85
+ e.length = 123
86
+ e.extra_words = [342]
87
+ assert not e.is_empty
88
+ words2 = e.to_words()
89
+ assert len(words2) == 6
90
+
91
+ e2 = COS300DirectoryEntry.read(segment, words2, 0, 0)
92
+ assert not e2.is_empty
93
+ assert e2.to_words() == words2
94
+
95
+
96
+ def test_cos300():
97
+ shell = Shell(verbose=True)
98
+ shell.onecmd(f"mount t: /cos300 {DSK}", batch=True)
99
+ fs = shell.volumes.get('T')
100
+ assert isinstance(fs, COS300Filesystem)
101
+ assert fs.dev.is_rx
102
+
103
+ shell.onecmd("dir t:", batch=True)
104
+ shell.onecmd("type t:a50.a", batch=True)
105
+
106
+ x = fs.read_bytes("A50.A")
107
+ x = x.rstrip(b"\0")
108
+ assert len(x) == 2200
109
+ for i in range(0, 50):
110
+ assert f"{i:5d} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".encode("ascii") in x
111
+
112
+ l = list(fs.filter_entries_list("*.A"))
113
+ assert len(l) == 9
114
+
115
+ text = fs.read_bytes("DIBOL.S").decode("ascii")
116
+ assert "CIAO" in text
117
+
118
+
119
+ def test_cos300_init():
120
+ shell = Shell(verbose=True)
121
+ shell.onecmd(f"mount t: /cos300 {DSK}", batch=True)
122
+ shell.onecmd(f"create /allocate:280 {DSK1}.mo", batch=True)
123
+ shell.onecmd(f"init /cos300 {DSK1}.mo", batch=True)
124
+ shell.onecmd(f"mount ou: /cos310 {DSK1}.mo", batch=True)
125
+ shell.onecmd("dir ou:", batch=True)
126
+ shell.onecmd("copy t:*.A ou:", batch=True)
127
+ fs = shell.volumes.get('OU')
128
+
129
+ x1 = fs.read_bytes("A50.A")
130
+ x1 = x1.rstrip(b"\0")
131
+ assert len(x1) == 2200
132
+ for i in range(0, 50):
133
+ assert f"{i:5d} ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".encode("ascii") in x1
134
+ l = list(fs.filter_entries_list("*.A"))
135
+ assert len(l) == 9
136
+ fs.get_file_entry("A10.A").delete()
137
+ l = list(fs.filter_entries_list("*.A"))
138
+ assert len(l) == 8
139
+
140
+ # Test init mounted volume
141
+ shell.onecmd("init ou:", batch=True)
142
+ with pytest.raises(Exception):
143
+ print(fs.read_bytes("A50.A"))
@@ -20,13 +20,13 @@ class MockFilesytem(DECSysFilesystem):
20
20
  def __init__(self, t):
21
21
  self.t = t
22
22
 
23
- def read_18bit_words_block(self, block_number):
23
+ def read_words_block(self, block_number):
24
24
  if block_number in self.t:
25
25
  return list(self.t[block_number])
26
26
  else:
27
27
  raise ValueError(f"Invalid block number {block_number}")
28
28
 
29
- def write_18bit_words_block(self, block_number, words) -> None:
29
+ def write_words_block(self, block_number, words) -> None:
30
30
  self.t[block_number] = list(words)
31
31
 
32
32
 
@@ -93,9 +93,9 @@ def test_program_directory():
93
93
  directory = ProgramDirectory.read(fs)
94
94
  assert len(directory.entries) == 14
95
95
  assert directory.first_free_block == 157
96
- fs.write_18bit_words_block(2, [0] * 256)
96
+ fs.write_words_block(2, [0] * 256)
97
97
  directory.write()
98
- assert fs.read_18bit_words_block(2) == program_directory
98
+ assert fs.read_words_block(2) == program_directory
99
99
 
100
100
 
101
101
  def test_fiodec():
@@ -347,9 +347,9 @@ def test_dms():
347
347
 
348
348
  def test_dms_write_file():
349
349
  shell = Shell(verbose=True)
350
- shell.onecmd(f"copy {DSK} {DSK}.mo", batch=True)
351
- shell.onecmd(f"mount t: /dms {DSK}.mo", batch=True)
352
- fs = shell.volumes.get('T')
350
+ shell.onecmd(f"copy {DSK} {DSK}_2.mo", batch=True)
351
+ shell.onecmd(f"mount dms2: /dms {DSK}_2.mo", batch=True)
352
+ fs = shell.volumes.get('DMS2')
353
353
  assert isinstance(fs, DMSFilesystem)
354
354
 
355
355
  block_size = 256
@@ -393,3 +393,6 @@ def test_dms_write_file():
393
393
  block_data = f.read_block(i * 2, number_of_blocks=2)
394
394
  assert block_data == chr(i + 65).encode("ascii") * block_size * 2
395
395
  f.close()
396
+
397
+ shell.onecmd("dismount dms2:", batch=True)
398
+ shell.onecmd(f"del {DSK}_2.mo", batch=True)
@@ -1,11 +1,9 @@
1
1
  import shlex
2
- from datetime import date
3
2
 
4
3
  import pytest
5
4
 
6
5
  from xferx.commons import PartialMatching, bytes_to_word, word_to_bytes
7
6
  from xferx.pdp11.rad50 import asc2rad, rad2asc
8
- from xferx.pdp11.rt11fs import date_to_rt11, rt11_canonical_filename, rt11_to_date
9
7
  from xferx.shell import extract_options
10
8
 
11
9
 
@@ -56,41 +54,6 @@ def test_asc2rad():
56
54
  assert asc2rad(":$%") == b"\x54\xfe"
57
55
 
58
56
 
59
- def test_rt11_to_date():
60
- # Test with None
61
- assert rt11_to_date(0) is None
62
- # Test with valid input
63
- assert date(1979, 1, 6) == rt11_to_date(1223)
64
- assert date(1984, 2, 5) == rt11_to_date(2220)
65
- assert date(1991, 12, 31) == rt11_to_date(13299)
66
- assert date(2000, 1, 1) == rt11_to_date(1084)
67
- assert date(2014, 3, 27) == rt11_to_date(20330)
68
- assert date(2024, 1, 1) == rt11_to_date(17460)
69
-
70
-
71
- def test_date_to_rt11():
72
- # Test with None
73
- assert date_to_rt11(None) == 0
74
- # Test with valid input
75
- assert date_to_rt11(date(1979, 1, 6)) == 1223
76
- assert date_to_rt11(date(1984, 2, 5)) == 2220
77
- assert date_to_rt11(date(1991, 12, 31)) == 13299
78
- assert date_to_rt11(date(2000, 1, 1)) == 1084
79
- assert date_to_rt11(date(2014, 3, 27)) == 20330
80
- assert date_to_rt11(date(2024, 1, 1)) == 17460
81
-
82
-
83
- def test_rt1_canonical_filename():
84
- assert rt11_canonical_filename(None) == "."
85
- assert rt11_canonical_filename("") == "."
86
- assert rt11_canonical_filename("LICENSE") == "LICENS."
87
- assert rt11_canonical_filename("license.") == "LICENS."
88
- assert rt11_canonical_filename("read.me") == "READ.ME"
89
- assert rt11_canonical_filename("read.*", wildcard=True) == "READ.*"
90
- assert rt11_canonical_filename("r*", wildcard=True) == "R*.*"
91
- assert rt11_canonical_filename("*.*", wildcard=True) == "*.*"
92
-
93
-
94
57
  def test_partial_matching():
95
58
  x = PartialMatching()
96
59
  x.add("APP_LE")
@@ -4,6 +4,13 @@ from datetime import date
4
4
 
5
5
  import pytest
6
6
 
7
+ from xferx.device.rx import (
8
+ RX01_SECTOR_SIZE,
9
+ RX01_SIZE,
10
+ RX02_SECTOR_SIZE,
11
+ rx_extract_12bit_words,
12
+ rx_pack_12bit_words,
13
+ )
7
14
  from xferx.pdp8.os8fs import (
8
15
  OS8_BLOCK_SIZE_BYTES,
9
16
  OS8DirectoryEntry,
@@ -16,13 +23,6 @@ from xferx.pdp8.os8fs import (
16
23
  os8_to_date,
17
24
  rad50_word12_to_asc,
18
25
  )
19
- from xferx.rx import (
20
- RX01_SECTOR_SIZE,
21
- RX01_SIZE,
22
- RX02_SECTOR_SIZE,
23
- rx_extract_12bit_words,
24
- rx_pack_12bit_words,
25
- )
26
26
  from xferx.shell import Shell
27
27
 
28
28
  DSK = "tests/dsk/os8.rx01"
@@ -158,6 +158,8 @@ def test_os8():
158
158
  shell.onecmd(f"mount t: /os8 {DSK}", batch=True)
159
159
  fs = shell.volumes.get('T')
160
160
  assert isinstance(fs, OS8Filesystem)
161
+ print(fs.dev.sector_size)
162
+ assert fs.dev.is_rx
161
163
 
162
164
  shell.onecmd("dir t:", batch=True)
163
165
  shell.onecmd("dir /uic t:", batch=True)