mirror of https://gitee.com/openkylin/qemu.git
updated floppy driver: formatting code, disk geometry auto detect (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@671 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
bc51c5c989
commit
baca51faff
7
hw/pc.c
7
hw/pc.c
|
@ -57,6 +57,7 @@
|
|||
|
||||
int speaker_data_on;
|
||||
int dummy_refresh_clock;
|
||||
static fdctrl_t *floppy_controller;
|
||||
|
||||
static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
|
||||
{
|
||||
|
@ -106,8 +107,8 @@ static void cmos_init(int ram_size, int boot_device)
|
|||
|
||||
/* floppy type */
|
||||
|
||||
fd0 = fdctrl_get_drive_type(0);
|
||||
fd1 = fdctrl_get_drive_type(1);
|
||||
fd0 = fdctrl_get_drive_type(floppy_controller, 0);
|
||||
fd1 = fdctrl_get_drive_type(floppy_controller, 1);
|
||||
|
||||
s->cmos_data[0x10] = 0;
|
||||
switch (fd0) {
|
||||
|
@ -370,7 +371,7 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device,
|
|||
DMA_init();
|
||||
SB16_init();
|
||||
|
||||
fdctrl_init(6, 2, 0, 0x3f0, fd_table);
|
||||
floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
|
||||
|
||||
cmos_init(ram_size, boot_device);
|
||||
}
|
||||
|
|
9
vl.h
9
vl.h
|
@ -186,9 +186,12 @@ void SB16_init (void);
|
|||
#define MAX_FD 2
|
||||
extern BlockDriverState *fd_table[MAX_FD];
|
||||
|
||||
void fdctrl_init (int irq_lvl, int dma_chann, int mem_mapped, uint32_t base,
|
||||
BlockDriverState **fds);
|
||||
int fdctrl_get_drive_type(int drive_num);
|
||||
typedef struct fdctrl_t fdctrl_t;
|
||||
|
||||
fdctrl_t *fdctrl_init (int irq_lvl, int dma_chann, int mem_mapped,
|
||||
uint32_t io_base,
|
||||
BlockDriverState **fds);
|
||||
int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num);
|
||||
|
||||
/* ne2000.c */
|
||||
|
||||
|
|
Loading…
Reference in New Issue