VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Does the 16-bit windows 3.0 kernel use CPU features the 32-bit windows 3.0 kernel doesn't?

Somehow, the 386 kernel boots just fine in my x86 emulator, while the /s standard mode boot crashes (triple faults) executing a call to segment 0 in protected mode, which shouldn't happen (from segment 51h, so at privilege level 1)?

It seems somehow related to the protected mode changes I implemented recently (all protected mode mechanics using the BIU instead of direct memory accesses), but all testsuites I run tell me the implementation is fine (checking pretty much any protected mode feature of the 386 that's documented in the programmer's reference manual)?

Edit: From what I can tell, that selector 51h is supposed to maybe be the first loaded protected mode driver or something like that? The first time I see it entering protected mode, it jumps to a fixed address, from where various segment registers are setup, the LDTR is loaded (with base 110000h), after which a jump to the 51h selector is performed? So what is this 51h selector loaded program (that's faulting on an invalid CALL instruction with a NULL segment selector (literally jumping to 0:FFFFh))?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 2, by jakethompson1

User metadata
Rank l33t
Rank
l33t

I don't have the background to answer the details, but just some things to note: per Undocumented Windows (there's a pdf out there) pp .189-190, on 3.1, krnl386 is used if you have an 80386 even in standard mode; all that changes is whether DOSX (standard) or WIN386 (enhanced) is the DOS-extender. It suggests that on 3.0, krnl286 was used for standard mode on either type of processor.

Unauthorized Windows 95, which I don't have nearby and there is no PDF online, has some tricks in it with using WIN386 and apparently DOSX https://www.geoffchappell.com/notes/dos/inter … 6h/pmswitch.htm to load something other than Windows, but that may be assuming the 3.1 version which returns to real mode before executing Windows, expecting Windows to call DPMI services to get back into protected mode.

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++

I do see it running part of the startup code a few times before crashing.
It starts out with some far jump (probably directly after loading CR0's protected mode bit), followed by loading some constants into the segment registers and setting up the stack, before some JMP or IRET to segment 51. It happens a few times, eventually reaching the jump/call to segment 0, which triple faults the emulated CPU. I think I even saw an INT 21h in there.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io