You are not logged in.

#1 2018-02-20 19:57:37

sunny interval
Member
From: Germany
Registered: 2018-02-20
Posts: 4

16-bit applications on Linux

Are these still supported at all (using Wine)?

I recently switched from Windows to Linux. With all the arrangements for using the new system done, I was looking for some merriment and diversion. I read about Wine being able to run old 16-bit applications (which is not possible with a 64 bit Windows OS).

I tried installing an old favourite (Blade Runner, a Win95 adventure game) with no success (fresh win32 prefix). Calling the installer returns

modify_ldt: Function not implemented
modify_ldt: Function not implemented
002e:err:winediag:build_module Failed to create module for "krnl386.exe", 16-bit LDT support may be missing.
002e:err:module:attach_dlls "krnl386.exe16" failed to initialize, aborting
002e:err:module:attach_dlls Initializing dlls for L"C:\\windows\\system32\\winevdm.exe" failed, status c0000142

According to my research there was a security fix introduced with Kernel 3.14 that would require you (as stated in the Arch Wiki and the Wine FAQs) to run

echo 1 > /proc/sys/abi/ldt16 

in order to start 16-bit applications. However, /proc/sys/abi/ldt16 is not present anymore (at least on my system).

I wonder if this is a bug or a (deprecated) feature, if I possibly need other prerequisites or if it even could have gone south with the Meltdown/Spectre story.

Is anyone aware of the current status regarding 16-bit applications on 64-bit Linux?

Offline

#2 2018-02-20 21:26:31

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: 16-bit applications on Linux

There are a few kernel features that have been disabled in the arch kernel, notably CONFIG_X86_16BIT, CONFIG_MATH_EMULATION, CONFIG_MODIFY_LDT_SYSCALL.  You need a custom kernel for this to work.

$  uname -r
4.15.2-2-ARCH
$ zcat /proc/config.gz| grep MODIFY_LDT
# CONFIG_MODIFY_LDT_SYSCALL is not set

https://git.kernel.org/pub/scm/linux/ke … nfig#n2390

Another solution would be to run windows 95 in dosbox or kvm.

Last edited by progandy (2018-02-20 21:28:08)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2018-02-20 22:16:48

sunny interval
Member
From: Germany
Registered: 2018-02-20
Posts: 4

Re: 16-bit applications on Linux

Thank you very much. What a pity, but I am happy it is not me!

Do you happen to know if this was changed recently? (As of today the ArchWiki still has got a dedicated paragraph "16-bit programs" for Wine.)

Perhaps I will try another approach as you suggested.  It is not too bad, I realized in the meantime I may enjoy reviving other memories via ScummVM. smile (Look behind you, a three-headed monkey!)

Offline

#4 2018-02-20 22:57:57

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: 16-bit applications on Linux

This change was introduced with kernel 4.15-1
https://git.archlinux.org/svntogit/pack … d3936af3de


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2018-02-21 10:32:44

severach
Member
Registered: 2015-05-23
Posts: 192

Re: 16-bit applications on Linux

Offline

#6 2018-02-21 22:40:47

sunny interval
Member
From: Germany
Registered: 2018-02-20
Posts: 4

Re: 16-bit applications on Linux

Well, I realise that the developers have to balance the reasons in favour or against certain features. Apparently, there may be a security risk associated with the LDT syscall, that could legitimately outweigh the mere wish to readily run antique 16-bit applications. It's a pity - some true 16-bit classics still have got a decent fan base, like the Wing Commander series for instance - but I acknowledge that some things in life are slightly more important than old video games.

Offline

#7 2018-02-22 06:55:22

phw
Member
Registered: 2013-05-27
Posts: 318

Re: 16-bit applications on Linux

If you really need it compiling your own kernel package based on Arch's default kernel configuration isn't too difficult, see https://wiki.archlinux.org/index.php/Ke … ild_System

You can also install your custom kernel alongside the official one and e.g. choose in your boot loader which one to start.

Offline

