VOGONS


Reply 20 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just found some little bit of interesting information on the 8042: http://halicery.com/8042/8042_INTERN_TXT.htm

It describes the exact clock signalling and functionality of the 8042(how it handles the host reads/writes etc.). It also explains something the osdev article on the 8042 doesn't: The exact clock signal used by the chip(clock and data lines connected to the PS/2 keyboard, as well as the (hidden) support for XT keyboards! ). The osdev article(http://wiki.osdev.org/%228042%22_PS/2_Controller) doesn't even mention that information.

It also explains the way the ports are used by the controller, thus explaining the communication between the CPU and the 8042(which the osdev article only explains as a bare minimal).

Although, in my case, my 8042 controller commands, parameter and results(of the controller itself) now act like they're from the keyboard, thus timing it's input and output based on the PS/2 keyboard/mouse clock itself(instead of handling it internally). This has the benefit of using the emulated input/output buffers for the 8042 itself(thus making it fully software-compatible for software relying on it).

One thing I've changed, though, is the way the Compaq status register is read: instead of directly giving the resulting status register bits that are stored, it will now use a simple mask(which can mask any bits off) to simulate the 8042 output buffer full bit not reporting 1 when using the "special reed" command(which masks bit 0 off. Reading the byte from the buffer masks it back on, as well as any command byte sent).

The special reed command is also known as the Load security(A5h) command on the AT and PS/2 devices(loads data into the data port to load a password for comparing or storage).

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

Reply 21 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've added a little functionality to the emulator to support XT/AT/COMPAQ text files in the ROM directory that contain translations of the POST code into a readable description.

Filename
POSTCODE.COMPAQ.txt
File size
5.04 KiB
Downloads
63 downloads
File comment
Compaq POST diagnostic code translations.
File license
Fair use/fair dealing exception

This results in the following log(formatted 2 hex digits, followed by a space, followed by the description to log, followed by carriage return-linebreak(Windows CR/LF line break combination)):

Filename
debugger.log
File size
6.43 KiB
Downloads
40 downloads
File comment
Log containing the currently generated POST codes based on the POSTCODE.COMPAQ.TXT in the ROM directory.
File license
Fair use/fair dealing exception

