Author Topic: MS-DOS/9x Kernel Inaccuracy.  (Read 1436 times)

anphanax

  • Member
  • **
  • Posts: 197
  • Kudos: 11
    • http://june.tripod.com
MS-DOS/9x Kernel Inaccuracy.
« on: 27 July 2004, 13:50 »
Microsoft Windows has been able to utilize protected mode since a special version was released, called today as "Windows 286" (at least what i've seen) and was based off of Windows 2.0.

If you think i'm wrong, try writing a windows application using DOS interrupts (21h, in particular) and see how far you get... WINDOWS 95 AND ABOVE ARE NOT MS-DOS. The interfaces designed for programming applications for these operating systems are not the same, therefore the Kernels aren't. 9x may have invoked MS-DOS for whatever reason, but it's most likely that the 9x kernel was more than just a wrapper for MS-DOS.

Proof of a different interface:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win9x/lfn_0het.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win9x/fat32ovr_0085.asp
These functions do not match MS-DOS functions (link below).
http://www.clipx.net/ng/interrupts_and_ports/ng51318.php

Documented kernel console functions.
(This is here so people will quit thinking Windows Console applications and MS-DOS applications are the same thing. MS-DOS applications don't invoke Windows API [you know what I mean here...].)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getconsolewindow.asp

EDIT:
I made this post because I saw a lot of people claiming they were the same kernel. There could be a strong relationship between MS-DOS and Windows 9x that i'm unaware of, but even so, the API is different, MS Windows multi-tasks, and does.. other things.. that MS-DOS "can't".

[ July 27, 2004: Message edited by: anphanax ]

[ July 27, 2004: Message edited by: anphanax ]

[ July 29, 2004: Message edited by: anphanax ]


Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #1 on: 27 July 2004, 17:46 »
Windows 95 to ME (WinDOS) does use a DOS boot loader I don't know about the kernel though. I know Windows does call DOS the DOS 21h API and this is part of the kernel, it uses DOS kernel.

Despite the fact that MS will do it's best to convince you otherwise. When you call a Windows file IO function all the data is buffered back to DOS and the CPU is switched real mode, Int 21h is called and DOS does it's business, the CPU is then switched back to protected mode and the data is buffered back to your program. This is all very sneaky I must admit.

Try saving or opening a file named CON PRN or NUL in a windows program running under WinDOS and watch it crash.

Some DOS extenders include Win32 API emulation as a part of the package:

HX DOS Extender

And even better: WDOSX

Thus enabling you to run a Win32 console app under plain old DOS. Win32 has a built in DPMI that calls the DOS int 21h API.

The old virus checker I used under Win95 (forgotten the name) had both Windows and DOS parts, but it would still work even if you uninstalled the Windows part. The screen would go red and warn me a file I using in Windows was infected. The Windows part wouldn't work with out the DOS part, if you removed it from config.sys file when Windows booted it would say that it wasn't in memory.

DOS was in the heart of Win95 to WinME.

As far as I'm aware WinDOS doesn
This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

hm_murdock

  • VIP
  • Member
  • ***
  • Posts: 2,629
  • Kudos: 378
  • The Lord of Thyme
MS-DOS/9x Kernel Inaccuracy.
« Reply #2 on: 27 July 2004, 18:09 »
dude, he just posted facts to support his claim, and you just say "nope, it had DOS so it had a DOS kernel"

bullshit

A Corvette with a Mopar starter is not a Dodge.

Did you know that you can make Linux boot from the DOS command line? it was a common practice about a decade ago, back when HDs were still small, for a lot of people to install distros like Slackware on a DOS partition and then start it with a DOS command. You can do the same with BeOS, or, really, any OS. Once you get its kernel in memory, it takes over. This is what Windows 9x did. DOS booted the machine, then loaded the Windows kernel. The difference is that 9x simply did not unload the DOS kernel from memory if memory serves.

If you start Linux or Be from DOS, does that mean that they're "using a DOS kernel"? No.

Stop going around flaming people because they're right.

edit: Thank you Anphanax, BTW.

[ July 27, 2004: Message edited by: JimmyJames: GenSTEP Founder ]

Go the fuck ~

Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #3 on: 27 July 2004, 18:41 »
quote:
Originally posted by JimmyJames: GenSTEP Founder:
dude, he just posted facts to support his claim



As have I!
You have obviously not bothered to read them.

 
quote:
Originally posted by JimmyJames: GenSTEP Founder:

 and you just say "nope, it had DOS so it had a DOS kernel"



That would explain the reason for the "strange behaviour" of my old Virus scanner!

And the fact you can get DOS extenders that can run Win32 console programs under plain DOS without Windows!

WDOSX is truly magic you put in a program compiled for Win32 colsole and it spits out a DOS program!

 
quote:
Originally posted by JimmyJames: GenSTEP Founder:

xxxxxxxx

A Corvette with a Mopar starter is not a Dodge.

Did you know that you can make Linux boot from the DOS command line? it was a common practice about a decade ago, back when HDs were still small, for a lot of people to install distros like Slackware on a DOS partition and then start it with a DOS command. You can do the same with BeOS, or, really, any OS. Once you get its kernel in memory, it takes over. This is what Windows 9x did. DOS booted the machine, then loaded the Windows kernel. The difference is that 9x simply did not unload the DOS kernel from memory if memory serves.

If you start Linux or Be from DOS, does that mean that they're "using a DOS kernel"? No.



I can see your point, you can boot Windows from Linux but it doesn't mean you're using a Linux kernel even if you did still leave it in memory.

 
quote:
Originally posted by JimmyJames: GenSTEP Founder:

Stop going around flaming people



I wasn't "flaming" anyone, you're the one who started "flaming"

 
quote:
Originally posted by JimmyJames: GenSTEP Founder:

 because they're right.

edit: Thank you Anphanax, BTW.



Whatever.

Oh and by the way...
Jimmy, I always read your posts, in future if you have not read a post properly, then just don't reply to it.

[ July 27, 2004: Message edited by: Aloone ]

This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #4 on: 27 July 2004, 19:49 »
No one can prove this either way with out looking at the Windows source code.

Windows might just use DOS as a boot loader.

Windows might still secretly call DOS interrupts.

The CON\CON exploit  might be evidence of Windows calling DOS, or it could be just an example of very bad error handling or even both.

Windows definitely does leave DOS in memory because if you installed DOS drivers in the config.sys and autoexec.bat they were still available in a dos box.

I beleve that Win95B and below did call int 21h. I don't know about 98+ though.

We might be able to prove this by hooking int 21h before Windows boots, but for all we know Windows could just restore it, and even if Windows does, it dosn't mean that it uses it.

[ July 27, 2004: Message edited by: Aloone ]

This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

anphanax

  • Member
  • **
  • Posts: 197
  • Kudos: 11
    • http://june.tripod.com
MS-DOS/9x Kernel Inaccuracy.
« Reply #5 on: 27 July 2004, 20:22 »
The con, aux, nul, prn, lpt1-lpt3 thing exists in NT as well. If you don't believe me, open cmd.exe and try opening CON in EDIT. It caused the "DOS" window to hang.

It could be that those are just some special named pipes and are kept for compatibility, and for batch files ("nul" is nice when you don't want things to be displayed). I base that belief off of the information I found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/createnamedpipe.asp

[ July 27, 2004: Message edited by: anphanax ]


Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #6 on: 27 July 2004, 22:44 »
This behaviour seems to be very inconsistent.

EDIT.EXE
Reading CON causes it to crash, and saving just  causes an error, it doesn't crash.

QBASIC.EXE /EDIT
This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

WMD

  • Global Moderator
  • Member
  • ***
  • Posts: 2,525
  • Kudos: 391
    • http://www.dognoodle99.cjb.net
MS-DOS/9x Kernel Inaccuracy.
« Reply #7 on: 27 July 2004, 23:39 »
The Windows kernel had "protected mode," but it was the fakest protected mode in existence.  Also, if you loaded 16-bit drivers for anything, the DOS kernel kept control of that stuff - hence, why MS didn't want you to use them in 9x.
My BSOD gallery
"Yes there's nothing wrong with going around being rude and selfish, killing people and fucking married women, but being childish is a cardinal sin around these parts." -Aloone_Jonez

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
MS-DOS/9x Kernel Inaccuracy.
« Reply #8 on: 28 July 2004, 05:40 »
quote:
Originally posted by anphanax:
Windows 9x only used Microsoft DOS as a bootloader.

EDIT:
I didn't make this post to attack anyone in general, or to defend Microsoft Windows. I made this because I believe people saying that MS-DOS and Windows are basically the same thing kernel-wise is factually incorrect, and if anything, that hurts them in an argument against the product.




Saying that the kernels are basically the same thing is not the opposite of saying that DOS is only a bootloader.  

The Caldera vs. Microsoft lawsuit (the "DR-DOS" lawsuit) many years ago revealed that, while the two kernels are different, the win95 kernel did make calls to the DOS kernel.
In brightest day, in darkest night, no evil shall escape my sight....

Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #9 on: 28 July 2004, 14:45 »
That makes sense to me, WinDOS didn't have a DOS kernel but it called the DOS kernel for certain things like file IO. This would explain the behaviour of my old virus scanner.

I wonder if WinDOS will boot from FreeDOS or even DOSEMU under Linux.
This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

WMD

  • Global Moderator
  • Member
  • ***
  • Posts: 2,525
  • Kudos: 391
    • http://www.dognoodle99.cjb.net
MS-DOS/9x Kernel Inaccuracy.
« Reply #10 on: 29 July 2004, 12:21 »
quote:
Originally posted by Aloone:
I wonder if WinDOS will boot from FreeDOS or even DOSEMU under Linux.


I've seen people get similar things working...like loading WinDOS 95 (btw, I like that name  :D ) from MS-DOS 6.x.  No idea about FreeDOS, and DOSEMU in Linux is just a FreeDOS kernel anyway.
My BSOD gallery
"Yes there's nothing wrong with going around being rude and selfish, killing people and fucking married women, but being childish is a cardinal sin around these parts." -Aloone_Jonez

Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
MS-DOS/9x Kernel Inaccuracy.
« Reply #11 on: 29 July 2004, 16:14 »
I've heard many other programs used their own mini OS kernel rather than DOS. DOOM didn't use the DOS keyboard drivers and the buit in DPMI handled memory management and disk swapping, I think it used the mouse driver loaded in the autoexec.bat though. Virtual 3D pool didn't even use the mouse driver it had it's own!

I think all programs (including WinDOS) called DOS for file IO.

Can anyone else think of any DOS software that hardly used the DOS kernel?

[ July 29, 2004: Message edited by: Aloone ]

This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu:

anphanax

  • Member
  • **
  • Posts: 197
  • Kudos: 11
    • http://june.tripod.com
MS-DOS/9x Kernel Inaccuracy.
« Reply #12 on: 30 July 2004, 01:14 »
Actually, I was wrong when I said MS-DOS is only used as a bootloader, because it's likely there are calls to DOS.

I base that belief off of some behavior in NT.
WriteFile(...) in Kernel32 Invokes
NtWriteFile(...) in NtDll Invokes
Int 2Eh to switch OS modes (From user to native kernel) and then NTOSKRNL.EXE ends up doing the work.

It's more than possible the 9x kernel ended up invoking DOS interrupts to do it's work for it. That might explain some oddities (e.g. Trying Typing "Krnl386 Con" in command.com, and watch as errors start occuring in Kernel32.dll for no apparent reason [Explorer.exe, Msgsvr32.exe, etc]).

I guess one could argue:
9x Kernel <-> IO.SYS
NT Kernel <-> NTOSKRNL.EXE (there are multiple versions of this file with slightly different names e.g. NTKRNLPA.EXE)

UPDATE:
The reason I associated the shell /w the kernel, is because in MS-DOS, they sort-of complement each other. There's a special interrupt reserved for passing commands to command.com. That doesn't make it the kernel though, so I fixed this post. But complemeting, and being the same thing, are of course, different, so this post has been fixed.

[ August 11, 2004: Message edited by: anphanax ]


hm_murdock

  • VIP
  • Member
  • ***
  • Posts: 2,629
  • Kudos: 378
  • The Lord of Thyme
MS-DOS/9x Kernel Inaccuracy.
« Reply #13 on: 1 August 2004, 02:35 »
9x kernel would be io.sys

command.com is just a command interpreter, like BASH
Go the fuck ~

billy_z

  • Newbie
  • *
  • Posts: 3
  • Kudos: 0
MS-DOS/9x Kernel Inaccuracy.
« Reply #14 on: 6 August 2004, 13:30 »
okay... seems like those claim win9x do not have DOS never learn assembly language.

Window3.0/3.1/95/98/ME all uses DOS kernel.

I write program under DOS and windows9x.  If I load something in memory in DOS first(a TSR), and boot into windows9x, it is still there!! I still can call interrupt from the DOS program!

And, calling any interrupt (21h) is not the "windows way".  In win32 document, it did not mention anything about interrupt.  everything is wraped in API.  

if you load something in DOS and boot into lunix, will you be able to call it??

those try to confuse bootloader and kernel sure do not have any idea what they talking about.... In fact, a boot loader has a mini-kernel that handles IO and memory.