Bona Fide OS Development
http://forums.osdever.net/

Guys, i'm starting my new operating system now,,but
http://forums.osdever.net/viewtopic.php?f=4&t=29
Page 1 of 1

Author:  prinzrainer [ Sat Sep 26, 2009 5:01 am ]
Post subject:  Guys, i'm starting my new operating system now,,but

how can I talk to disk controllers in pm?

Author:  rene [ Mon Sep 28, 2009 6:12 pm ]
Post subject:  Re: Guys, i'm starting my new operating system now,,but

For PATA (IDE) or Floppy disk controllers you can do that by two ways: DMA (Direct Memory Access - more advanced to program) or programmed I/O (PIO), this last is more easy to program and basically consists of send and receive byte, word or double words to the device through processor instructions IN and OUT. Each device have and specific address of the I/O memory, so for example, one of the PATA controller registers is addressed at 0x3F6. So, the instruction:

Code:
INB $0x3f6,%eax


will read the value of PATA controller status register to the EAX register. Of course devices follow a specific protocol to work. So PATA controller follow the ATA specification, which means that you need to send/receive the correct values to registers to get device working (and much ore things). Look at http://wiki.osdev.org/ATA_PIO_Mode, perhaps help you.

Note that PIO uses processor instructions, which makes him much more slowly that DMA.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/