hello all
i have a question. how can i get drive params with c? i m making own OS.
how can i get drive params with c?
Re:how can i get drive params with c?
Drive params? You mean like CD-Drive, Hard drive, floppy drive, etc.?
CD and Hard drive are on an IDE Slave/Master setup, usually with 2 channels. I don't have anything in front of me, but look back ~1/2 a month for a post, there was a good website for that stuff posted.
As for the floppy, it has its own logic - Again, nothing in front of me, but the OS-Faq has some insight.
Sorry I couldn't be more help
CD and Hard drive are on an IDE Slave/Master setup, usually with 2 channels. I don't have anything in front of me, but look back ~1/2 a month for a post, there was a good website for that stuff posted.
As for the floppy, it has its own logic - Again, nothing in front of me, but the OS-Faq has some insight.
Sorry I couldn't be more help
Re:how can i get drive params with c?
Your question could mean two things:
1) How could my kernel read drive geometry etc. from the BIOS and / or the controller?
Answer: Please consult the FAQ, the forum search function and the various linked and / or google-able tutorials. It is a wide subject, and very much dependent on your kernel architecture, your hardware, and your BIOS - but not at all dependent on the language.
2) Are there any standard C functions to do this?
Answer: No.
1) How could my kernel read drive geometry etc. from the BIOS and / or the controller?
Answer: Please consult the FAQ, the forum search function and the various linked and / or google-able tutorials. It is a wide subject, and very much dependent on your kernel architecture, your hardware, and your BIOS - but not at all dependent on the language.
2) Are there any standard C functions to do this?
Answer: No.
Every good solution is obvious once you've found it.
Re:how can i get drive params with c?
The more you clearify and simplify your question, the better answers you take.
Anyway...
If you ask getting info about your fdd and hdd, you may probe their ports.
IIRC, CMOS have an information about types and existance of first and second fdd. Read 0x10 from cmos for that information.
Or (and better) probe :
0x3f0 -> First fdc
0x370 -> Second fdc
And for hdd, you may probe these base addrs.
0x1f0 -> Primary controller
0x170 -> Secondary controller
0x1e8 -> Triplicate controller
0x168 -> Quadriple controller
Each controller may have 2 drives(master/slave). I dont remember which commands to send to get info. Google it.
Thats what I understood from your question.
Anyway...
If you ask getting info about your fdd and hdd, you may probe their ports.
IIRC, CMOS have an information about types and existance of first and second fdd. Read 0x10 from cmos for that information.
Or (and better) probe :
0x3f0 -> First fdc
0x370 -> Second fdc
And for hdd, you may probe these base addrs.
0x1f0 -> Primary controller
0x170 -> Secondary controller
0x1e8 -> Triplicate controller
0x168 -> Quadriple controller
Each controller may have 2 drives(master/slave). I dont remember which commands to send to get info. Google it.
Thats what I understood from your question.