qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Help me about the FDC
@ 2012-02-22  6:16 Zhi Hui Li
  2012-02-22  8:29 ` 陳韋任
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhi Hui Li @ 2012-02-22  6:16 UTC (permalink / raw)
  To: QEMU-devel, Stefan Hajnoczi; +Cc: zhihuili



I am read the code of fdc.c ,

I feel it was difficult to understand.

Can somebody give me some help: thank you very much!


1: explain the difference between :

     type_register_static(&isa_fdc_info);
     type_register_static(&sysbus_fdc_info);
     type_register_static(&sun4m_fdc_info);

2: explain the struct of FDCtrl;

3: or give me some introduce of FDC.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Help me about the FDC
  2012-02-22  6:16 [Qemu-devel] Help me about the FDC Zhi Hui Li
@ 2012-02-22  8:29 ` 陳韋任
  2012-02-22  8:40 ` 陳韋任
  2012-02-22  8:59 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: 陳韋任 @ 2012-02-22  8:29 UTC (permalink / raw)
  To: Zhi Hui Li; +Cc: zhihuili, QEMU-devel, Stefan Hajnoczi

> 3: or give me some introduce of FDC.

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

HTH,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Help me about the FDC
  2012-02-22  6:16 [Qemu-devel] Help me about the FDC Zhi Hui Li
  2012-02-22  8:29 ` 陳韋任
@ 2012-02-22  8:40 ` 陳韋任
  2012-02-22  8:59 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: 陳韋任 @ 2012-02-22  8:40 UTC (permalink / raw)
  To: Zhi Hui Li; +Cc: zhihuili, QEMU-devel, Stefan Hajnoczi

> 2: explain the struct of FDCtrl;

  In order to know what those fields in FDCtrl mean, you might need to read
  ftp://download.intel.com/design/archives/periphrl/docs/29047504.pdf first.
As the comment in hw/fdc.c says, it's Intel 82078 floppy disk controller
emulation.

Regards,
chenwj 

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Help me about the FDC
  2012-02-22  6:16 [Qemu-devel] Help me about the FDC Zhi Hui Li
  2012-02-22  8:29 ` 陳韋任
  2012-02-22  8:40 ` 陳韋任
@ 2012-02-22  8:59 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-02-22  8:59 UTC (permalink / raw)
  To: Zhi Hui Li; +Cc: zhihuili, QEMU-devel, Stefan Hajnoczi

On Wed, Feb 22, 2012 at 6:16 AM, Zhi Hui Li <zhihuili@linux.vnet.ibm.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-22  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22  6:16 [Qemu-devel] Help me about the FDC Zhi Hui Li
2012-02-22  8:29 ` 陳韋任
2012-02-22  8:40 ` 陳韋任
2012-02-22  8:59 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).