Page 1 of 1
drive access
Posted: Thu May 08, 2008 3:09 pm
by Woellchen
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
Posted: Thu May 08, 2008 3:16 pm
by svdmeer
With a segment selector and pagetable pointing to physical address b8000 you can access textmode-memory. With physical address a0000 you can access graphics memory.
Posted: Thu May 08, 2008 3:22 pm
by Woellchen
..my question was how to access a floppy or a hard drive..
Posted: Thu May 08, 2008 3:26 pm
by pcmattman
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).
Posted: Thu May 08, 2008 3:42 pm
by Woellchen
so in fact i have to use the out and in functions in assembler?
its the only thing i want to know because i didnt know that
Posted: Thu May 08, 2008 7:54 pm
by neon
Basically, yes.
btw, out and in are instructions not functions.
Posted: Thu May 08, 2008 8:48 pm
by bewing
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.
Posted: Fri May 09, 2008 8:45 am
by Dex