🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8556

Re: LPT IRQ

#8556
From: Andrue Cope [TeamB]
Date: Thu, 14 Oct 2004 10:30
42 lines
2770 bytes
Kresten Tolstrup wrote:

> Or is it possible to start a thread that just at the ACK bit in the
> LPT ports Status register ?

I don't think so - at least not in an application.

Win32 runs code at different CPU privilege levels. Application code
runs at Ring 3 IIRC and is thus very underprivileged <g>. This means
that any time it tries to do anything hardware related (reprogram the
CPU, talk to I/O ports etc) the CPU will raise an exception and pass
control to the Kernel. The Kernel then looks at what you are doing and
if it doesn't like it you get terminated :)

For most application developers this a Good Thing since we have no
business messing about with other processes or with system hardware. As
DOS so frequently showed that kind of free for all leads to unstable
PCs. Every AV you see is the OS stepping in and stopping your program
from writing to a memory address it shouldn't.

Better yet the Win32 API has had to be extended in order to do the
things for us that we used to have to do ourselves but now can't. Not
only do we get its protection we also get lots of handy features
written for us :)

Unfortunately you appear to want to do something estoeric and the Win32
API doesn't support it.

This means you need to talk to the hardware (or get someone to on your
behalf). This means running code at Ring 0 which means writing (or
locating) a device driver. I don't know how easy this is but I suspect
it's not a trivial project. I also don't know if you can use Builder to
write device drivers.

As a first step I suggest you contact the manufacturers and ask if they
know of anyone who has developed such a driver. Someone probably has
done by now.

-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <416e5541$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!solnet.ch!solnet.ch!news-zh.switch.ch!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <416d2266$1@newsgroups.borland.com> <opsft1imh7z6rw7b@newsgroups.borland.com> <416e3472$1@newsgroups.borland.com> <416e474d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,61960c89ee66c5fb
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address>
Subject: Re: LPT IRQ
Newsgroups: borland.public.cppbuilder.nativeapi
References: <416d2266$1@newsgroups.borland.com> <opsft1imh7z6rw7b@newsgroups.borland.com> <416e3472$1@newsgroups.borland.com> <416e474d$1@newsgroups.borland.com>
User-Agent: XanaNews/1.16.4.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <416e5541$1@newsgroups.borland.com>
Date: 14 Oct 2004 03:30:25 -0700
X-Trace: newsgroups.borland.com 1097749825 217.207.223.34 (14 Oct 2004 03:30:25 -0700)
Lines: 42
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!solnet.ch!solnet.ch!news-zh.switch.ch!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail