
Project: 2ine – OS/2 emulator for Linux - geocar
https://www.patreon.com/posts/project-2ine-16513790
======
jacquesm
Beautiful piece of work. This bit jumped out at me:

"First problem: I don’t have a 16-bit code segment! Second: I don’t have a way
to generate 16-bit code with GCC."

I had that exact same problem writing a loader for a now defunct OS and for
years I kept a copy of Borland C++ handy so that I could compile a 16 bit
trimmed down version of the filesystem that would load the rest of the OS
before jumping into 32 bit mode. The tricky bit was that the loader had to
interact with the BIOS in 16 bit mode and I could not find a way to cleanly
jump back to 16 bit mode from 32 bit mode once I got there, so multiple
transitions of that 16 to 32 bit boundary were out.

So instead I cut out everything from the filesystem code that had to do with
writing and updating things just to read a couple of files, place them in
memory, flip to 32 bit and then jump to the equivalent of 'init'.

The x86 compilers of old had a whole pile of 'models' that you could write
for, all with different sizes of code and data segment limits.

DJ Delorie's excellent GCC to DOS port (DJGPP) was another very important tool
in that whole process.

Also beautiful how web.archive.org provided one of the key bits of
information, I suspect that in the longer term it will be as important as
WikiPedia.

~~~
xvilka
There is also crossplatform and still actively developed OpenWatcom [1], which
can generate code for DOS and runs from all mainstream operating systems.

[1] [https://github.com/open-watcom/open-watcom-v2](https://github.com/open-
watcom/open-watcom-v2)

------
newnewpdro
Having used OS/2 for a number of years before switching to GNU/Linux, I can't
recall a single piece of OS/2 native software that I miss and would like to
run in emulation.

The vast majority of what I (and my computer geek peers) did under OS/2 was
run MS-DOS software in a multi-tasking environment. OS/2 never really got much
in the way of quality native software developed for it, at least not that us
poor students had access to anyways.

~~~
dade_
At the time, being able to run windows applications on OS/2 was a big feature,
so there wasn't much need for native applications. Windows 95 came out, and
its apps were not compatible, so the feature ended up accelerated its demise.
I used it to run my BBS, OS/2 was great for muktitasking and stability. The
built in networking was great, being used to Windows 3.1 at the time. It was
also very common in voicemail systems and is also used in IBM cheque scanners.
I don't have any interest in running IBM Works, but there has been interest in
running old BBS software lately...

~~~
newnewpdro
The windows compatibility was much touted but it was never impactful enough to
compel any significant numbers of DOS/Win users to switch, so it's not like
that feature ceasing to work with the arrival of Windows 95 resulted in masses
of OS/2 users switching back. There simply never were masses of users.

What IBM needed was some killer OS/2-specific programs to attract the masses.
There was a window (har har) of time where they probably could have done it,
but they missed it. They certainly had the resources at the time.

It's also important to remember that PC hardware support was an absolute
nightmare back then. OS/2 needed drivers written for everything, and very
little was standardized, there wasn't even USB. Hardware compatibility
combined with a lack of attractive native software were the major barriers to
mass adoption IMHO.

edit: This stroll down memory lane just reminded me of the pile of 30+ 3.5"
floppy disks required to install OS/2, which I had to write myself using the
CDROM from DOS, because OS/2 couldn't use that particular CDROM successfully
yet.

------
dom96
Hrm. As someone who wasn't alive during the OS/2 era, does anyone have or know
of an overview of features that made it particularly stand out?

~~~
newnewpdro
True 32-bit protected mode preemptive multi-tasking was the primary advantage
over comtemporary windows at the time.

People were using Desqview in MS-DOS to achieve this level of multi-tasking in
lieu of OS/2\. OS/2 did it better. Windows 3.1 was cooperative multi-tasking,
not even protected mode if memory serves.

Windows NT would be where MS tech caught up with IBM, OS/2 was out in the wild
for quite some time already.

But the general public didn't embrace OS/2, Windows 95 effectively killed it.

~~~
kjs3
OS/2 was 16-bit until 2.0 (and technically still had 16-bit chunks under the
hook after that). Windows NT was where MS 'forked' OS/2 after the 2.0 days;
IBM and MS were partners in developing OS/2.

~~~
kyberias
Windows NT started from scratch. It was never an OS/2 fork.

~~~
danboarder
Not from scratch. It started as "OS/2 NT" in partnership with IBM. Microsoft
renamed OS/2 NT to Windows NT. See here:
[http://www.itprotoday.com/management-mobility/windows-nt-
and...](http://www.itprotoday.com/management-mobility/windows-nt-and-vms-rest-
story)

~~~
kyberias
Yes from scratch. Names matter little.

From your source: "Microsoft's internal project name for the new OS was OS/2
NT, because Microsoft's intention was for the new OS to succeed OS/2 yet
retain the OS/2 API as its primary interface."

Note how Russinovich talks about a "new OS".

The NT (kernel) never had any OS/2 code in it, it was a totally different
project. The first target processor architecture for NT wasn't even x86, it
was MIPS.

OS/2 in NT was merely a subsystem layer next to DOS and Posix, somewhat like
today there is the Linux subsystem layer in Windows 10.

A good source is this:

[https://www.amazon.com/Show-Stopper-Breakneck-Generation-
Mic...](https://www.amazon.com/Show-Stopper-Breakneck-Generation-
Microsoft/dp/0029356717)

~~~
newnewpdro
> The first target processor architecture for NT wasn't even x86, it was MIPS.

I thought it's pretty well established now that the NT in the name was named
after the target architecture: Intel i860 "N10", not MIPS.

~~~
kyberias
You're right. My point was, however, that it wasn't an x86.

------
FullyFunctional
This is impressive work, but I was particularly interested in his in-passing
mention of running Linux apps on Mac. I could use that (EDA tools at best
support Linux if even). Lo and behold, there's something Noah that proclaims
to do this. Is there anything else? (I'm a heavy user of VMware Fusion, but
that's pretty heavy weight).

------
yuhong
This reminds me that when SYSCALL was modified to change EFLAGS and SWAPGS was
created they only cared about Linux which didn't use call gates (not an issue
for this since this API emulation runs in user mode). Also reminds me of
espfix which generally is not needed for OS/2 programs to work correctly.

------
orionblastar
OS/2 2.x had WinOS2 to run 16 bit programs for DOS and Windows. OS/2 3.0 did
32 bit OS2 but not Windows 32 bit.

Still running 16 bit DOS and Windows programs meant that developers did not
target an OS2 binary because a Windows binary was all they needed.

------
thrownaway954
eComStation is the successor to OS/2:
[https://en.wikipedia.org/wiki/EComStation](https://en.wikipedia.org/wiki/EComStation)