That would make looking up the tables a little less difficult(since you can actually see what it's doing). I've copied the first table from http://ryan.servehttp.com/tech/hardware/bios/compaqbios.htm to create the file. It also lists "Compaq 386 Deskpro BIOS Post Codes", but those can't be correct? I/O ROM error and System memory board failure immediately after powering on the CPU and initializing the basics(and continuing on)? So that block is probably incorrect?

Anyone can see what's going wrong?

Last edited by superfury on 2017-06-08, 18:20. Edited 2 times in total.

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

Reply 22 of 31, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie
superfury wrote:

I've copied the first table from http://ryan.servehttp.com/tech/hardware/bios/compaqbios.htm to create the file.

That page does not work for me. All I get is a nginx error.

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 23 of 31, by superfury

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

I've copied the first table from http://ryan.servehttp.com/tech/hardware/bios/compaqbios.htm to create the file.

That page does not work for me. All I get is a nginx error.

Strange: I get:

Compaq General BIOS Post Codes 00 Initialize flags, MSW,IDTLIN 01 Read manufacturing jumper 02 8042 received read com […]
Show full quote

Compaq General BIOS Post Codes
00 Initialize flags, MSW,IDTLIN
01 Read manufacturing jumper
02 8042 received read command
03 No response from 8042
04 Look for ROM at E000
05 Look for ROM at C800
06 Normal CMOS reset code
08 Initialize 8259,80287
09 Reset code in CMOS byte
0A Vector vis 40:67 reset function
0B Vector vis 40:67 with E01 function
0C Boot reset function
0D Test #2 8254 PIT counter 0
0E Test #2 8254 PIT counter 2
0F Warm boot
10 PPI disabled, test 8254 PIT's 0 and 1
11 Initialize (blast) VDU controller
12 Clear screen; turn ON video
13 Test time 0
14 Disable RTC interrupts
15 Check battery power
16 Battery has lost power
17 Clear CMOS Diags.
18 Test base memory (First 128K)
19 Initialize base memory
1A Initialize VDU adapters
1B The system ROM
1C CMOS checksum
1D DMA controller/page registers
1E Test keyboard controller
1F Test 286 protected mode
20 Test real and extended memory
21 Initialize time-of-day
22 Initialize 287 coprocessor
23 Test the keyboard and 8042
24 Reset A20, set default CPU speed
25 Test diskette subsystem
26 Test fixed disk subsystem
27 Initialize parallel printer
28 Perform search for optional ROM's
29 Test valid system configuration
2A Clear screen
2B Check for invalid time and date
2C Optional ROM search
2D Test timer 2
2F Write to diagnostic byte
30 Clear first 128K bytes of RAM
31 Load interrupt vectors 70-77
32 Load interrupt vectors 00-1F
33 Initialize MEMSIZE and RESETWD
34 Verify CMOS checksum
35 CMOS checksum is not valid
36 Check battery power
37 Check for game adapters
38 Check for Serial ports
39 Check for parallel printer ports
3A Initialize port and comm time-outs
3B Flush keyboard buffer
40 Save RESETWD value
41 Check RAM refresh
42 Start write of 128K RAM test
43 Reset parity checks
44 Start verify of 128K RAM test
45 Check for parity errors
46 NO RAM errors
47 RAM error detected
50 Check for dual frequency in CMOS
51 Check CMOS VDU configuration
52 Start VDU ROM search
53 Vector to VDU option ROM's
54 Initialize first display adapter
55 Initialize second display adapter
56 No display adapters installed
57 Initialize primary VDU mode
58 Start of VDU test (each adapter)
59 Check existence of adapter
5A Check VDU registers
5B Start screen memory test
5C End test of adapter, clear memory
5D Error detected on an adapter
5E Test the next adapter
5F All adapters successfully tested
60 Start of memory tests
61 Enter protected mode
62 Start memory sizing
63 Get CMOS size
64 Start test of real memory
65 Start test of extended memory
66 Save size memory (base, ext)
67 128K-option installed CMOS bit
68 Prepare to return to real mode
69 Back in real mode-successful
6A Protected mode error during test
6B Display error message
6C End of memory test
6D Initialize KB OK string
6E Determine size to test
6F Start MEMTEST
70 Display XXXXXKB OK
71 Test each RAM segment
72 High order address test
73 Exit MEMTEST
74 Parity error on bus
75 Start protected mode test
76 Prepare to enter protected mode
77 Test software exceptions
78 Prepare to return to real mode
79 Back in real mode-successful
7A Back in real mode-error occurred
7B Exit protected mode
7C High order address test failure
7D Entered cache controller test
7E Programming memory cache
7F Copy system ROM to high RAM
80 Start of 8042 test
81 Do 8042 self test
82 Check result received
83 Error result
84 OK 8042, Init mode=5D
86 Start test, reset keyboard
87 Got acknowledge, read result
88 Got result, check it
89 Test for stuck keys
8B Test keyboard interface
8A Key seems to be stuck
8C Got result, check it
8D End of test, no errors
90 Start of CMOS test
91 CMOS seems to be OK
92 Error on CMOS read,write test
93 Start of DMA controller test
94 Page registers seem to be OK
95 DMA controller is OK
96 8237 initialization is complete
97 Start of NCA RAM test
A0 Start of diskette tests
A1 FDC reset active (3F2h Bit 2)
A2 FDC reset inactive (3F2h Bit 2)
A3 FDC motor on
A4 FDC time-out error
A5 FDC failed reset
A6 FDC passed reset
A8 Start to determine drive type
A9 Seek operation initialized
AA Waiting for FDC seek status
AF Diskette tests complete
B0 Start of fixed drive tests
B1 Combo board not found-exit
B2 Combo controller failed-exit
B3 Testing drive 1
B4 Testing drive 2
B5 Drive error (error condition)
B6 Drive failed (failed to respond)
B7 No fixed drives-exit
B8 Fixed drive tests complete
B9 Attempt to boot diskette
BA Attempt to boot fixed drive
BB Boot attempt failed FD/HD
BC Jump to boot record
BD Drive error, retry booting
BE Weitek coprocessor test
D0 Entry to clear memory routine
D1 Ready to go to protected mode
D2 Ready to clear extended memory
D3 Ready to reset back to real mode
D4 Back in real mode
D5 Clear base memory
DD Built-in self-test failed
E0 Ready to replace E000 ROM
E1 Completed E000 ROM replacement
E2 Ready to replace EGA ROM
E3 Completes EGA ROM replacement
Compaq 286 Deskpro BIOS Post Codes
01 Central processing unit
02 Coprocessor
02 Direct memory access
04 Interrupt controller
05 Port 61
06 Keyboard controller
07 CMOS
08 CMOS
09 CMOS
10 Programmable timer
11 Refresh detect test
12 Speed test
14 Speaker test
21 Memory read/write
24 Memory address
25 Walking I/O
31 Keyboard short test
32 Keyboard long test
33 Keyboard LED test
35 Security lock test
41 Printer failed
42 Printer date, interrupt
43 Printer pattern test
48 Printer failed
51 VDU controller test
52 VDU controller test
53 VDU attribute test
54 VDU character set test
55 VDU 80 x 25 mode
56 VDU 80 x 25 mode
57 VDU 40 x 25 mode
60 Diskette drive ID test
61 Format
62 Read test
63 Write/read compare test
64 Random seek
65 ID media test
66 Speed test
67 Wrap test
68 Write protect test
69 Reset controller test
Compaq 386 Deskpro BIOS Post Codes
01 I/O ROM error
02 System memory board failure
12 System option error
13 Time and date not set
14 Memory size error
21 Memory error
23 Memory address error
25 Memory error
26 Keyboard error
33 Keyboard controller error
34 Keyboard or system unit error
41 Printer error
42 Monochrome adapter failure
51 Display adapter failure
61 Diskette controller failure
62 Diskette boot recorder error
65 Ext. FDC failed got to internal F
6A Floppy port address conflict
6B Floppy port address conflict
72 Coprocessor detection
Compaq 486 Deskpro BIOS Post Codes
01 CPU test failed
02 Coprocessor or Weitek error
03 DMA page registers
04 Interrupt controller master
05 Port 61 error
06 Keyboard controller self test
07 CMOS RAM test failed
08 CMOS interrupt test failed
09 CMOS clock load data test
10 Programmable timer
11 Refresh detect test failed
12 Speed test slow mode out of range
13 Protected mode test failed
14 Speaker test failed
16 Cache memory configuration
19 Installed devices test
21 Memory machine ID test failed
22 Memory system ROM checksum
23 Memory read/write test failed
24 Memory address test failed
25 Walking I/O test failed
26 Increment pattern test failed
31 Keyboard short test, 8042
32 Keyboard long test failed
33 Keyboard LED test, 8042
34 Keyboard typematic test failed
41 Printer failed or not connected
42 Printer data register failed
43 Printer pattern test
48 Printer not connected
51 Video controller test failed
52 Video memory test failed
53 Video attribute test failed
54 Video character set test failed
55 Video 80 x 25 mode
56 Video 80 x 25 mode
57 Video 40 x 25 mode test failed
58 Video 320 x 200 mode color set 1
59 Video 320 x 200 mode color set 1
60 Diskette ID drive types test
61 Diskette format failed
62 Diskette read test failed
63 Diskette write, read, random seek
65 Diskette media ID failed
66 Diskette speed test failed
67 Diskette wrap test failed
68 Diskette write protect test
69 Diskette reset controller test
82 Video memory test failed
84 Video adapter test failed
Compaq Video BIOS Post Codes
00 Entry into video ROM
01 Test alternate adapters
02 Perform vertical sync tests
03 Perform horizontal sync tests
04 Perform static system tests
05 Perform bug tests
06 Peform configuration tests
07 Perform alternate ROM tests
08 Run color gun off tests
09 Run color gun on tests
0A Test video memory
0B Check that adapter board is present
10 Error...illegal configuration
20 Error...no vertical sync present
21 Error...vertical sync out of range
30 Error...no horizontal sync present
40 Error...color register failure
50 Error...slot type conflict failure
51 Error...video memory conflict error
52 Error...ROM conflict error
60 Error...red DAC stuck low
61 Error...green DAC stuck low
62 Error...blue DAC stuck low
63 Error...DAC stuck high
64 Error...red DAC fault
65 Error...green DAC fault
66 Error...blue DAC fault
70 Error...bad alternate ROM version
80 Error...color gun stuck on
90 Error...color gun stuck off
A0 Error...video memory failure
F0 Error...equipment failure
00 Video POSY complete
Compaq System Post Messages
101 Option ROM Error
102 System board failure
103 System board failure
162 System options not set
163 Time and date not set
164 Memory size error
183 Invalid processor jumper setting
201 Memory error
202 Memory type mismatch
207 ECC corrected single bit errors in DIMM/SIMM pair(s)
213 Incompatible DIMM module in DIMM socket(s)
301 Keyboard error
304 Keyboard or system unit error
401 Parallel port 1 address assignment conflict
403 Parallel port 3 address assignment conflict
404 Parallel port address conflict detected
410 Audio interrupt conflict
411 Network interface card interrupt conflict
501 Display adapter failure
601 Diskette controller error
602 Diskette boot record error
605 Diskette drive type error
610 External storage device failure
611 Primary floppy port address assignment conflict
612 Secondary floppy port address assignment conflict
660 Display cache is detected unreliable
912 Computer cover has been removed since last system startup
914 Hood lock coil is not connected
916 thermal sensor from processor heatsink is not connected
917 Expansion riser not detected
1151 Serial port 1 address conflict detected
1152 Serial port 2 address conflict detected
1155 Serial port address detected
1201 System audio address conflict detected
1202 MIDI port address conflict detected
1203 Game port address conflict detected
1720 SMART hard drive detects imminent failure
1721 SMART SCSI hard drive detects imminent failure
1771 Primary disk port address assignment conflict
1772 Secondary disk port address assignment conflict
1780 Disk 0 failure
1781 Disk 1 failure
1782 Disk controller failure
1790 Disk 0 failure
1791 Disk 1 failure
1792 Secondary disk controller failure
1793 Secondary controller or disk failure
1800 Temperature alert
1801 Processor not supported by ROM BIOS

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

Reply 24 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

I think I've found the problem: It's supposed to set the POST flag in the 8042 status register at checkpoint 78h, but fails for some reason, causing the CMOS value(06h) to be ignored and a full reset to occur(since the POST flag is 0 according to the value read from the register). Now the question: why isn't the 8042 status/command register(RAM address 0) bit 2 set(which is the value of the RAM byte 0 bit 2(POST flag)).

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

Reply 25 of 31, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

Here is what I get:

Attachments

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 26 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

Strange: it's arriving in my browser(Google Chrome). I've found an error sending the data from the 0x20(Read RAM byte 0) command: the port60tofirstPS2port(sending it back as a reply) is still set(supposed to be cleared). I've modified the code to clear it when using it correctly now. Now testing...

Edit: It's continuing to POST again! 😁

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

Reply 27 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

Yay! It's continuing on, until the RESUME = "F1" key! 😁 I'm getting a 301-Keyboard error and "162-System Options Not Set-(Run Setup)<Next line same base column as System>Insert DIAGNOSTIC diskette in Drive A:, though. 😁

Edit: After pressing F1 I get a clearscreen and a date/time(don't remember 100% if date as well) not set. After that, the screen clears again and the XT-IDE AT BIOS tries to boot the hard disk(fails with an error 1, probably either an unbootable disk or no disk inserted. I'll have to check again tomorrow.

Anyway, it's finally working(although a keyboard error is probably the cause of the PS/2 keyboard itself, for some still unknown reason). 😁

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

Reply 28 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

The message just before the XT-IDE BIOS takes over is 163-Date&Time not set.

The XT-IDE BIOS tries to boot drive R:(should be C instead of R?) Errors out with error 1h, proceeds with booting floppy(which fails due to no disk inserted), then reboots.

The inserted disk is a 20MB windows 3.0 harddisk(primary master C:) and 100MB AT harddisk(primary slave D:). Secondary master/slave are CD-ROM drives.

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

Reply 29 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

It has the same problem on the AT. It might simply be a corrupted ROM, though(it shouldn't be trying to boot drive 'R' instead of 'C'). It would need to be investigated further.

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

Reply 30 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've found a little problem in the 8042 emulation command switch cases missing 0xD1 command break(which continued into the 0xD2 command case, due to the missing break call). That fixed the 8042 itself. Then I still needed to fix the PS/2 keyboard reset command, which was clearing all data, losing track of it's second timeout(first a timeout on the 0xFA result, then a timeout on the 0xAA result. Since the 0xFA result was clearing all status(although setting some of the data again), it lost the currently executing command byte(0xFF), thus the second byte resulting in 0xFE being added into the buffer instead of 0xFA. This caused the BIOS to think the hardware wasn't correct and print a keyboard error.

Having fixed these two bugs, the Compaq Deskpro 386 BIOS now boots without any errors with 4MB installed RAM(+reserved RAM)(except uninitialized CMOS, which needs the Compaq floppy disk software to fix):

370-Compaq Deskpro 386 4MB memory no errors.jpg
Filename
370-Compaq Deskpro 386 4MB memory no errors.jpg
File size
18.29 KiB
Views
798 views
File comment
Compaq Deskpro 386 starting with no errors(except BIOS settings not setup yet).
File license
Fair use/fair dealing exception

Then the error message that the date/time isn't set yet.

Filename
371-Compaq Deskpro 386 4MB memory message before XT-IDE AT BIOS starts.jpg
File size
8.76 KiB
Downloads
No downloads
File comment
Date/Time not set before starting the hard disk BIOS(int19) bootstrap.
File license
Fair use/fair dealing exception

So it's booting correctly now:D Still need to check on the IBM AT emulation, though(it will probably work better now too).

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

Reply 31 of 31, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just implemented a bit of extra logic with Unreal mode compatibility(Not raising #SS/#NP when descriptor cache doesn't having it's present bit set, instead causing a #GP(which is compliant with the specs, as well as with the pseudo-protection faults in real mode(it doesn't have #NP after all)).

I've also implemented some more loading logic to Virtual 8086 mode, which loads the unused segment descriptor cache(Access rights, Limit low and CallGate base mid(which contains various fields that shouldn't be used in Virtual 8086 mode)) with real-mode compatible default values. That should fix problems left when it switches to virtual 8086 mode with those fields loaded(which aren't loaded in real mode(except with LOADALL/unreal mode, which can't be used from Virtual 8086 mode anyway)).

Edit: Now I still need to apply the diagnostic disk(720K version), which I've just generated with Virtualbox using a MS-DOS 5.0 boot disk(removed all files except COMMAND.COM, IO.SYS and MS-DOS.SYS), then copied the file from the zip file into that disk and using Virtualbox to mount an empty 720K image(createn with Winimage, although UniPCemu can create it without problems as well(non-bootable disk, with my custom minimal boot loader on it)), then extracting the file by executing it, finally executing the generated file to write the 720K floppy itself. Now I have the Compaq Diagnostics disk.

It doesn't seem to boot correctly, maybe still something going wrong with my floppy disk emulation, somehow(or something the BIOS relies on)? It's emulating a simple 82077AA floppy disk controller.

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