On Wed, Aug 19, 2020 at 3:09 AM Doug Moss <dougmoss...@yahoo.com> wrote:
> On 2020-08-17, Stuart Henderson wrote: > >On 2020-08-17, Doug Moss <dougmoss...@yahoo.com> wrote: > >> > >> Did something change at OpenBSD i386 between 5.9 and 6.0 > >> related to parallel port / lpt hardware permissions? > >> > >> Up to OpenBSD i386 5.9, > >> I used to be able to have a working case-LCD-screen > >> with lcdproc-0.5.7, driver=hd44780, winamp wiring, with 'allowaperture'. > >> At OpenBSD i386 6.0 and after, it fails. > > > >I think this is due to kernel memory access restrictions that were added. > >Setting sysctl kern.allowkmem=1 before securelevel is raised bypasses them > >but of course weakens protections. > > I think the problem in lcdproc is in the code from this file (port.h) > https://github.com/lcdproc/lcdproc/blob/master/server/drivers/port.h > > I am out of my depth with this code. I have never even seen these > calls 'outb' and 'inb' > The code looks like it was begun in 1995. > Is that what you are talking about 'kernel memory access'? > Those are direct CPU instructions for I/O. To use them, the code must use i386_iopl(2) from libarch.a to enable it, which in turn requires the machdep.allowaperture sysctl to a non-zero value (per the manpage). > Any advice about this? Is this code amenable to being 'modernized'? > > If can't modernize the lcdproc code, can you give me specifics about: > Do I just put a line in /etc/rc.securelevel > kern.allowkmem=1 > Try machdep.allowaperture=1 instead. Philip Guenther