SysLongOut & SysLongIn

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Locked
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

SysLongOut & SysLongIn

Post 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.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: SysLongOut & SysLongIn

Post 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
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
nuke
Posts: 10
Joined: Thu Feb 16, 2012 3:58 am

Re: SysLongOut & SysLongIn

Post 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.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: SysLongOut & SysLongIn

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Locked