#8 2018-02-22 11:39:48

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: 16-bit applications on Linux

VirtualBox should be capable of running Blade Runner in a WinXP guest.  While you're checking out SCUMMVM, give DOSBox a shot.  It should cover most of your 16-bit bases.

Offline

#9 2018-02-22 19:17:51

sunny interval
Member
From: Germany
Registered: 2018-02-20
Posts: 4

Re: 16-bit applications on Linux

To configure, compile and boot into a custom kernel or using a  fully-fledged VM (and installing an old Windows, which is always a PITA) certainly feels a bit like breaking a butterfly upon a wheel (compared to just running wine), but of course these are valid approaches, so thanks for your suggestions.

Offline

#10 2018-08-25 08:54:49

W.F.Cody
Member
From: Ghent
Registered: 2010-11-18
Posts: 155

Re: 16-bit applications on Linux

Can 16-bit support be offered as a kernel module?


My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!

Offline

#11 2018-10-23 06:42:09

NeoLG
Member
Registered: 2018-10-23
Posts: 2

Re: 16-bit applications on Linux

Hello,
      I'm also trying to enable 16-bit support for Wine in the vanilla Arch Linux distro.  I have followed the instructions to reconfigure the kernel 4.18.14  setting up CONFIG_MODIFY_LDT_SYSCALL=y.  After that I was able to recompile the kernel. However  the file "ldt16"  doesn't exist in the "/proc/sys/abi/" path.
Executing "zcat /proc/config.gz|grep "MODIFY_LDT"  retrieves "CONFIG_MODIFY_LDT_SYSCALL=y". Would you kindly point me in the right direction in order to have the ldt16 file produced?

I have gone through the wiki  page for the kernel recompilation, and several articles in the Internet with no luck.
Thank you in advance.

Neo

Last edited by NeoLG (2018-10-24 07:46:21)

Offline

#12 2018-10-23 07:15:44

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: 16-bit applications on Linux

There is no ldt16 file in modern kernels, that was a workaround for older kernels. The proper fix (which does not require you to set any sysctl knobs) was commited to mainline in 2014.
https://lore.kernel.org/patchwork/patch/464980/
https://git.kernel.org/pub/scm/linux/ke … 14ea2af86b

You have to enable some other kernel flags as well, not only CONFIG_MODIFY_LDT_SYSCALL.
https://wiki.archlinux.org/index.php/Wi … t_programs

Last edited by progandy (2018-10-23 07:16:55)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#13 2018-10-24 07:39:03

NeoLG
Member
Registered: 2018-10-23
Posts: 2

Re: 16-bit applications on Linux

Thank you Progandy for the additional information and clarifying there's no LDT16 file and therefore "echo 1 > /proc/sys/abi/ldt16 " wouldn't apply.
I definitely missed activating "CONFIG_X86_16BIT" on the kernel configuration phase.
I would like to add for the benefit of other newcomers that in the screen that allows to configure the kernel; the F8 key (I believe is the NConfig utility) can be used to search for the  "actual wording" associated to a KERNEL FLAG needed to re-enable 16-bit support for Wine.
Another observation is that CONFIG_X86_16BIT only became available after activating/checking CONFIG_MODIFY_LDT_SYSCALL; and that CONFIG_X86_ESPFIX64 is indirectly activated by other kernel flags.

Thanks again for the help
Neo

Offline

#14 2018-10-25 20:57:40

RoundCube
Member
Registered: 2016-05-14
Posts: 42

Re: 16-bit applications on Linux

progandy wrote:

This change was introduced with kernel 4.15-1
https://git.archlinux.org/svntogit/pack … d3936af3de

The linux-lts package ships currently a kernel from the 4.14 series, for a while this may be a workaround. However, after some while the lts kernel will as well use a newer version. If installing another kernel one potentially needs as well a few other packages, e.g. acpi_call-lts if you currently have acpi_call installed, or bbswitch-dkms (because there exists no bbswitch-lts).

Offline

Board footer

Powered by FluxBB