[HN Gopher] Run Linux Programs on DOS
       ___________________________________________________________________
        
       Run Linux Programs on DOS
        
       Author : philonoist
       Score  : 59 points
       Date   : 2023-04-23 13:03 UTC (9 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | shmerl wrote:
       | _> DOS Subsystem for Linux_
       | 
       | This naming scheme which originated from Windows is atrocious. If
       | anything, it should be Linux subsystem for DOS, not the other way
       | around.
        
       | em-bee wrote:
       | for some reason this title reminded me of my first "encounter"
       | with UNIX.
       | 
       | i believe it was the first issue of the german computer magazine
       | IX. it praised the benefits of UNIX over other systems and
       | somehow that got me hooked. i didn't have access to a UNIX system
       | but i was searching for it. next i got a book from O'Reilly
       | called "Dos meets UNIX". my first O'Reilly book. it sounded like
       | what i needed, since DOS is what i had, and UNIX is what i
       | wanted. i don't remember what i did with that, but i believe the
       | book pointed to some utilities that emulated UNIX commands in a
       | DOS environment.
       | 
       | i finally got access to a real UNIX system at university (SUN and
       | AIX) and then soon came Linux, which i installed dualboot, and
       | with every upgrade/reinstall the DOS partition shrank and the
       | Linux partition grew, and the rest is history.
        
       | elvis70 wrote:
       | Previous thread (102 comments):
       | https://news.ycombinator.com/item?id=28572681
       | 
       | It seems to be using the VM86 mode of the 386
       | (https://en.wikipedia.org/wiki/Virtual_8086_mode). So it won't
       | work if you are using EMM386 by example.
        
       | airstrike wrote:
       | _> A WSL alternative for users who prefer an MS-DOS environment._
       | 
       | Hilarious
        
         | rkeene2 wrote:
         | There also used to be a project called LINE, which is to
         | Windows what WINE is to Linux -- in other words it let you run
         | Linux binaries on Windows
        
         | philonoist wrote:
         | That is what I thought. Haha!
         | 
         | Also, wasn't it back in the day people did the fastest initial
         | ritual of using DOS for installing a whole big Win/*nix OS much
         | like internet explorer for Chrome? Hilarious imagining DOS
         | being the host for Linux programs.
        
           | UncleSlacky wrote:
           | It reminds me of ZipSlack:
           | https://en.wikipedia.org/wiki/ZipSlack
        
       | natas wrote:
       | This is really neat, would it work on ArcaOS or OS/2? Are there
       | some limitations on the linux binaries, i.e. addressable space,
       | etc. or pretty much anything that can be compiled with musl would
       | likely work?
        
         | elvis70 wrote:
         | It will only work from real mode because it is, in fact, a VM86
         | mode monitor. So no EMM386, Windows in 32-bit mode or OS/2.
        
           | natas wrote:
           | thank you!
        
       | queuebert wrote:
       | I've always thought the phrase "Windows/DOS Subsystem for Linux"
       | was backwards. Shouldn't it be "Linux Subsystem for Windows/DOS"?
       | 
       | What am I missing?
        
         | cout wrote:
         | It seems backward to me, too.
         | 
         | Try reading it as "DOS subsystem for [running] Linux".
        
         | HeckFeck wrote:
         | The marketing department
        
         | Karellen wrote:
         | I did once see someone who claimed to have knowledge of Windows
         | internals say that "Windows subsystem for X" was a general
         | naming convention for Windows subsystems, e.g. the code that
         | implemented the audio architecture might have been called
         | "Windows subsystem for sound", or similar. And therefore
         | "Windows subsystem for Linux" was the natural extension of this
         | policy for the code that implemented the Linux compatibility
         | architecture.
         | 
         | However, I've had a bit of a web search on a few occasions
         | since then, and not been able to find any concrete evidence to
         | support the existence of any other "Windows subsystem for X"
         | subsystems. So that might have just been a random idiot making
         | stuff up, as far as I can tell. Someone with better
         | searchengine-fu might be able to find something more conclusive
         | though?
        
         | efdee wrote:
         | It's a subsystem of Windows, so a Windows subsystem. It's for
         | running Linux. Hence, Windows Subsystem for Linux.
        
           | phloximaxi wrote:
           | Is it really a windows subsystem "for linux" or a windows
           | subsystem "for running linux". There is a big difference.
           | Very bad naming.
        
             | ElectricalUnion wrote:
             | "Yes"
             | 
             | It does both syscalls in linux style "for linux" programs
             | (WSL1) and it also happens to be "for running linux"
             | (WSL2).
        
             | rkeene2 wrote:
             | WSL originally didn't run Linux, it performed system call
             | mapping
        
           | marcodiego wrote:
           | So... "office for windows" refers to the windows you have on
           | your office?
        
             | kevingadd wrote:
             | If following the WSL naming convention, it would be
             | something like 'Windows Software for Offices'
        
         | bayandin wrote:
         | Yep, it definitely should be named LSD
        
         | omoikane wrote:
         | I guess it should be parsed as "Windows/DOS: (Subsystem for
         | Linux)" as opposed to "(Windows/DOS Subsystem) for Linux".
        
         | tadfisher wrote:
         | IIRC, the original "Windows Subsystem for UNIX" was named such
         | to avoid trademark issues with the more sensical "UNIX
         | Subsystem for Windows".
        
         | jaclaz wrote:
         | It's coming from the same people that call "boot" the volume
         | where the operating system resides and "system" the volume that
         | is booted:
         | 
         | http://www.multibooters.co.uk/system.html
         | 
         | And that of course puts 32 bits executables in SysWoW64 and 64
         | bit executables in System32.
        
           | squarefoot wrote:
           | Not to mention the backslash.
        
           | Dalewyn wrote:
           | It kind of makes sense if you give it some thought, though.
           | 
           | The system boots from the "system" partition, and then the
           | system boots the operating system in the "boot" partition.
           | 
           | system32 holding 64-bit binaries in 64-bit Windows is 300%
           | backwards compatibility to accomodate legacy hard-code,
           | though.
        
         | mdp2021 wrote:
         | > _What am I missing?_
         | 
         | The "ownership" :)
         | 
         | ("MyBrand (TM) Solution for Opportunity")
        
           | loopz wrote:
           | EEE
        
         | nubinetwork wrote:
         | It's always been backwards, including its predecessor, Windows
         | Services for UNIX.
        
       | johnea wrote:
       | Just more evidense that M$ brain damaged the entire generation
       | raised on computers...
       | 
       | C:? case insensitive file system?
       | 
       | Why would anyone who can run linux run this shit?
        
         | BirAdam wrote:
         | The things you feel are Microsoft, didn't originate with
         | Microsoft. MS-DOS was a 16 bit clone of CP/M for the 8086. CP/M
         | was loosely designed in the fashion of TOPS-10 from DEC.
         | Windows was originally a graphical shell over DOS loosely
         | modeled off of Xerox's technology, and Windows NT's internals
         | took very liberally from VMS.
         | 
         | If we compare this pedigree to that of UNIX, UNIX would appear
         | to be the brain dead system. Multics was largely a disaster,
         | and it informed many parts of UNIX's design, but UNIX was
         | written largely to allow Ken Thompson to play an early video
         | game (that he wrote), Space Travel.
         | 
         | The two systems just have very different origins and very
         | different designs based upon their initial use cases. However,
         | people thinking that DOS or Windows are somehow less-than is
         | just ignorant of history, and I say this as someone who loathes
         | modern Windows.
        
         | yjftsjthsd-h wrote:
         | I'm pretty sure it's a joke or "because we can" project, not
         | something someone would seriously use
        
         | 64operator wrote:
         | MS-DOS is still widely used in embedded, MS still sells it to
         | OEMs. There is also the Free and Open Freedos. Maybe you have a
         | small program you developed on Linux and maintain on several
         | OS's, and you don't want to go through the nightmare of
         | maintaining a DOS port as well.
        
         | Dalewyn wrote:
         | /dev/sda? Case sensitive file system?
         | 
         | Why would anyone who can run DOS run Linux?
         | 
         | On a more constructive note, MS-DOS and Windows operate on a
         | fundamentally different philosophy from UNIX. That doesn't make
         | them inherently bad. The vast majority of users even relate
         | better (FSVO better) to the way Windows does it.
        
       | jmmv wrote:
       | This is really cool, and there doesn't seem to be a lot of code
       | in the repo. But before trying to read it... does anyone know how
       | this works?
       | 
       | Edit to answer myself: found the answer in this comment from the
       | last time this was discussed:
       | https://news.ycombinator.com/item?id=28574202
        
         | elvis70 wrote:
         | It uses the Virtual 8086 Mode of the 386. The Intel 80386
         | Reference Programmer's Manual explains that well [1], I think.
         | 
         | So, in this case, the first mega of RAM, containing MS-DOS and
         | the BIOS is virtualized in a VM86 box while the CPU is running
         | in protected mode, permitting the host OS to cohabit with a
         | protected-mode OS.
         | 
         | It is in fact, a VM86 monitor. Another example of such a
         | program is EMM386 or similar like Jemm386 whose source code is
         | available [2].
         | 
         | [1] https://pdos.csail.mit.edu/6.828/2018/readings/i386/c15.htm
         | 
         | [2] https://github.com/Baron-von-Riedesel/Jemm
         | 
         | edit: the link [1] was wrong
        
       ___________________________________________________________________
       (page generated 2023-04-23 23:01 UTC)