if I type 'sudo cat /proc/ioports' I get a list of io address ranges.. but from all the
os tutorial I have studied, that only a specific port number is used as either input
or output... some times input has both control port and data port...
use timer as an example... port 0x40 and 0x43 are used, but the port range is
0x40 ~ 0x47,
I am wondering, what are ports 0x41 0x42 and 0x44, are these addresses used at all...
what would happen if I write to them will that screw up my already programmed PIT?
io ports question
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: io ports question
From the wiki page for the Programmable Interval Timer:
(For reference) 0x43 is the "control word register for counters 0-2"
0x44 is "PIT counter 3 (PS/2)"
0x47 is the "control word register counter 3"
I don't know if PIT counter 3 is used, or even available on modern computers.
Read the wiki page on the PIT to see what would happen if you wrote things to those other ports.
Edit: more info
When I do sudo cat /proc/ioports with my Ubuntu 20.04 install, I just get 0040-0043: timer0
And from RBIL:The PIT chip uses the following I/O ports:
I/O port Usage
0x40 Channel 0 data port (read/write)
0x41 Channel 1 data port (read/write)
0x42 Channel 2 data port (read/write)
0x43 Mode/Command register (write only, a read is ignored)
(For reference) 0x43 is the "control word register for counters 0-2"
0x44 is "PIT counter 3 (PS/2)"
0x47 is the "control word register counter 3"
I don't know if PIT counter 3 is used, or even available on modern computers.
Read the wiki page on the PIT to see what would happen if you wrote things to those other ports.
Edit: more info
When I do sudo cat /proc/ioports with my Ubuntu 20.04 install, I just get 0040-0043: timer0
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
Re: io ports question
Is it guaranteed every address within the address range has a use somewhere?
-
- Member
- Posts: 426
- Joined: Tue Apr 03, 2018 2:44 am
Re: io ports question
It is guaranteed that if you don't know what a port is for, it's a bad idea to poke it.ITchimp wrote:Is it guaranteed every address within the address range has a use somewhere?
Stick to ports that YOU have documentation for.