What Is Outb() Function Call in Linux?

What Is Outb() Function Call in Linux?

Can someone please explain the meaning of

outb(0x10,short_base+2);

I tried figuring out by googling it, but for no use.

3

2 Answers

To answer your question:

outb is a function wrapper to an assembly instruction with the same name, used to talk to port-mapped devices e.g. the I/O address range 0x60-0x6F is used for the keyboard in IBM PC compatible computers.

Now, what is port-mapped IO?

A CPU-to-peripheral communication method, and it is used when the processor uses a different address bus to talk to devices and memory, thus needing special instructions.

Memory-mapped I/O is the other and most common method nowadays, where no special instructions are needed, as everything lives in the same address space.

System calls are described in section 2 of the man pages: man 2 outb

   void outb(unsigned char value, unsigned short int port);

DESCRIPTION
   This family of functions is used to do low-level port input and  output.
   The  out* functions do port output, the in* functions do port input; the
   b-suffix functions are byte-width and the w-suffix functions word-width;
   the _p-suffix functions pause until the I/O completes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.