Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funny behaviour on SIO CMD $E0 #549

Open
XeAtari opened this issue Jan 29, 2023 · 4 comments
Open

Funny behaviour on SIO CMD $E0 #549

XeAtari opened this issue Jan 29, 2023 · 4 comments

Comments

@XeAtari
Copy link

XeAtari commented Jan 29, 2023

I noticed some funny behaviour when running SIO CMD $E0.

Environment: Atari running SpartaDOS 3.3b
Note: The DOS's built-in highspeed code only processes disk access in highsped but changes to normal speed upon everything else

When I run this command on any host slot but slot 1 (the slot that can be assigned the SD card) things work.
One can see toggling baud rates in the debug monitor.

When I run this command on slot 1 it only works once (every succeeding command times out).

When I run $E0 against any other host slot after it timed out on slot 1 it works for the other host slot.

If then I run it against slot 1 again it works once again.

It does not matter whether slot 1 is assigned the SD card or a server in the internet.

This only seems to happen with command $E0.

Below please find a log snippet:

[11:30:36] CF: 70 e0 00 00 51
[11:30:36] sioFuji::sio_process() called
[11:30:36] ACK!
[11:30:36] Fuji cmd: GET HOST PREFIX 0h
[11:30:36] ->SIO write 256 bytes
[11:30:36] COMPLETE!
[11:30:42]
[11:30:42] CF: 58 e0 70 e0 00
[11:30:42] CHECKSUM_ERROR
[11:30:42] Toggling baudrate from 19200 to 54905
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:42]
[11:30:42] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c
[11:30:43]
[11:30:43] CF: 00 1c 00 00 1c

(Log ends here).

@tschak909
Copy link
Collaborator

This is extremely odd, as the command itself is very simple:

// Retrieve host path prefix
void sioFuji::sio_get_host_prefix()
{
    uint8_t hostSlot = cmdFrame.aux1;
    Debug_printf("Fuji cmd: GET HOST PREFIX %u\n", hostSlot);

    if (!_validate_host_slot(hostSlot))
    {
        sio_error();
        return;
    }
    char prefix[MAX_HOST_PREFIX_LEN];
    _fnHosts[hostSlot].get_prefix(prefix, sizeof(prefix));

    bus_to_computer((uint8_t *)prefix, sizeof(prefix), false);
}

_validate_host_slot is:

bool _validate_host_slot(uint8_t slot, const char *dmsg)
{
    if (slot < MAX_HOSTS)
        return true;

    if (dmsg == NULL)
    {
        Debug_printf("!! Invalid host slot %hu\n", slot);
    }
    else
    {
        Debug_printf("!! Invalid host slot %hu @ %s\n", slot, dmsg);
    }

    return false;
}

and get_prefix is simply:

/* Returns pointer to current hostname and, if provided, fills buffer with that string
*/
const char *fujiHost::get_prefix(char *buffer, size_t buffersize)
{
    if (buffer != NULL)
        strlcpy(buffer, _prefix, buffersize);

    return _prefix;
}

I don't know what could be causing that issue?

-Thom

@XeAtari
Copy link
Author

XeAtari commented Jan 30, 2023 via email

@tschak909
Copy link
Collaborator

@XeAtari The latest change for APE is now in the latest production firmware. I am still trying to figure out what could be causing the odd bug with the $E0 command.
-Thom

@XeAtari
Copy link
Author

XeAtari commented Jan 31, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants