Page 1 of 1

Hardisk driver writing

Posted: Thu Dec 11, 2008 9:43 pm
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

Re: Hardisk driver writing

Posted: Thu Dec 11, 2008 10:04 pm
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.

Re: Hardisk driver writing

Posted: Thu Dec 11, 2008 10:32 pm
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?

Re: Hardisk driver writing

Posted: Thu Dec 11, 2008 10:49 pm
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

Re: Hardisk driver writing

Posted: Fri Dec 12, 2008 1:21 am
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.

Re: Hardisk driver writing

Posted: Fri Dec 12, 2008 6:24 am
by abertdas
thx for repliez
everybody have codes in c or assembly for reading or writing block disk , i will learn it

thx guyz

Re: Hardisk driver writing

Posted: Fri Dec 12, 2008 6:30 am
by LoseThos
Here's a valuable link for the ATA/ATAPI commands:
http://www.t13.org/Documents/UploadedDo ... -ATA-2.pdf

Re: Hardisk driver writing

Posted: Sat Dec 13, 2008 11:19 am
by Dex

Re: Hardisk driver writing

Posted: Sat Dec 13, 2008 7:58 pm
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

Re: Hardisk driver writing

Posted: Sat Dec 13, 2008 8:08 pm
by Troy Martin
Do you have at least floppy drivers implemented?