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

Notice: Windows XP is officially unsupported, may bitrot unless others wish to submit patches to maintain unofficial support #403

Closed
joncampbell123 opened this issue Dec 23, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@joncampbell123
Copy link
Owner

commented Dec 23, 2017

Until further notice, released binaries will no longer support Windows XP because there's nothing for DOSBox-X to mount or attach to.

Microsoft broke stat() and that is why nothing mounts in Windows XP.

Why bother emulating if there's no way to mount C: to emulate from?

https://connect.microsoft.com/VisualStudio/feedback/details/1557168/wstat64-returns-1-on-xp-always

Notice this was opened in 2015. It's almost 2018. That's a pretty important function to break in the C runtime!

Anyone with VS2013 or earlier is welcome to take this code and compile for Windows XP as those versions are reported to have a working _stat implementation.

@sikthehedgehog

This comment has been minimized.

Copy link

commented Dec 23, 2017

The POSIX compatibility on Windows is so minimal and broken it's only useful for bare minimum portability and should be avoided if feasible, period. I think it was added only because the US government required POSIX support and they wanted to win that contract back in the NT days.

Also honestly I'd remove Windows XP support permanently, it's long unsupported and such a massive security headache that nobody should be using it unless really needed (and in the latter case you probably shouldn't be running DOSBox-X on that machine anyway). At least that's my opinion.

@joncampbell123

This comment has been minimized.

Copy link
Owner Author

commented Dec 23, 2017

I've decided personally that supporting XP isn't worth it, however I do intend to accept patches that allow the code to run on XP, from others who care if they're willing to invest their time and energy to make it work.

It does mean that binaries I release won't run under XP, but others are free to support and build for XP if they want.

@joncampbell123 joncampbell123 changed the title DOSBox-X builds on Windows XP can't mount anything because Microsoft broke stat/wstat Notice: Windows XP is officially unsupported, may bitrot unless others wish to submit patches to maintain unofficial support Dec 24, 2017

@joncampbell123

This comment has been minimized.

Copy link
Owner Author

commented Dec 24, 2017

As previously stated, supporting Windows XP with VS2017 is infeasible because Microsoft somehow managed to break _stat and _wstat functions in the C runtime on Windows XP (a very crucial function to DOSBox-X's file management).

My official policy is that the releases I provide here will no longer support Windows XP, and that I will personally not test code changes on XP.

Unofficially, a VS2013 project file is provided in the source tree for those who want to make Windows XP builds (provided by another GitHub user here).

Anyone who wants to continue running DOSBox-X on Windows XP is free to submit patches to keep it working. Otherwise, support for Windows XP will bitrot from the code and disappear.

@aybe

This comment has been minimized.

Copy link
Collaborator

commented Jan 5, 2018

There is a way to build with the right toolset under 2017:

  • get VS2013 Community Edition
    • when you log in and if it tells you that you need a subscription, click the blue button on top right of page (free), then try again
  • install it

Now instead of screwing the 2017 solution by changing the platform toolset, use Developer Command Prompt for VS 2017 to target XP but using 2013 toolset:

msbuild /t:rebuild /p:Platform=x86 /p:Configuration=Release /p:PlatformToolset=v120_xp

A little test program:
(inspired from https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions)

#include "stdafx.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>

int main(int argc, char* argv[], char* envp[])
{
    struct _stat buf;
    char* filename = argv[0];
    errno_t err;

    int result = _stat(filename, &buf);
    if (result != 0)
    {
        perror("Failed");
        switch (errno)
        {
        case ENOENT:
            printf("File not found: '%s'\n", filename);
            break;
        case EINVAL:
            printf("Invalid parameter\n");
            break;
        default:
            printf("Unexpected error\n");
        }
    }
    else
    {
        printf("File size: %ld\n", buf.st_size);
        printf("Drive: %c:\n", buf.st_dev + 'A');
    }

    return 0;
}

Show that indeed it works,

(1st test is to assert of the failure with 2017 toolset, 2nd test is with above msbuild command)

2018-01-05 05_47_54-windows xp professional - vmware workstation

I didn't try with DOSBox itself but I see no reason why it wouldn't work :)

Now remains the question of whether the current code base will compile flawlessly with vc120_xp.

@joncampbell123

This comment has been minimized.

Copy link
Owner Author

commented Mar 6, 2018

Good news, I am experimenting with 32-bit MinGW which may enable working builds for Windows XP.

@joncampbell123

This comment has been minimized.

Copy link
Owner Author

commented Mar 25, 2018

Now that I can produce builds with MinGW, it no longer matters that VS2015/VS2017 cannot target Windows XP properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.