qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Help me about the FDC


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Help me about the FDC
Date: Wed, 22 Feb 2012 08:59:29 +0000

On Wed, Feb 22, 2012 at 6:16 AM, Zhi Hui Li <address@hidden> wrote:
> 1: explain the difference between :
>
>    type_register_static(&isa_fdc_info);
>    type_register_static(&sysbus_fdc_info);
>    type_register_static(&sun4m_fdc_info);

The floppy disk controller is used by several different targets,
including x86 PC, SPARC, and others.  Look at the TypeInfo
declarations for isa_fdc_info and the others to see how they differ.

For example the sun4m (SPARC) fdc sets up an memory-mapped I/O (MMIO)
region and an interrupt.  The isa (PC) fdc sets up programmed I/O
(PIO) and an interrupt.

Basically, both sun4m and PCs have similar fdc hardware but the
hardware registers are mapped to different places.  This is why there
are different setup functions to make sure the MMIO, PIO, and/or
interrupts are set up for a specific target.

> 2: explain the struct of FDCtrl;

FDCtrl is the main struct for an emulated floppy disk controller.  In
order to understand it you need to know how the floppy disk controller
behaves, what hardware registers it has, etc.

You need to read the floppy disk controler hardware datasheet first
before looking at QEMU device emulation code - otherwise you will not
know what QEMU is trying to emulate :).

This leads to your next question...

> 3: or give me some introduce of FDC.

Start here:

http://en.wikipedia.org/wiki/Floppy_disk_controller
http://wiki.osdev.org/Floppy_Disk_Controller

Then look at the datasheet:

http://wiki.qemu.org/images/f/f0/29047403.pdf

Learn how the device is supposed to operate first, then the QEMU
device emulation code will make sense.

I suggest getting an overview of how the device works without learning
all the hardware register details.  Then read the datasheet for
details on those parts of the device that you will need to modify -
there's probably too much information to learn everything about the
device, just focus on what you need.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]