hi
my problem is the following:
i have a kernel in protected mode written in c
my question is how to access to the drives like floppy and hard disk because i cant use int 13h anymore as you know
is there any address like 0xB8000 for the video memory?
i hope you can help me
thanks
drive access
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
You can't access disks at a memory address, because even for the text framebuffer it's all MMIO (memory mapped i/o) and there isn't any mapping for hard disks or floppy drives (because they're custom additions to the system).
You need to use CPU ports (at least, you do on x86) to talk to the hard disk or floppy drive - I highly suggest getting the ATA specification and googling for floppy drivers (I'm pretty sure the wiki has something on the floppy drive).
You need to use CPU ports (at least, you do on x86) to talk to the hard disk or floppy drive - I highly suggest getting the ATA specification and googling for floppy drivers (I'm pretty sure the wiki has something on the floppy drive).
Basically, yes.
btw, out and in are instructions not functions.
btw, out and in are instructions not functions.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Here is the wiki page I wrote, with instructions on the simplest method of how to use a hard disk, once you are not using the BIOS anymore.
http://www.osdev.org/wiki/ATA_PIO_Mode
Good luck.
http://www.osdev.org/wiki/ATA_PIO_Mode
Good luck.
See here for simple example:
http://www.osdev.org/phpBB2/viewtopic.p ... hlight=hdd
http://www.osdev.org/phpBB2/viewtopic.p ... hlight=hdd