From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: port access in DJGPP Date: Thu, 26 Jun 1997 20:49:05 +0100 Organization: None Distribution: world Message-ID: References: <33B29F66 DOT 204C3DD3 AT execulink DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 26 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Jeff Weeks writes: >I'm wondering, does DJGPP just back to real mode to do port access? No: it all happens from pmode. It's just that the ports are protected in the same way that memory locations are, so the CPU has to check the permissions to see if you are allowed to access that port, and generate an exception if you aren't. That's how things like Win95 and DOSEMU manage to run hardware-intensive programs in multitasking environments: they deny permissions on all the ports, trap the resulting exceptions, and then emulate the hardware so the program runs correctly... >(forgive my limited knowledge of pmode). I tried using the alternate >cwsdpmi to run in ring 0, but port access didn't seem much faster. I >guess I use too many port operations (there are a ton of 'em). They're not _that_ horrific. I don't have anything to hand to check exact cycle counts, but at a guess I'd say you should be looking at 8 or 10 clocks per access. That's on the CPU side, though: remember that performance is also dependent on the speed of the card. If you are accessing a slow peripheral, nothing you can do from the CPU end is going to speed it up... -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.