Oldest piece of code in recent Windows version

Discuss Windows 95, 98 and ME.
ZXman
Posts: 3
Joined: Sat Nov 14, 2020 7:59 pm

Oldest piece of code in recent Windows version

Post by ZXman »

I wonder if in Windows 10 there are pieces of code from old Windows versions? And if they are there - are they from Windows 95 or even from Windows 3.1?

Pikavolt321
Posts: 35
Joined: Mon Feb 12, 2018 11:44 pm

Re: Oldest piece of code in recent Windows version

Post by Pikavolt321 »

ZXman wrote:
Sat Nov 14, 2020 8:20 pm
I wonder if in Windows 10 there are pieces of code from old Windows versions? And if they are there - are they from Windows 95 or even from Windows 3.1?
I imagine there's code in the WoW subsystem dating to Windows 1.0 possibly, on 32-bit Windows 10. On 64-bit, the oldest code would be from Windows NT 3.x (and maybe Win95).

Meow
Posts: 480
Joined: Mon Feb 03, 2020 5:28 am
Location: Earth

Re: Oldest piece of code in recent Windows version

Post by Meow »

Pikavolt321 wrote:
Tue Nov 17, 2020 3:35 pm
ZXman wrote:
Sat Nov 14, 2020 8:20 pm
I wonder if in Windows 10 there are pieces of code from old Windows versions? And if they are there - are they from Windows 95 or even from Windows 3.1?
I imagine there's code in the WoW subsystem dating to Windows 1.0 possibly, on 32-bit Windows 10. On 64-bit, the oldest code would be from Windows NT 3.x (and maybe Win95).
The oldest code in the WoW subsystem would likely be from 3.0. 1.0 and 2.0 were not very popular so not many apps were written for them. 3.0 is where applications were rewritten because 1.0 and 2.0 apps were basically DOS exes with a frontend for the Windows GUI. Since 3.0 introduced an actual kernel (vs 1.0 and 2.0, which basically were dos shells, and basically did not have their own kernel) , apps needed to be rewritten for that platform. 64 bit Windows 10 would likely contain code from as far back as 1988, when NT was still OS/2 3.0.

xelloss
User avatar
Donator
Posts: 400
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Oldest piece of code in recent Windows version

Post by xelloss »

Meow wrote:
Tue Nov 17, 2020 6:05 pm
The oldest code in the WoW subsystem would likely be from 3.0. 1.0 and 2.0 were not very popular so not many apps were written for them. 3.0 is where applications were rewritten because 1.0 and 2.0 apps were basically DOS exes with a frontend for the Windows GUI. Since 3.0 introduced an actual kernel (vs 1.0 and 2.0, which basically were dos shells, and basically did not have their own kernel) , apps needed to be rewritten for that platform. 64 bit Windows 10 would likely contain code from as far back as 1988, when NT was still OS/2 3.0.
It all depends on the meaning of "the oldest code". I've recently started disassembling KERNEL from Windows DR5, and some of the functions have the exact same names used in the Windows 3.1 KRNL286/386. As for the actual code in those functions, who knows; but I'd bet a good bottle of Conero DOCG that the 16 bit kernel was never rewritten 100% from scratch: IMHO chances are a few lines of code here and there written by somebody in 1983 still survive in Windows 10 32 bit.

AlphaBeta
User avatar
Donator
Posts: 2437
Joined: Sun Aug 12, 2012 4:33 pm
Location: Czechia

Re: Oldest piece of code in recent Windows version

Post by AlphaBeta »

Meow wrote:
Tue Nov 17, 2020 6:05 pm
Since 3.0 introduced an actual kernel (vs 1.0 and 2.0, which basically were dos shells, and basically did not have their own kernel)
I would be interested in your definition of a kernel, then
AlphaBeta, stop brainwashing me immediately!

Image

Meow
Posts: 480
Joined: Mon Feb 03, 2020 5:28 am
Location: Earth

Re: Oldest piece of code in recent Windows version

Post by Meow »

AlphaBeta wrote:
Tue Nov 17, 2020 10:30 pm
Meow wrote:
Tue Nov 17, 2020 6:05 pm
Since 3.0 introduced an actual kernel (vs 1.0 and 2.0, which basically were dos shells, and basically did not have their own kernel)
I would be interested in your definition of a kernel, then
Their kernels weren’t all that functional and they relied heavily on DOS’s kernel. 3.0’s kernel was way more functional and didn’t rely on DOS’s kernel as much. I guess you could say that their kernels were indeed kernels but in my opinion they really aren’t.

