Bona Fide OS Developer
View unanswered posts | View active topics It is currently Sun Aug 25, 2019 4:23 pm



Post new topic Reply to topic  [ 2 posts ] 
 Guys, i'm starting my new operating system now,,but 
Author Message

Joined: Sat Sep 26, 2009 4:29 am
Posts: 15
Location: Philippines
Post Guys, i'm starting my new operating system now,,but
how can I talk to disk controllers in pm?


Sat Sep 26, 2009 5:01 am
Profile

Joined: Tue Aug 04, 2009 12:44 pm
Posts: 11
Post 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.


Mon Sep 28, 2009 6:12 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.