Wiki Documentation Issues & Fixes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SeaMc
Posts: 1
Joined: Sun Nov 15, 2026 7:00 pm

Wiki Documentation Issues & Fixes

Post by SeaMc »

Hi all,

I've been working on my own OS project and reading through the wiki extensively. I've found several issues in the documentation — incorrect code examples, missing hardware detection steps, and contradictions between code and warnings in the same page.

I'd like to start fixing these, beginning with the NMI page. The current code examples use read-modify-write on port 0x70, but the page itself states that port 0x70 may be write-only on some chipsets (returning 0xFF on read). This makes the  NMI_enable()  /  NMI_disable()  functions potentially broken on real hardware. The correct approach is to directly write 0x80 / 0x00 rather than reading back and modifying.

I also noticed the page mentions watchdog timers typically use NMIs and that port 0x70/0x71 access requires an I/O delay and a dummy read/write to port 0x71 — but the code doesn't reflect this properly.

I'd like to fix this and other issues I find along the way. Could an admin grant me wiki editing permissions? My forum username is SeaMc.

I'll use this thread to track documentation issues I come across. If anyone else has found errors in the wiki, feel free to post them here too.

Thanks!
User avatar
xenos
Member
Member
Posts: 1144
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
GitHub: https://github.com/xenos1984
Contact:

Re: Wiki Documentation Issues & Fixes

Post by xenos »

You can add yourself to the wiki group here in the forum (in your user control panel), which will grant you edit rights on the wiki.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Octocontrabass
Member
Member
Posts: 6301
Joined: Mon Mar 25, 2013 7:01 pm

Re: Wiki Documentation Issues & Fixes

Post by Octocontrabass »

SeaMc wrote: ↑Sun Nov 15, 2026 7:10 pmThe current code examples use read-modify-write on port 0x70, but the page itself states that port 0x70 may be write-only on some chipsets (returning 0xFF on read).
I would guess it's write-only on most chipsets, since it's write-only on IBM's AT and PS/2.
SeaMc wrote: ↑Sun Nov 15, 2026 7:10 pmThe correct approach is to directly write 0x80 / 0x00 rather than reading back and modifying.
There's a PS/2 manual out there where IBM recommends writing 0x8D/0x0D to leave status register D selected, although it doesn't include an explanation for why you'd want to do that.
SeaMc wrote: ↑Sun Nov 15, 2026 7:10 pmI also noticed the page mentions watchdog timers typically use NMIs and that port 0x70/0x71 access requires an I/O delay and a dummy read/write to port 0x71 — but the code doesn't reflect this properly.
I suspect I/O delays are only needed on very old PCs, but I've lost my reference for that...

The port 0x71 access is required because the RTC's address latch was only designed to handle direct addressing on a multiplexed address/data bus, where every latched address is immediately followed by a read or write. IBM wired it up "wrong" to do indirect addressing.
Post Reply