xelloss
User avatar
Donator
Posts: 400
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Oldest piece of code in recent Windows version

Post by xelloss »

AlphaBeta wrote:
Tue Nov 17, 2020 10:30 pm
I would be interested in your definition of a kernel, then
IIRC the Windows 16 bit "kernel" is about managing memory and processes (only supporting cooperative multitasking). Most notably, it doesn't provide any disk I/O, and Win16 programs need to call directly into DOS for that. There are a real mode "kernel" (KERNEL.EXE, up to version 3.0) and two protected mode kernels (KRNL286 and KRNL386, both starting from Windows 3.0); I believe the major difference between them is memory management (real mode and protected mode memory management are radically different) but maybe there's other stuff as well.

Matriks404
Posts: 73
Joined: Wed Jul 24, 2013 8:23 pm
Location: Kraków, Poland

Re: Oldest piece of code in recent Windows version

Post by Matriks404 »

I've actually thought about this as well some time before, I think one of the most prominent oldest relict (probably not code itself) of the past are the drive letters and virtual DOS devices such as COM0:, CON: or NUL (originated in CP/M), these still cause problems today, for example you can't name a directory or a file with the same name as DOS device (try naming a directory NUL).

The other relict is EDLIN DOS text editor which is still available in 32-bit versions of Windows 10 through NTVDM (16-bit DOS emulation layer), which as well originated in CP/M (editor called just ED) but was also a distant relative of the UNIX ed text editor (which first version was available in 1973). Wikipedia source: https://en.wikipedia.org/wiki/Edlin

As for oldest code I think the NTVDM in its entirety (again, 32-bit Windows only) could contain some very old DOS code, like command interpreter (COMMAND.COM) or other utilities, although based on later MS-DOS versions (probably 5.0).

xelloss
User avatar
Donator
Posts: 400
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Oldest piece of code in recent Windows version

Post by xelloss »

Matriks404 wrote:
Thu Nov 19, 2020 5:48 pm
The other relict is EDLIN DOS text editor which is still available in 32-bit versions of Windows 10 through NTVDM (16-bit DOS emulation layer), which as well originated in CP/M (editor called just ED) but was also a distant relative of the UNIX ed text editor (which first version was available in 1973). Wikipedia source: https://en.wikipedia.org/wiki/Edlin
Oh yes, good point. That one was written by Tim Paterson for his QDOS version 0.2, long before it evolved into MS-DOS. Wow.

xpclient
User avatar
Posts: 475
Joined: Fri Aug 28, 2009 1:10 pm
Location: Windows

Re: Oldest piece of code in recent Windows version

Post by xpclient »

One example that comes to mind is Video for Windows API and the whole VfW codec framework that is ancient.
xpclient
Huge Microsoft fan and old software collector since Windows 3.0 and MS-DOS :mrgreen:
I did the testing and feedback for Classic Shell.

Lucas Brooks
Posts: 773
Joined: Sat Oct 20, 2018 11:37 am
Contact:

Re: Oldest piece of code in recent Windows version

Post by Lucas Brooks »

I'd say the oldest line of code in Windows 10 is:

Code: Select all

#include "windows.h"
It existed way before Windows 1.01, possibly before the Fall Comdex 1983 demo of Windows 1.0.

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: Oldest piece of code in recent Windows version

Post by os2fan2 »

This is the DOS5 and Win31 stuff from all versions of windows from 3.50 onwards. kb16 is keyb. Some of these are new compiles (qbasic.exe, drwatson) some are straight DOS 5.0 files. Anything from DOS 5 will run under WinNT, just that NT doesn't like the DOS format or chkdsk actually doing something useful.

edit is from Win95, not WinME.

It is amusing that MS-Edlin was dropped from DOS 6 (to the supp disk), but remains in NT in all of its glory. PC-DOS dropped edlin in DOS 7 (available on the supp disk), but OS/2 keeps it and updates it on each IBM build.

Code: Select all

