VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

How does the BIOS detect the amount of floppy disk drives attached to a floppy disk controller? In my emulator it always detects 4 floppy disk drives, instead of the 2 drives installed (A and B) when port 62&63 contain 0xFF by default, and no drives when 62&63 contain 0x00 by default.

Anyone knows what the correct value should be?

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

Reply 1 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've fixed the problem: For two floppy drives, PPI port 0x62 needs bit 2 set and bit bit 3 cleared (bit 2 meaning 2 floppy disks and bit 3 meaning 3/4 floppy disks when set). Although for some reason all sources of the PPI port 0x62 tell me that it's supposed to be bit 6&7?

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

Reply 2 of 4, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

What? For a real IBM PC5150, it is bits 6&7 (and 0) on port 0x60. But to read the switches instead of keyboard scancode shift register, the port 0x61 bit 7 must be set to one.

0x61&128==0 -> scancode on port 0x60
0x61&128==128 -> SW1 on port 0x60

Reply 3 of 4, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I do not think he is emulating a 5150 but rather a 5160 (XT) hence he needs the port 63 to convey number of floppy disks. Basically you have to be careful what your BIOS is expecting: IBM PC vs IBM PC XT vs IBM PC AT, as they all report floppies differently.

Vlad.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++
vladstamate wrote:

I do not think he is emulating a 5150 but rather a 5160 (XT) hence he needs the port 63 to convey number of floppy disks. Basically you have to be careful what your BIOS is expecting: IBM PC vs IBM PC XT vs IBM PC AT, as they all report floppies differently.

Vlad.

It's indeed a PC XT system (or AT BIOS when a 80286 processor is selected).

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