Page 1 of 1

Windows 95 design issue?

Posted: Mon Oct 05, 2015 11:44 am
by nkeck72
I have been trying to get Windows 95 to boot on my old Dell Latitude d505 laptop for a while now. Since I do not have a hard drive for the machine, I have enabled USB emulation in the BIOS which makes a USB flash drive appear to be (and pretty much act like) an ATA hard disk. When Windows 95 tries to boot, it just hangs. No "Starting Windows 95...", no safe mode menu, just a blinking cursor. So, when I stepped through the debugger, the instruction that causes it to hang surprised me:
AX=0201 BX=0700 CX=0001 DX=0080 SP=7BD2 BP=7C00 SI=7BD2 DI=052D
DS=0000 ES=0000 SS=0000 CS=0000 IP=7D6C NV UP DI PL NZ NA PO NC
0000:7D6C CD13 INT 13
Upon executing this instruction, the computer seems to read the sector Windows 95 is getting at (the disk activity light blinks) but then the computer immediately freezes, acting as though it hit a HLT with IF=0. An image of the laptop screen with the debugger running is attatched.
Edit: Board will not let me post the image, apparently max file size is 64KiB
Edit Edit: Uploaded in PNG form. :D
Edit Edit Edit: Says PNG is inavlid. :(

Re: Windows 95 design issue?

Posted: Mon Oct 05, 2015 12:06 pm
by nkeck72
For those who are wondering, that was just stepping through the bootsector code when it crashed. IDK if the kernel has any issues.

Also, I am aware of the 2.1 GHz processor speed issue, and the laptop is running at 600MHz. So it isn't the processor. I know that it can't be the hardware, because setup ran and rebooted fine. The reboot after all setup is done (i.e. after setting up username and password, after saving registry info, after final reboot) is when this issue crops up. It also happens on Windows 98 SE, but I haven't run the debugger through it yet. Suggestions?

Edit: I may have the wrong topic here. I just want to know if it is a serious issue, as I was going to use this laptop to test my OS.

Re: Windows 95 design issue?

Posted: Mon Oct 05, 2015 2:18 pm
by Octocontrabass
Windows 95 was never designed to boot from a USB flash drive, so I wouldn't call this a Windows 95 design issue.
nkeck72 wrote:Since I do not have a hard drive for the machine, I have enabled USB emulation in the BIOS which makes a USB flash drive appear to be (and pretty much act like) an ATA hard disk.
Emulation makes the flash drive accessible using INT 0x13. It does not make the disk appear to be an ATA hard disk. In fact, it may not appear as a hard disk at all - many BIOSes will automatically choose between hard disk and floppy disk emulation based on the contents of the flash drive.

How big is the flash drive? Do the contents of the boot sectors make sense? If you replace the boot code (and only the code, none of the data) with something that displays the value of DL and halts, what value does it display?

nkeck72 wrote:Edit: Board will not let me post the image, apparently max file size is 64KiB
You can upload it somewhere else. Try this site. (You don't need to create an account.)

Re: Windows 95 design issue?

Posted: Mon Oct 05, 2015 2:50 pm
by Ready4Dis
Yes, you are emulating a hard drive using int 0x13. This doesn't really do anything for windows as once it loads its own drivers it doesn't use in t0x13 anyways. Also, windows will crap out with to much ram as well (see this http://support.microsoft.com/kb/q253912/)

http://ubuntuforums.org/showthread.php?t=1703888 -> A guide for windows 95 for unbuntu, but the general idea is the same irregardless.

Re: Windows 95 design issue?

Posted: Wed Oct 07, 2015 5:40 pm
by nkeck72
How big is the flash drive?
The flash drive is 3.7 GB formatted with FAT32.
If you replace the boot code (and only the code, none of the data) with something that displays the value of DL and halts, what value does it display?
It displays 0x80, so the first hard disk. I have done testing in DOS, and it appears as drive C:.
Do the contents of the boot sectors make sense?
What exactly do you mean by this question? If you mean it has the 0xAA55 signature and the code looks correct then yes.
Also, windows will crap out with to much ram as well
I have 512MB of RAM in the laptop, I didn't think RAM would really be an issue...

Re: Windows 95 design issue?

Posted: Thu Oct 08, 2015 12:46 am
by Octocontrabass
nkeck72 wrote:
Do the contents of the boot sectors make sense?
What exactly do you mean by this question? If you mean it has the 0xAA55 signature and the code looks correct then yes.
Is the partition table in the MBR correct? Are all of the values in the BPB correct? This includes having sensible values for cylinders, heads, and sectors. I've only seen 255 heads and 63 sectors on flash drives, but I have no idea if all BIOSes use those values.


Since it sounds like the issue might be the BIOS and not Windows, have you tried installing some other OS on the flash drive?

Re: Windows 95 design issue?

Posted: Thu Oct 08, 2015 11:57 am
by Kazinsal
nkeck72 wrote: have 512MB of RAM in the laptop, I didn't think RAM would really be an issue...
Windows 95 will refuse to boot with more than 480 MB of RAM. The memory manager initializes a fixed heap to find the memory in the system, then once it finds the memory in the system, it re-initializes itself in a heap in the found memory. If you have more than 480 megs in the system, it overflows the fixed heap.

Source: http://blogs.msdn.com/b/oldnewthing/arc ... 54640.aspx

Re: Windows 95 design issue?

Posted: Thu Oct 08, 2015 7:21 pm
by psychobeagle12
I'm not sure because it's been a long time, but unless I am much mistaken, Win95 doesn't recognize USB correct? Win95 OSR2.1 and up support USB, but regular Win95 does not. Even Win98 required device drivers be installed for pretty much all flash disks I ever owned. I know you are talking specifically here of the boot process, but the question is isn't this all in vain anyway since once Windows gets to the point where it no longer uses BIOS calls will the whole process not fail anyway? Just a question.

Re: Windows 95 design issue?

Posted: Fri Oct 09, 2015 10:06 am
by Octocontrabass
psychobeagle12 wrote:I'm not sure because it's been a long time, but unless I am much mistaken, Win95 doesn't recognize USB correct? Win95 OSR2.1 and up support USB, but regular Win95 does not.
The initial release of Windows 95 also does not support FAT32, so it must be one of the later versions.
psychobeagle12 wrote:I know you are talking specifically here of the boot process, but the question is isn't this all in vain anyway since once Windows gets to the point where it no longer uses BIOS calls will the whole process not fail anyway?
If no driver can be located for the hard disk, non-NT versions of Windows will continue using the BIOS.

Windows 95 isn't smart enough to recognize a USB device as its boot disk, so if it loads a USB driver, it will crash. However, it is smart enough to recognize when a driver causes a crash (at least during the hardware detection part of the installer), so it will only crash once and then work afterwards.