ansi.sys        doshelp.hlp    -gorilla.bas     mem.exe        -qbasic.exe
append.exe      dosx.exe        graphics.com   -money.bas      -qbasic.hlp
autoexec.nt    #drwatson.exe    graphics.pro    mscdexnt.exe    redir.exe
backup.exe     =edit.com        himem.sys      -nibbles.bas    #regedit.exe
command.com    =edit.hlp        kb16.com        ntcmds.hlp     -remline.bas
config.nt       edlin.exe      +key01.sys       ntdos.sys       setver.exe
country.sys     exe2bin.exe     keyboard.sys    ntio.sys        share.exe
debug.exe       fastopen.exe    loadfix.com     nw16.exe       #sysedit.exe

  Commands +added, -removed, =upgraded in Windows 2000.
  Commands # are for the Wow16 subststem, work on Windows 3.1
  The Win2000 set is the same as the Vista 6.1 set.

Pluto950
Posts: 19
Joined: Fri Mar 02, 2018 8:12 pm
Location: Bill's secret garden

Re: Oldest piece of code in recent Windows version

Post by Pluto950 »

I definitely remember a few registry references to Windows 3.1 Migration in at least WinXP, and I think it is still in 10, too.
I'm gonna make him an [OFFER] he can't refuse.

Hyoenmadan86
Posts: 228
Joined: Fri Sep 07, 2012 6:45 pm

Re: Oldest piece of code in recent Windows version

Post by Hyoenmadan86 »

xelloss wrote:
Wed Nov 18, 2020 1:26 am
IIRC the Windows 16 bit "kernel" is about managing memory and processes (only supporting cooperative multitasking). Most notably, it doesn't provide any disk I/O, and Win16 programs need to call directly into DOS for that. There are a real mode "kernel" (KERNEL.EXE, up to version 3.0) and two protected mode kernels (KRNL286 and KRNL386, both starting from Windows 3.0); I believe the major difference between them is memory management (real mode and protected mode memory management are radically different) but maybe there's other stuff as well.
The only real kernel which actually existed in Win2x, 3x and 4x was the VMM. You can call it an early hypervisor type kernel, as it implements all sorts of virtualization techniques through Intel V86 cpu extensions. It can virtualize hardware access and is comparable to what Netware was and actually Xen and ESXi ones are, just more primitive, but more lightweight too. Has already been discussed it can use DOS basically as a disk driver, but generally you want to use VxD storage port drivers like ESDI506, or SCSI MPD miniports for better performance.

As for DOSX, used in Win2 and 3 standard bootmode can't be really catalogued as kernel, it is a real DPMI server implemented in top on DOS. KERNEL, KRNL286, KRNL386 and Kernel32 aren't the windows kernel per se... Them never were. In Win2, 3 and 4 them are DPMI client "special" applications which implement the windows api on top of the DPMI server, which is provided by DOSX or virtualized by the VMM kernel. On NT these are clients of the NTDLL api.

SpiralVortex
Posts: 244
Joined: Fri Oct 08, 2010 6:06 am

Re: Oldest piece of code in recent Windows version

Post by SpiralVortex »

Now that Windows 11 is going 64-bit only, that means an end to the old MS-DOS files as mentioned in earlier posts.

So, what's the oldest bit of code in 64-bit Windows? It'll be part of the 32-bit subsystem and, for no other reason than I know it was around in 1992, I'll nominate moricons.dll (which still exists in the Insider Preview build of Windows 11).

xelloss
User avatar
Donator
Posts: 400
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Oldest piece of code in recent Windows version

Post by xelloss »

SpiralVortex wrote:
Fri Jul 02, 2021 5:39 am
So, what's the oldest bit of code in 64-bit Windows? It'll be part of the 32-bit subsystem
Not necessarily. NT is built from a highly portable code base: the same source generates, in most cases, 32 bit or 64 bit executables.
SpiralVortex wrote:
Fri Jul 02, 2021 5:39 am
I'll nominate moricons.dll (which still exists in the Insider Preview build of Windows 11).
Still? That's amazing. Isn't it a 16 bit DLL, though?

Windows8.1rocks
Posts: 4
Joined: Wed Sep 02, 2020 2:46 pm

Re: Oldest piece of code in recent Windows version

Post by Windows8.1rocks »

I would say the oldest piece of code on Windows 10/11 would be something from NT 3.1x or NT 4.0. These releases have far more in common with Windows 10 and 11 and Modern Windows in General than 95/98/Me, as these are based on NT, rather than 9x, which at its core, is DOS

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: Oldest piece of code in recent Windows version

Post by os2fan2 »

Moricons is a resource DLL. Specifically, it has small icons in it which vista+ do not show correctly.

xelloss
User avatar
Donator
Posts: 400
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Oldest piece of code in recent Windows version

Post by xelloss »

