Hardisk driver writing

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
abertdas
Posts: 3
Joined: Thu Dec 11, 2008 4:21 am

Hardisk driver writing

Post by abertdas »

I wanna make OS like DOS for database purpose but Protected Mode in X86
i must start in hardisk driver programming .

my Questions:

1.How to programming IDE and SCSI disk
2.How to read and write disk sector/block disk on SCSI and IDE disk
3.How relationship file system with Blockdisk (sectors) in FAT32 and UNIX file system

thx 4 yr att
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Hardisk driver writing

Post by bewing »

Writing an OS from the beginning takes several years of solid work. Since you already seem to have an intended use for it, I would strongly suggest that you look at DexOS ( http://www.dex4u.com/ ). It is now open source, and meets the specs that you stated.

If you really must do your own, you can find information on writing the very simplest type of IDE driver on the wiki: ATA PIO Mode. In general, writing harddisk drivers is fairly hard -- especially "the good kind", DMA drivers. We haven't gathered enough information together to make a good wiki article yet on anything other than ATA PIO Mode.
abertdas
Posts: 3
Joined: Thu Dec 11, 2008 4:21 am

Re: Hardisk driver writing

Post by abertdas »

THx buddy but that i want to know just:

how to read and write block disk on IDE and SCSI disk in c?
tantrikwizard
Member
Member
Posts: 153
Joined: Sun Jan 07, 2007 9:40 am
Contact:

Re: Hardisk driver writing

Post by tantrikwizard »

abertdas wrote:THx buddy but that i want to know just:

how to read and write block disk on IDE and SCSI disk in c?
use BIOS int 0x13
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Hardisk driver writing

Post by bewing »

abertdas wrote:THx buddy but that i want to know just:

how to read and write block disk on IDE and SCSI disk in c?
What I was saying is that SCSI is extremely difficult -- you probably need to start by either implementing ASPI, or creating a driver for a specific SCSI card, if you can find the manufacturer's specs.

Reading and writing an IDE drive is not possible in pure C. You need at least some inline assembly code. And you really do need to be good enough at assembly to be able to translate simple assembly code -- like the examples in the wiki article -- into C, for yourself, I'm afraid.

As far as the FAT32 format goes, if you use the "search" feature on this forum, you will find lots of links to it. Or look on wikipedia or google. UNIX typically uses the ext2 filesystem. Same for that.
abertdas
Posts: 3
Joined: Thu Dec 11, 2008 4:21 am

Re: Hardisk driver writing

Post by abertdas »

thx for repliez
everybody have codes in c or assembly for reading or writing block disk , i will learn it

thx guyz
LoseThos
Member
Member
Posts: 112
Joined: Tue Oct 30, 2007 6:41 pm
Location: Las Vegas, NV USA
Contact:

Re: Hardisk driver writing

Post by LoseThos »

Here's a valuable link for the ATA/ATAPI commands:
http://www.t13.org/Documents/UploadedDo ... -ATA-2.pdf
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Hardisk driver writing

Post by Dex »

User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Hardisk driver writing

Post by Brynet-Inc »

I wonder how many times I'll have to link to this article?

Search the forum next time, this has been discussed before.

http://en.wikipedia.org/wiki/AT_Attachm ... d_features
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Hardisk driver writing

Post by Troy Martin »

Do you have at least floppy drivers implemented?
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
Post Reply