From 3988f6fa45faf7d2782cfd8f674f6b3c1917fd15 Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Fri, 12 Jun 2020 19:18:28 +0300 Subject: [PATCH 1/5] Added the Acer V60N An i686 Acer BIOS board. Works as intended --- src/cpu_common/cpu.c | 29 +++++++++++++++++++++++++++++ src/include/86box/machine.h | 1 + src/machine/m_at_socket8.c | 31 +++++++++++++++++++++++++++++++ src/machine/machine_table.c | 1 + 4 files changed, 62 insertions(+) diff --git a/src/cpu_common/cpu.c b/src/cpu_common/cpu.c index e29099c46..67fa82234 100644 --- a/src/cpu_common/cpu.c +++ b/src/cpu_common/cpu.c @@ -60,6 +60,7 @@ # include "codegen.h" #endif +/* #define ENABLE_CPU_LOG 1 */ static void cpu_write(uint16_t addr, uint8_t val, void *priv); static uint8_t cpu_read(uint16_t addr, void *priv); @@ -195,6 +196,7 @@ uint64_t apic_base_msr = 0; uint64_t pat_msr = 0; uint64_t msr_ia32_pmc[8] = {0, 0, 0, 0, 0, 0, 0, 0}; uint64_t ecx17_msr = 0; +uint64_t ecx2a_msr = 0; uint64_t ecx79_msr = 0; uint64_t ecx8x_msr[4] = {0, 0, 0, 0}; uint64_t ecx116_msr = 0; @@ -204,6 +206,9 @@ uint64_t ecx186_msr = 0; uint64_t ecx187_msr = 0; uint64_t ecx1e0_msr = 0; uint64_t ecx404_msr = 0; +uint64_t ecx408_msr = 0; +uint64_t ecx40c_msr = 0; +uint64_t ecx410_msr = 0; uint64_t ecx570_msr = 0; uint64_t ecx83_msr = 0; /* AMD K5 and K6 MSR's. */ @@ -2882,6 +2887,18 @@ void cpu_RDMSR() EAX = ecx404_msr & 0xffffffff; EDX = ecx404_msr >> 32; break; + case 0x408: + EAX = ecx408_msr & 0xffffffff; + EDX = ecx408_msr >> 32; + break; + case 0x40c: + EAX = ecx40c_msr & 0xffffffff; + EDX = ecx40c_msr >> 32; + break; + case 0x410: + EAX = ecx410_msr & 0xffffffff; + EDX = ecx410_msr >> 32; + break; case 0x570: EAX = ecx570_msr & 0xffffffff; EDX = ecx570_msr >> 32; @@ -3229,6 +3246,9 @@ void cpu_WRMSR() /* pclog("APIC_BASE write: %08X%08X\n", EDX, EAX); */ // apic_base_msr = EAX | ((uint64_t)EDX << 32); break; + case 0x2A: + ecx2a_msr = EAX | ((uint64_t)EDX << 32); + break; case 0x79: ecx79_msr = EAX | ((uint64_t)EDX << 32); break; @@ -3301,6 +3321,15 @@ void cpu_WRMSR() case 0x404: ecx404_msr = EAX | ((uint64_t)EDX << 32); break; + case 0x408: + ecx408_msr = EAX | ((uint64_t)EDX << 32); + break; + case 0x40c: + ecx40c_msr = EAX | ((uint64_t)EDX << 32); + break; + case 0x410: + ecx410_msr = EAX | ((uint64_t)EDX << 32); + break; case 0x570: ecx570_msr = EAX | ((uint64_t)EDX << 32); break; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 26414ae4e..18ada3e7b 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -324,6 +324,7 @@ extern int machine_at_ax59pro_init(const machine_t *); extern int machine_at_mvp3_init(const machine_t *); /* m_at_socket8.c */ +extern int machine_at_v60n_init(const machine_t *); extern int machine_at_686nx_init(const machine_t *); extern int machine_at_mb600n_init(const machine_t *); extern int machine_at_8500ttc_init(const machine_t *); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index be03a41fb..0e9efc0ce 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -100,6 +100,37 @@ machine_at_mb600n_init(const machine_t *model) return ret; } +int +machine_at_v60n_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/v60n/V60NE5.BIN", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); + device_add(&i440fx_device); + device_add(&piix3_device); + device_add(&keyboard_ps2_pci_device); + device_add(&fdc37c935_device); + device_add(&acerm3a_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} + int machine_at_8500ttc_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index cc32bad64..2ca0718ec 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -283,6 +283,7 @@ const machine_t machines[] = { /* Socket 8 machines */ /* 440FX */ + { "[Socket 8 FX] Acer V60N", "v60n", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_v60n_init, NULL }, { "[Socket 8 FX] Gigabyte GA-686NX", "686nx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_686nx_init, NULL }, { "[Socket 8 FX] PC Partner MB600N", "mb600n", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_mb600n_init, NULL }, { "[Socket 8 FX] Biostar MB-8500ttc", "8500ttc", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_8500ttc_init, NULL }, From 5956d22d06b5c84dde1e416452110d99ff64a81e Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Fri, 12 Jun 2020 19:35:21 +0300 Subject: [PATCH 2/5] Replaced the position of PCI reg 0x0c as it was causing problems if you allocated many PCI cards --- src/machine/m_at_socket8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index 0e9efc0ce..86f04b4aa 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -116,11 +116,11 @@ machine_at_v60n_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_pci_device); From 298d25a6da38ace2d74873af76ba2c0533b48ce6 Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Fri, 12 Jun 2020 20:58:13 +0300 Subject: [PATCH 3/5] Added 2 missing MSR's. Fixes the Tyan Tsunami ATX & SuperMicro P6SBA hate on i686 CPU's --- src/cpu_common/cpu.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/cpu_common/cpu.c b/src/cpu_common/cpu.c index 67fa82234..099658875 100644 --- a/src/cpu_common/cpu.c +++ b/src/cpu_common/cpu.c @@ -60,7 +60,7 @@ # include "codegen.h" #endif -/* #define ENABLE_CPU_LOG 1 */ +/*#define ENABLE_CPU_LOG 1*/ static void cpu_write(uint16_t addr, uint8_t val, void *priv); static uint8_t cpu_read(uint16_t addr, void *priv); @@ -212,6 +212,13 @@ uint64_t ecx410_msr = 0; uint64_t ecx570_msr = 0; uint64_t ecx83_msr = 0; /* AMD K5 and K6 MSR's. */ + +/* Some weird long MSR's used by the Tyan Tsunami ATX */ +/* Will respond with: 0404040404040404. It'll be nice */ +/* If somebody could check them. */ +uint64_t ecxf0f00250_msr = 0; +uint64_t ecxf0f00258_msr = 0; + uint64_t star = 0; /* AMD K6-2+. */ uint64_t amd_efer = 0, amd_whcr = 0, @@ -2903,6 +2910,14 @@ void cpu_RDMSR() EAX = ecx570_msr & 0xffffffff; EDX = ecx570_msr >> 32; break; + case 0xf0f00250: + EAX = ecxf0f00250_msr & 0xffffffff; + EDX = ecxf0f00250_msr >> 32; + break; + case 0xf0f00258: + EAX = ecxf0f00258_msr & 0xffffffff; + EDX = ecxf0f00258_msr >> 32; + break; default: i686_invalid_rdmsr: cpu_log("RDMSR: Invalid MSR: %08X\n", ECX); @@ -3333,6 +3348,12 @@ void cpu_WRMSR() case 0x570: ecx570_msr = EAX | ((uint64_t)EDX << 32); break; + case 0xf0f00250: + ecxf0f00250_msr = EAX | ((uint64_t)EDX << 32); + break; + case 0xf0f00258: + ecxf0f00258_msr = EAX | ((uint64_t)EDX << 32); + break; default: i686_invalid_wrmsr: cpu_log("WRMSR: Invalid MSR: %08X\n", ECX); From 622f34522fff65e25c939536de2a9e157cab7732 Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Fri, 12 Jun 2020 21:01:21 +0300 Subject: [PATCH 4/5] The Tyan & the Supermicro no longer need the incompatible VIA C3. --- src/machine/m_at_slot1.c | 11 +---------- src/machine/machine_table.c | 5 ++--- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 5ab75e47c..dc2a551bb 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -376,13 +376,7 @@ machine_at_atc6310bxii_init(const machine_t *model) int machine_at_p6sba_init(const machine_t *model) -{ - /* - AMI 440BX Board. - doesn't like the i686 CPU's. - 10 -> D3 -> D1 POST. Probably KBC related. - */ - +{ int ret; ret = bios_load_linear(L"roms/machines/p6sba/SBAB21.ROM", @@ -441,9 +435,6 @@ machine_at_p6sba_init(const machine_t *model) int machine_at_tsunamiatx_init(const machine_t *model) { - /* AMI 440BX board. Requires the PC87309 - and doesn't like the i686 CPUs */ - int ret; ret = bios_load_linear(L"roms/machines/tsunamiatx/bx46200f.rom", diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 2ca0718ec..540eeab02 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -283,7 +283,6 @@ const machine_t machines[] = { /* Socket 8 machines */ /* 440FX */ - { "[Socket 8 FX] Acer V60N", "v60n", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_v60n_init, NULL }, { "[Socket 8 FX] Gigabyte GA-686NX", "686nx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_686nx_init, NULL }, { "[Socket 8 FX] PC Partner MB600N", "mb600n", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_mb600n_init, NULL }, { "[Socket 8 FX] Biostar MB-8500ttc", "8500ttc", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_8500ttc_init, NULL }, @@ -308,9 +307,9 @@ const machine_t machines[] = { { "[Slot 1 BX] ABit BF6", "bf6", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 255, machine_at_bf6_init, NULL }, { "[Slot 1 BX] A-Trend ATC6310BXII", "atc6310bxii", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 255, machine_at_atc6310bxii_init, NULL }, #if defined(DEV_BRANCH) && defined(NO_SIO) - { "[Slot 1 BX] Tyan Tsunami ATX", "tsunamiatx", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_SOUND, 8, 1024, 8, 255, machine_at_tsunamiatx_init, at_tsunamiatx_get_device }, + { "[Slot 1 BX] Tyan Tsunami ATX", "tsunamiatx", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"", NULL},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_SOUND, 8, 1024, 8, 255, machine_at_tsunamiatx_init, at_tsunamiatx_get_device }, #endif - { "[Slot 1 BX] Supermicro P6SBA", "p6sba", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 255, machine_at_p6sba_init, NULL }, + { "[Slot 1 BX] Supermicro P6SBA", "p6sba", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"", NULL},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 255, machine_at_p6sba_init, NULL }, /* Slot 2 machines */ /* 440GX */ From 95088eac1d9fe8e56d92f9a717b1b2ea6586deb5 Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Fri, 12 Jun 2020 21:02:37 +0300 Subject: [PATCH 5/5] Added back the missing V60N configuration --- src/machine/machine_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 540eeab02..5c677af47 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -288,7 +288,7 @@ const machine_t machines[] = { { "[Socket 8 FX] Biostar MB-8500ttc", "8500ttc", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_8500ttc_init, NULL }, { "[Socket 8 FX] Micronics M6MI", "m6mi", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 127, machine_at_m6mi_init, NULL }, { "[Socket 8 FX] ASUS P/I-P65UP5 (C-P6ND)", "p65up5_cp6nd", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_p65up5_cp6nd_init, NULL }, - +{ "[Socket 8 FX] Acer V60N", "v60n", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 512, 8, 127, machine_at_v60n_init, NULL }, /* Slot 1 machines */ /* 440FX */