os2fan2 wrote:
Thu Sep 02, 2021 11:20 am
Moricons is a resource DLL. Specifically, it has small icons in it which vista+ do not show correctly.
Are you sure? On my system, it shows well in Windows 11.

os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: Oldest piece of code in recent Windows version

Post by os2fan2 »

When i read your comment, I set the icon of an html shortcut to something in moricons.dll, and it did indeed work. On the other hand, setting the icon to WP51 (DOS) pif file, produces the same white square it always did.

AlphaBeta
User avatar
Donator
Posts: 2437
Joined: Sun Aug 12, 2012 4:33 pm
Location: Czechia

Re: Oldest piece of code in recent Windows version

Post by AlphaBeta »

Hyoenmadan86 wrote:
Fri Jul 02, 2021 3:38 am
As for DOSX, used in Win2 and 3 standard bootmode can't be really catalogued as kernel, it is a real DPMI server implemented in top on DOS. KERNEL, KRNL286, KRNL386 and Kernel32 aren't the windows kernel per se... Them never were. In Win2, 3 and 4 them are DPMI client "special" applications which implement the windows api on top of the DPMI server, which is provided by DOSX or virtualized by the VMM kernel. On NT these are clients of the NTDLL api.
It might be worth noting that the equivalent of kernel.exe was originally called base.dll in the early NT builds from 1991, probably for this exact reason. The name still lives on in the file description of kernel32, kernelbase and advapi32.
AlphaBeta, stop brainwashing me immediately!

Image

Lucss21a
User avatar
Posts: 103
Joined: Tue Jul 13, 2021 4:39 am
Contact:

Re: Oldest piece of code in recent Windows version

Post by Lucss21a »

I was thinking of existing Win32 code in modern Windows. It is possible to have bits of code from early Windows versions (1.0-3.0), but 1.0x to 2.xx is just a glorified file manager shell for DOS. I'm no software expert but it is possible that system files from Windows 10 are derived from Windows for Workgroups 3.1x or earlier.
Image
My blog: https://alexisgaming95.neocities.org


Is AlphaBeta REALLY brainwashing us tho?

vbdasc
Posts: 350
Joined: Fri Apr 30, 2010 6:14 pm

Re: Oldest piece of code in recent Windows version

Post by vbdasc »

Lucss21a wrote:
Fri Sep 03, 2021 6:11 am
I was thinking of existing Win32 code in modern Windows. It is possible to have bits of code from early Windows versions (1.0-3.0), but 1.0x to 2.xx is just a glorified file manager shell for DOS.
Windows 1.x, Windows 2.x (not Windows/386) and Windows 3.0 in Real mode are indeed graphical shells for DOS.
Windows 3.x in Standard mode is a DOS extender plus a graphical shell.
Windows/386 2.1x and Windows 3.x in Enhanced mode are DOS preemptive multitaskers plus graphical shells.
Lucss21a wrote:
Fri Sep 03, 2021 6:11 am
I'm no software expert but it is possible that system files from Windows 10 are derived from Windows for Workgroups 3.1x or earlier.
In 32-bit Windows 10, sure. It contains the NTVDM and WoW subsystems, which in turn contain modified versions of DOS 5.0 and Windows 3.1.

vbdasc
Posts: 350
Joined: Fri Apr 30, 2010 6:14 pm

Re: Oldest piece of code in recent Windows version

Post by vbdasc »

Hyoenmadan86 wrote:
Fri Jul 02, 2021 3:38 am
The only real kernel which actually existed in Win2x, 3x and 4x was the VMM.
VMM existed only in Windows 9x (Win 4x, according to your scheme of things). In Windows/386 2.1 and Windows 3.x Enhanced mode, there was WIN386.EXE instead. In all other versions of Windows 1.x, 2.x or 3.x, there was neither hardware virtualization/interception/serialization, nor virtual memory, nor DOS multitasking, so no real "kernel" either.

Tootles
User avatar
Donator
Posts: 1015
Joined: Mon Feb 12, 2007 12:50 pm
Location: England

Re: Oldest piece of code in recent Windows version

Post by Tootles »

Meow wrote:
Tue Nov 17, 2020 10:40 pm
Their kernels weren’t all that functional and they relied heavily on DOS’s kernel. 3.0’s kernel was way more functional and didn’t rely on DOS’s kernel as much. I guess you could say that their kernels were indeed kernels but in my opinion they really aren’t.
The kernels interpreted API calls, hosted device drivers, and so on. They absolutely were functioning OS kernels.
Long days, and pleasant nights.

Post Reply