Page 1 of 1
SysLongOut & SysLongIn
Posted: Tue Feb 14, 2012 8:17 pm
by Yashas
How to send and recive a long.(SysOutLong and SysInLong)
Will this work??
unsigned long inportlong (unsigned long _port)
{
unsigned long rv;
__asm__ __volatile__ ("inl %1, %0" : "=a" (rv) : "dN" (_port));
return rv;
}
Are there any more other than inb,outb,outw,inw,inlong,outlong for a x86 32bit System.
Re: SysLongOut & SysLongIn
Posted: Tue Feb 14, 2012 8:38 pm
by gravaera
Yo:
I think you should consider reading far more extensively about port-mapped I/O and the x86 port address space. It should explain things a lot better.
--Good luck,
gravaera
Re: SysLongOut & SysLongIn
Posted: Thu Feb 16, 2012 10:49 am
by nuke
How many types are there like that?, i am new so dont know so much.
Other than these ,inb,outb,inw,outw,inl,outl what else more is there.
And the code mentioned by yashas ,is it correct??
I got copied it so i need to ask.
Re: SysLongOut & SysLongIn
Posted: Thu Feb 16, 2012 11:49 am
by Brendan
Hi,
Yashas wrote:Are there any more other than inb,outb,outw,inw,inlong,outlong for a x86 32bit System.
There's string versions ("OUTSB/W/D" and "INSB/W/D") but these instructions are only really used for some hard disk drivers (and only if the hard disk supports the fastest PIO modes and the OS is too lame to support DMA instead
).
For 64-bit code there's also the 64-bit versions, but you can't use them in 32-bit code.
Cheers,
Brendan