am at the point where I need to start writing and reading from the HDD.
I have written code for this using this tutorial: http://www.osdever.net/tutorials/lba.php
However it seems to not be working. I tested it by reading displaying Buffer, then writing,
rereading the buffer, then printing. But it all turns out the same. I believe I want to use LBA.
I currently have: GDT, IDT, ISR, IRQs, PIC, PIT driver, Keyboard driver, and a basic CLI.
Attached is my CLI so far.
Code: Select all
void outb(u16int port, u8int value)
{
asm volatile ("outb %1, %0" : : "dN" (port), "a" (value));
}
/* Not sure if works
void outw(u16int port, u8int value)
{
asm volatile ("outw %w0, %1" : : "a" (value), "id" (port) );
}*/
u8int inb(u16int port)
{
u8int ret;
asm volatile("inb %1, %0" : "=a" (ret) : "dN" (port));
return ret;
}
u16int inw(u16int port)
{
u16int ret;
asm volatile ("inw %1, %0" : "=a" (ret) : "dN" (port));
return ret;
}
Is this enough to access the HDD?
Is this tutorial correct?
Last of all is my OutW correct? (first time I needed it)