Menu

FDD3000 Emulator CP/M not loading

chapas5400
2019-10-03
2024-09-10
  • chapas5400

    chapas5400 - 2019-10-03

    Hi,
    thanks for you work on this emulator, I've been testing it, it works great with only one disk with TOS.
    When I load the monitor software and the "insert" the CP/M disk nothing happens after the reset as it does on the real machine, is it a known issue?

    Where can I send the files I'm using?

    Regards,
    Chapas

     
    • - 2022-01-14

      Depends on what version of emulator did You try.
      The FUSE-integrated one should work.
      But if Your version of CP/M doesn't work with FUSE, I'll be happy to help You :)

       
  • Joao Encarnado

    Joao Encarnado - 2021-02-27

    Hello and sorry for (very) late reply.
    I've tested with several CP/M monitor versions and not all of them work. Some hang on the emulator but work on the real hardware. I have one that works on the emulator.
    Cheers!
    Johnny Red

     
  • Paulo Rogério Pereira

    Many thanks for providing the FDD3000 emulator.
    I found a bug when using tomato to convert to .tap files. If there is a zero bytes file, there is a segmentation fault:

    Program received signal SIGSEGV, Segmentation fault.
    0x0000555555570216 in command_saveas::save_tap (this=0x55555564a810, name="demo-com-erros.tap") at command_saveas.cpp:200
    200 memcpy(data,image.tos_au(f.au[0]),20);
    (gdb) where
    0 0x0000555555570216 in command_saveas::save_tap (this=0x55555564a810, name="demo-com-erros.tap") at command_saveas.cpp:200
    1 0x0000555555570b17 in command_saveas::exec (this=0x55555564a810, name="demo-com-erros.tap") at command_saveas.cpp:282
    2 0x0000555555570c80 in command_saveas::exec (this=0x55555564a810, params=std::__cxx11::list = {...}) at command_saveas.cpp:291
    3 0x000055555555a125 in command::process (this=0x55555564a810, params=std::__cxx11::list = {...}) at command.cpp:18
    4 0x0000555555573350 in main (argc=5, argv=0x7fffffffe268) at tomato.cpp:119
    (gdb) print f
    $1 = (tos_file &) @0x55555564f540: {parentID = 5, name = "address.rec", au = std::vector of length 0, capacity 0, size = 0, hidden = 0, readonly = 0}
    (gdb) print f.au[0]
    Cannot access memory at address 0x0

    It can be corrected by adding just before command_saveas.cpp:200 the following line:
    if (f.size==0) continue;
    Note that in TOS it is easy to create a zero bytes file. If you run the command DIM *"test", you will get a zero bytes file named "test"

    I converted all my FDD3000 diskettes to a raw 160KB files.
    For using tomato to convert them to .dsk files, I had to patch command_open.cpp:67 to just check the buf[0x005] != 'P', as the other 3 bytes tested in that "if" are different from those in my diskettes resulting in raw disk file not being recognized by tomato.
    However, the resulting .dsk files do not work in the FDD3000 emulator.
    I had to replace the TOS tracks with the TOS tracks from the tos2_160k.dsk you provided for the .dsk files to work in the emulator.
    This is probably because my TOS version is different from yours.

    Finally, I have a question:
    Is it possible to use CP/M in the FDD3000 emulator as I used in my FDD3000?
    How can I convert my CP/M 2.2 raw 160KB diskette images to .dsk files for them to work in the emulator? Since they are not TOS, it looks like TOMATO does not work.
    If you need, I can send you the images of the CP/M 2.2 diskette that run in FDD3000 and the terminal emulator diskette that run in ZX Spectrum/TOS.

     

    Last edit: Paulo Rogério Pereira 2024-08-02
    • Joao Encarnado

      Joao Encarnado - 2024-08-02

      You can use CP/M on the emulator, but always limited to the 64 column mode of the Terminal Monitor Emulator Program. You can't use Terminal 3000 as it is not emulated. Not all versions of Terminal Monitor Emulator works with the emulator (tested 4 or 5 different versions). You can get a Terminal Monitor Emulator disk image (DSK) and a CP/M boot disk (DSK) from here:

      https://loadzx.com/tcw-archive/?ee=1&eeFolder=TIMEX-COMPUTER-WORLD%2FSOFTWARE%2FTimex-FDD-Disks&eeListID=1

      Those images were made by me and tested on the emulator and original hardware.
      How to use your images, not sure because I don't know how you made them from the original disks. TOS can read the table of contents of a CP/M disk but cannot use any files.
      To use CP/M you must do the same as on original hardware: Boot Monitor emulator, insert CP/M disk on drive A, reset the FDD3000 and CP/M should "boot".

      TOMATO also has issues with hidden files.
      Not sure about the version of TOS on your disks, I've tested TOS A.1 and it boots on the emulator but anything more than that, "crashes" the emulation (2048/zx reboots).

      Encarnado (Johnny Red)
      LOAD ZX Museum Team

       
  • Paulo Rogério Pereira

    João, thanks for your answer.
    I transferred my diskettes by modifying the Timex diskette Backup application to just read the diskette tracks to memory and then sending all the data through the FDD3000 serial port to a PC. For CP/M, I had to use drive B, as the application does not work if there is no TOS disk on drive A.
    So I have exact 160 KB images of all my diskettes I could read (a few did have some read errors after almost 40 years).
    I have TOS A.2, so that is the reason I have to replace the TOS tracks for them to work in the Emulator.
    Is there any application to convert a 160KB image of the CP/M 2.2 diskettes I have to .dsk format for use in the Emulator?
    Thanks for the link, but all the files I tryed from that link return a 404 error.

     
    • Joao Encarnado

      Joao Encarnado - 2024-08-03

      Hm...
      Someone must have changed the permissions... I have added a ZIP file of both disks and you can download those.
      I read 3" disks on windows with a interface. Also clean the disks to try to remove errors (and I have became very successful). It does not matter the logical format of the disk as it reads the disk flux and then I convert to DSK.
      The emulator have no problems with TOS A.2 so it's kind of strange. have you compared the system tracks from the disks you read? Maybe they have read errors on those tracks?
      CP/M disk geometry is the same as TOS, 16 sectors, 40 tracks but directory catalog track is on track 2 (TOS is on track 4) with tracks 0 and 1 reserved for CP/M.
      Since you did a program, maybe you can make one that works for you to create DSK files as DSK files are a dump with track and sector information. Each track on those 3" disk is 4K. So There is the track/sector information, 4K of data, another track/sector info, 4K data and so on.
      Also have you eard of Planeta Sinclair trying to catalog all Portuguese software for Timex/ZX Spectrum made by Portuguese? The museum and Planeta Sinclair published a book about Portuguese programmers. Do you know it? Would you like us to preserve your programs?

      Encarnado
      LOAD ZX Museum Team

       
  • Paulo Rogério Pereira

    João,
    Thanks again! Planeta Sinclair and the Loadzx museum have quite a good software collection, that I did not know before.
    I managed to convert my raw diskette images to DSK files by using some code from TOMATO and your hints, but I had to use sector skew (trackSkew vector) because sectors are not consecutive in the floppy disk as described in the FDD3000 service manual. My TOS A.2 DSK files work ok in the FDD3000 emulator now, and my CP/M 2.2 DSK files also work ok in the FDD3000 emulator.
    However, at the time I was a teenager, so I do not have significant contributions for your museum. I will see if I can contribute something.
    Best regards, Paulo Rogério Pereira

     
    • Joao Encarnado

      Joao Encarnado - 2024-09-04

      You can always show the programs you did to transfer the disks through serial connection
      That is something we could appreciate as Planeta Sinclair is trying to find all Portuguese Software for ZX Spectrum..

      Cheers!
      Encarnado
      LOAD ZX Museum Team

       
  • Paulo Rogério Pereira

    João,
    I modified the Timex diskette Backup utility as follows. Line 10 with the machine code is kept. All other lines are deleted and replaced by:
    10 REM (machine code not modified)
    200 POKE 24044,201
    210 CLEAR 28500
    300 RANDOMIZE USR 24026
    400 FOR p=0 TO 39 STEP 9
    410 POKE 24213,p
    500 RANDOMIZE USR 23982
    510 LET i=28672: LET f=65535: IF p=36 THEN LET f=i+16383
    520 GO SUB 1000
    530 NEXT p
    600 CLEAR 65356
    700 STOP
    1000 FOR n=i TO f STEP 16
    1020 LET s=0: LET ff=f-n+1: IF ff>16 THEN LET ff=16
    1030 LPRINT ff;" ";n;" ";
    1040 FOR b=n TO n+ff-1
    1050 LPRINT PEEK b;" ";: LET s=s+PEEK b: IF s>255 THEN LET s=s-256
    1060 NEXT b
    1070 LPRINT s: NEXT n
    1080 LPRINT "0 0"
    1090 RETURN

    The explanation is as follows:
    Line 200 puts a RET machine code instruction to return after the Timex machine code reads the diskette tracks into memory.
    Line 300 is to initialize the Timex machine code routine.
    Lines 400-530 just read tracks "p" (for "pista" in Portuguese) from 0 to 39 into memory, a maximum of 9 tracks (36KB) for each cycle.
    Lines 510-520 dumps the memory to the printer by calling the routine in line 1000.
    Lines 1000-1090 dump memory from the "i"nitial address until the "f"inal address to the printer. For each line, first the number of bytes in the line is printed, then the address of the first byte is printed, then a maximum of 16 bytes are printed, and finally a checksum byte (0-255) for that line terminates the line.
    The output ends with "0 0", meaning zero bytes at address zero. This format was adapted from the Intel HEX format, but with decimal numbers, as converting to hexadecimal is too slow.
    Before running this code, one must run the Timex program to setup printing to a serial port.
    Using a 9600 bps serial port it takes almost 3hours to transfer the 160KB of one diskette side. I use PuTTY in a PC to get the data and a program in the PC to write the data bytes received to a raw file.
    For diskettes CP/M diskettes, a TOS diskette has to be placed in drive A, so the CP/M diskette should go to drive B. To modify the drive letters run the commands: POKE 24214,1 : POKE 24215,0. This changes source drive to drive B and destination drive to drive A (it will not write anything in drive A, but the modification is required so that the routine does not ask to change diskettes).
    I would be nice if the FDD3000 emulator also emulated the serial ports, so we could print to a file.

     

Log in to post a comment.

MongoDB Logo MongoDB