Question

Can someone please explain the meaning of

outb(0x10,short_base+2);

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

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top