first version of ide controller

This commit is contained in:
2021-02-04 23:15:02 +01:00
parent dc8a0444f9
commit b156509da1
7 changed files with 572 additions and 68 deletions

View File

@@ -40,3 +40,17 @@ unsigned int port_double_word_in(unsigned int port) {
void port_double_word_out(unsigned short port, unsigned int data) {
__asm__("out %%eax, %%dx" : : "a" (data), "d" (port));
}
void port_word_in_repeat(unsigned short port, unsigned short *data, int buffer_size) {
asm("rep insw"
: "+D"(data), "+c"(buffer_size)
: "d"(port)
: "memory");
}
void port_double_word_in_repeat(unsigned short port, unsigned int *data, int buffer_size) {
asm("rep insl"
: "+D"(data), "+c"(buffer_size)
: "d"(port)
: "memory");
}