Questions tagged [hardware-port]

Low level I/O ports accessed via CPU instructions

Hardware architecture specific I/O ports which are accessed via the inb() and outb() family of functions in <sys/io.h>.

19 questions
10
votes
2 answers

what does "outb" in AT&T asm mean?

I am reading some code of Linux. The keyboard.S has something like outb %al,$0x61 and inb $0x61,%al I think the pending 'b' means 'byte', but i still cannot find what these instructions mean.
onemach
  • 4,265
  • 6
  • 34
  • 52
6
votes
3 answers

Low level I/O access using outb and inb

i'm having hard time trying to understand how interrupts work. the code below initialize the Programmable Interrupt Controller #define PIC0_CTRL 0x20 /* Master PIC control register address. */ #define PIC0_DATA 0x21 /* Master PIC data…
Amine Hajyoussef
  • 4,381
  • 3
  • 22
  • 26
4
votes
4 answers

Finding device base address to communicate via inb() and outb()

I am trying to communicate with a disk drive using inb(), inw(), outb() and outw() commands so I can find specific information about the drive. However, to use these commands, I need the correct I/O ports for the device. When I have the correct…
3
votes
1 answer

inline asm: operand type mismatch for 'out'

I don't know assembly in depth. Following code is for writing to hardware port. Compiler gives operand type mismatch error in every line where inline asm is used.When I compile I get these errors: port.cpp: Assembler messages: port.cpp:27:…
welkin
  • 43
  • 5
2
votes
2 answers

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.
Sagar Jain
  • 7,475
  • 12
  • 47
  • 83
2
votes
0 answers

Not able to light up keyboard LED using outb() call

I am trying to light up the keyboard LED in Linux with the following program (found this on internet) but nothing seems to happen. Am I missing anything? /* sample.c: very simple example of port I/O * * This code does nothing useful, just a port…
pkumarn
  • 1,383
  • 4
  • 22
  • 29
2
votes
2 answers

How to access Parallel port in Linux

On my Linux machine (Debian Wheezy), I tried to access the parallel port by request_region() but it failed because the system had already loaded the kernel module parport... So, I rmmod the modules lp, ppdev, parport_pc and parport. Then, I could…
Xiaobo Zhang
  • 21
  • 1
  • 1
  • 3
1
vote
2 answers

Reading and writing on I/O ports

I am trying to understand the following code: #include #include #include #define baseport 0x378 int main() { int b; if(ioperm(baseport,3,1)) { perror("ioperm"); exit(1); } …
karan421
  • 863
  • 17
  • 43
1
vote
1 answer

PC hardware port access from Java on Linux

What is the Java-on-Linux equivalent to the C byte-sized PC-architecture hardware port input/output functions? For output there is outb as in this: tmp = inb(0x61); if (tmp != (tmp | 0x01)) outb(0x61, tmp | 0x01); For input there is inb as in…
H2ONaCl
  • 10,644
  • 14
  • 70
  • 114
1
vote
0 answers

ReadFile reads from Hyperterminal window but not from external device

I have this program that uses winapi functions for reading from a serial port: #include #include using std::cin; using std::cout; DCB blank_dcb = {0}; int main() { int ierr, jsu, jcs, jto, jrf, nt; unsigned char…
TRPh
  • 187
  • 1
  • 9
1
vote
3 answers

Windows equivalent of inb(), outb(), low level i/o

I have some Linux code that monitors our hardware by collecting temperatures, voltages, and fan speeds, from the motherboard using inb(), outb(), inl(), etc. low level i/o functions. My challenge is to port that code over to run under Windows as a…
Sebastian Dwornik
  • 2,526
  • 2
  • 34
  • 57
1
vote
1 answer

How can Java Write/Read hardware ports like C does? (outb, inb etc..)

I've a C application. This application writes and reads some I/O port addresses. I think that Java can't access low level I/O address natively. Am I right? Here is an example of C++ app: #include #include #include…
The_Reaper
  • 157
  • 10
1
vote
2 answers

character device driver

The read() and write() callback functions in our ‘cmosram.c’ device-driver only transfer a single byte of data for each time called, so it takes 128 system-calls to read all of the RTC storage-locations! Can you improve this driver’s efficiency, by…
sandra
  • 11
  • 2
1
vote
1 answer

Driver accessing ports with inb() and outb()

I am making a device driver that turns on and off the keyboard leds by receiving any combination of three, two, one or none digit which should be 1, 2 or 3, if I make: echo 12 > /dev/ledDevice The program should turn on Num lock, Caps lock and…
Kaostias
  • 321
  • 4
  • 24
1
vote
2 answers

first kernel space driver in -- linux

I was able to control GPIO using mmap system call to control LED operation directly from the user space. Now I want to implement driver in kernel space. I am trying to write my first kernel space device driver for 16*2 line of LCD in Linux for ARM…
Katoch
  • 2,709
  • 9
  • 51
  • 84
1
2