From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3cfb384718eb4f7a X-Google-Attributes: gid103376,public From: Andi Kleen Subject: Re: question re Ada equivalent of C function Date: 1998/02/22 Message-ID: #1/1 X-Deja-AN: 327538769 Sender: andi@fred.muc.de References: <34EEFF9C.1D01FA5D@stellar1.com> <01bd3f1d$44728800$582c5c8b@aptiva> <34EF6CC6.28EF2D4A@stellar1.com> <01bd3f7d$43882660$4a2c5c8b@aptiva> Distribution: world Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Newsgroups: comp.lang.ada Date: 1998-02-22T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) writes: > > I am not suggesting that everyone move to OS/2, just pointing out that > the chain of reasoning that X is a "real operating system", therefore > X cannot allow you to directly access an IO port is misleading. Linux allows this too, although only if you have root rights. Just call the iopl() system call then to gain access to the io ports you need. Often it is better design to write a small kernel level driver stub though to access the hardware and control it over a device from the user program. For example it is pretty bad to disable interrupts in user programs (it is possible with some ugly tricks, but will probably break on SMP machines) - and often accesses to io ports require that for race-free operation. Overall doing io port accesses in a kernel level driver is better in most cases. -Andi