Read/Write disk at fisical level

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Robotex
Posts: 3
Joined: Tue Nov 11, 2008 6:04 am

Read/Write disk at fisical level

Post by Robotex »

Hi. I'm developing OS, but I have one problem. How can I read and write disks (hdd, fdd & usb flash drive) in protected mode?

Best regards, Nick.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Read/Write disk at fisical level

Post by AJ »

Hi,

Unlike with BIOS calls in Real Mode, there is no single interface for these devices - you need to write drivers for PATA, SATA, the FDC and USB individually. Have a look at our wiki article for Storage to get started.

Of these devices, PATA is probably the easiest to get started with.

Cheers,
Adam
Robotex
Posts: 3
Joined: Tue Nov 11, 2008 6:04 am

Re: Read/Write disk at fisical level

Post by Robotex »

If I will realize PATA, will it work with SATA HDD? Or only IDE?
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: Read/Write disk at fisical level

Post by djmauretto »

certainly with some measure :wink:
Laksen
Member
Member
Posts: 140
Joined: Fri Nov 09, 2007 3:30 am
Location: Aalborg, Denmark

Re: Read/Write disk at fisical level

Post by Laksen »

SATA controllers usually have shadow registers meaning that it emulates the ATA protocol as far as I'm aware
http://j-software.dk | JPasKernel - My Object Pascal kernel
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Read/Write disk at fisical level

Post by Troy Martin »

Floppy Disk Controller

TLDR version:
http://wiki.osdev.org/Floppy_Disk_Controller wrote:[The] Floppy controller is programmed through 8 registers accessed from 0x3F0 through 0x3F7 I/O ports. As usual on PC architecture, some of those registers have different meaning depending on whether you read or write them. For extra info, refer to the datasheet (see link below). Note that snippets and datasheets name those registers from their trigrams (e.g. SRA, MSR, DIR, CCR, etc)
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Read/Write disk at fisical level

Post by Love4Boobies »

Instead, you might want to look for ATA/ATAPI specs here: http://www.t13.org/
Think of it as an interface that kinda' works for everything.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Robotex
Posts: 3
Joined: Tue Nov 11, 2008 6:04 am

Re: Read/Write disk at fisical level

Post by Robotex »

Can you get me a direct link?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Read/Write disk at fisical level

Post by Brynet-Inc »

People are so helpless... I swear this has been posted on the forum before.

http://en.wikipedia.org/wiki/Advanced_T ... d_features
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply