Changes to add ISA/PCI/VLB versions of 'external' IDE controllers.

This commit is contained in:
waltje
2017-12-16 00:02:13 -05:00
parent 69186cfb54
commit 3a32bda6dc
3 changed files with 83 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of disk controllers.
*
* Version: @(#)hdc.c 1.0.7 2017/11/08
* Version: @(#)hdc.c 1.0.8 2017/12/15
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -94,14 +94,9 @@ static struct {
{ "[ISA] [ESDI] PC/AT ESDI Fixed Disk Adapter", "esdi_at",
&esdi_at_wd1007vse1_device, 0 },
#if 0
{ "[ISA] [IDE] PC/AT IDE Adapter", "ide_isa",
&ide_isa_device, 0 },
{ "[PCI] [IDE] PCI IDE Adapter", "ide_pci",
&ide_pci_device, 0 },
#endif
{ "[ISA] [IDE] PC/XT XTIDE", "xtide",
&xtide_device , 0 },
@@ -117,6 +112,12 @@ static struct {
{ "[MCA] [ESDI] IBM PS/2 ESDI Fixed Disk Adapter","esdi_mca",
&esdi_ps2_device, 1 },
{ "[PCI] [IDE] PCI IDE Adapter", "ide_pci",
&ide_pci_device, 0 },
{ "[VLB] [IDE] PC/AT IDE Adapter", "vlb_isa",
&ide_vlb_device, 0 },
{ "", "", NULL, 0 }
};

View File

@@ -8,10 +8,11 @@
*
* Definitions for the common disk controller handler.
*
* Version: @(#)hdc.h 1.0.3 2017/10/01
* Version: @(#)hdc.h 1.0.4 2017/12/15
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
@@ -38,6 +39,10 @@ extern device_t mfm_at_wd1003_device; /* mfm_at_wd1003 */
extern device_t esdi_at_wd1007vse1_device; /* esdi_at */
extern device_t esdi_ps2_device; /* esdi_mca */
extern device_t ide_isa_device; /* isa_ide */
extern device_t ide_pci_device; /* pci_ide */
extern device_t ide_vlb_device; /* vlb_ide */
extern device_t xtide_device; /* xtide_xt */
extern device_t xtide_at_device; /* xtide_at */
extern device_t xtide_ps2_device; /* xtide_ps2 */

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.21 2017/12/09
* Version: @(#)hdc_ide.c 1.0.22 2017/12/15
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -2426,3 +2426,72 @@ void secondary_ide_check(void)
}
if (!secondary_cdroms) ide_sec_disable();
}
/*
* Initialization of standalone IDE controller instance.
*
* Eventually, we should clean up the whole mess by only
* using device_t units, with configuration parameters to
* indicate primary/secondary and all that, rather than
* keeping a zillion of duplicate functions around.
*/
static void *
ide_sainit(device_t *info)
{
switch(info->local) {
case 0: /* ISA, single-channel */
ide_pri_enable();
ide_bus_master_read = ide_bus_master_write = NULL;
timer_add(ide_callback_pri, &idecallback[0], &idecallback[0], NULL);
break;
case 1: /* VLB, single-channel */
ide_pri_enable();
ide_bus_master_read = ide_bus_master_write = NULL;
timer_add(ide_callback_pri, &idecallback[0], &idecallback[0], NULL);
break;
case 2: /* PCI, single-channel */
ide_pri_enable();
timer_add(ide_callback_pri, &idecallback[0], &idecallback[0], NULL);
break;
}
return(info);
}
/* Close a standalone IDE unit. */
static void
ide_saclose(void *priv)
{
}
device_t ide_isa_device = {
"ISA PC/AT IDE Controller",
DEVICE_ISA | DEVICE_AT,
0,
ide_sainit, ide_saclose, NULL,
NULL, NULL, NULL, NULL,
NULL
};
device_t ide_pci_device = {
"PCI IDE Controller",
DEVICE_PCI | DEVICE_AT,
2,
ide_sainit, ide_saclose, NULL,
NULL, NULL, NULL, NULL,
NULL
};
device_t ide_vlb_device = {
"VLB IDE Controller",
DEVICE_VLB | DEVICE_AT,
1,
ide_sainit, ide_saclose, NULL,
NULL, NULL, NULL, NULL,
NULL
};