Questions tagged [ioports]
24 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
8
votes
3 answers
Undocumented 16-bit I/O addressing on Z80
I notice from the Zilog datasheet on the Z80 that with the I/O (IN and OUT) group of instructions, the contents of various registers are often placed in the top 8 bits of the address bus (depending on the instruction), with the lower 8 bits…

PhilPotter1987
- 1,306
- 2
- 12
- 20
6
votes
2 answers
How GPIO is mapped in memory?
I am recently browsing GPIO driver for pi2, I found user space pi2 GPIO lib (like RPi.GPIO 0.5.11 of python) use /dev/mem for BCM2708 (begins at 0x20000000,and GPIO begins at 0x200000 relatively) to mmap a user space memory region in order to…

ggaaooppeenngg
- 1,323
- 3
- 17
- 27
5
votes
1 answer
Access to PIT (?) IO ports 44h and 46h - what do those ports do?
I was disassembling an MS-DOS .com application and came across some port access which I don't understand. More precisely, via the IN instruction, values are read from the following ports.
40h
44h
46h
The documentation found here mentions ports…

Codor
- 17,447
- 9
- 29
- 56
4
votes
1 answer
Is REP INSB interruptible?
Suppose I do a long REP INSB reading a PCI device register from user mode in a normal-priority thread. What of the following can and what cannot happen during the time it executes:
Interrupts (other cores)
Interrupts (same core)
PCI access (other…

Eugene Ryabtsev
- 2,232
- 1
- 23
- 37
4
votes
1 answer
Turning keyboard LED lights on
I was given some code to analyze. This code enables the numLock and scrollLock LEDs on a keyboard. I understand the majority of this code, however I don't understand the loop part (0104). I know this is for waiting for an input buffer to be empty.…

kubwlo
- 87
- 2
- 6
3
votes
1 answer
Word-sized OUT to a byte IO register? Setting the Sequence Controller Register with out instructions in old VGA code
I'm having trouble understanding how the Sequence Controller Registers are set in this example with some old VGA code:
mov dx,SC_INDEX
mov ax,0604h
out dx,ax ;disable chain4 mode
The example is from Michael Abrash's VGA book:…

thunder
- 343
- 1
- 2
- 10
3
votes
2 answers
How to use ins instruction with GNU assembler
How do I use the x86 ins instruction with the GNU assembler? The instruction reference suggests the syntax INS m8/16/32, DX where e.g. m16 (I assume) is any 16 bit general purpose register whose only purpose it is to signify whether a…

Peter
- 2,919
- 1
- 16
- 35
2
votes
1 answer
Linux NASM OUTSB SegFault
I'm trying to write byte 0xff to the parallel port at 0x378. It compiles and links without issue, but segfaults at the OUTSB instruction.
section .text
global _start
_err_exit:
mov eax, 1
mov ebx, 1
…

tMC
- 18,105
- 14
- 62
- 98
2
votes
2 answers
Python mmap /dev/port
Is it possible to mmap /dev/port? I'm getting 'No such device' when I try.
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import…

tMC
- 18,105
- 14
- 62
- 98
2
votes
0 answers
How to communicate between Network card and the Ethernet driver?
I am trying to build an unikernel in Rust,which will boot and start a web server. I am using Qemu for testing purposes.
So far, I have managed to write an OS with segmentation, paging and interrupts enabled by following various blogs online and…

natcomp256
- 706
- 7
- 13
1
vote
0 answers
PCI device I/O ports work under Windows but not under Linux
[Edited]
I am trying to access an I/O port of a PCI device under Linux x86_64, however
inl() only ever reads 0xFFFFFFFF
outl() does not effect the hardware
It works under Windows (XP x86) as long as any driver (I tested with a completely empty…

Jack White
- 896
- 5
- 7
1
vote
0 answers
Is x86_64 memory map same as x86's?
Yes, x86 is 32 bit. Wrote a small kernel for VGA, keyboard IO, and mouse IO. But, x86_64 is 64 bit. The main difference is that the registers are extended to 64 bit and there are more of them. The x86_64 instruction set has a few more instructs…

user135142
- 135
- 9
1
vote
1 answer
how to find out which ioports be assigned to my devices
has linux reserved io port numbers for all manufactured devices.
I have devices like intel built-in network card. or another device I have for wifi (usb) from realtek.
On linux repository on github, device drivers use specific io ports to register.…

user786
- 3,902
- 4
- 40
- 72
1
vote
1 answer
Writing to I/O Port Controller driver (inpout) (PS/2 Keyboard port) Left and Right keyboard keypresses?
I'm using inpout32/64 Hardware I/O Port Controller using this system driver InpOut32 and InpOutx64
I'm trying to use this to bypass problems I have with DirectInput games.
(Can't use SendInput, because it will reject inputs without a very long sleep…

SSpoke
- 5,656
- 10
- 72
- 124