Recently, I've finished writing multitasking and memory management on my OS (although there are many lack of completeness), and I'm pleased to make my first release on github(https://github.com/dlarudgus20/Clubcos) and go to the next chapter - supporting for hard disk/floppy disk.
I decide to start by hard disk. I search wiki and notice that there are two ones: obsolete ATA PIO Mode, and ATAPI. ATAPI is more preferable, but it seems that PIO mode is recommended for beginners because of its ease.
However, PIO doesn't look so simple, and I should do a lot of things whatever I choose. I don't hate doing a lot of effort, but I wonder if this obsolete one is really worth trying for just studying and getting ready for ATAPI (I think I should go to ATAPI at last although I choose PIO at first time)
Can you give me some advices?
ATA PIO vs ATAPI - Which one should I start?
-
- Member
- Posts: 36
- Joined: Sat Oct 26, 2013 4:14 am
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: ATA PIO vs ATAPI - Which one should I start?
Actually, ATAPI is just for CD drives, the actual descision is between PIO and DMA.
DMA is better to use in most cases, but you'll probably want to also support PIO mode either as a fallback, or just for early init (Iirc, my driver uses PIO to send ATA IDENTIFY, can't remember why it doesn't use DMA for that).
DMA is better to use in most cases, but you'll probably want to also support PIO mode either as a fallback, or just for early init (Iirc, my driver uses PIO to send ATA IDENTIFY, can't remember why it doesn't use DMA for that).
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: ATA PIO vs ATAPI - Which one should I start?
i believe that starting with PIO would be better and easier, but later you may use DMA mode. especially that it's more practical and more effective for performance issues especially when you activate multitasking, but at boot time it's preferable to use PIO mode to load boot files (it's faster).thepowersgang wrote:Actually, ATAPI is just for CD drives, the actual descision is between PIO and DMA.
DMA is better to use in most cases, but you'll probably want to also support PIO mode either as a fallback, or just for early init (Iirc, my driver uses PIO to send ATA IDENTIFY, can't remember why it doesn't use DMA for that).
Re: ATA PIO vs ATAPI - Which one should I start?
ATA (Reading from and writing to a hard drive) is easier than ATAPI (Reading from a CD-ROM).
PIO (Reading one byte at a time) is easier than DMA (Programming the DMA controller to copy a block of data in the background).
So, I would start with reading a single block from a hard drive using ATA and PIO, and once you have that working, write a completely new function to do the same thing using DMA, and then another pair of functions to do the same functionality for CD-ROM.
Just a suggestion.
PIO (Reading one byte at a time) is easier than DMA (Programming the DMA controller to copy a block of data in the background).
So, I would start with reading a single block from a hard drive using ATA and PIO, and once you have that working, write a completely new function to do the same thing using DMA, and then another pair of functions to do the same functionality for CD-ROM.
Just a suggestion.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
-
- Member
- Posts: 36
- Joined: Sat Oct 26, 2013 4:14 am
Re: ATA PIO vs ATAPI - Which one should I start?
Thanks all of you! then I'd rather start by pio