In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] typed: > >And I have to ask. The hardware has changed a lot since the days of > >DoS, and things that worked then may cause strange results on modern > >hardware. Do you know modern hardware, or are you still using dos-era > >hardware? > > > yes i am aware of this, and have a few understanding of protected mode too, > also about music softs.
Actually, protected mode is just the beginnings of it. I've never done much x86 assembly, but going from the '020 to the '030 (or maybe it was the '010 to the '020). I had to start invalidating the hardware caches after certain operations. After that, I switched to RISC hardware, which were designed assuming that the real people writing assembler would be few and far between, and did crazy things like rearrange the instruction sequence behind your back and add extra instructions. Modern systems do this kind of stuff as well. > ---cut--- > >> > >> .data > >> .align 4 > >> params: .word 0x330,2,1 # midi port => enabling IO ??? > >> > >> .text > >> .align 4 > >> .global _start > >> _start: > >> nop > >> pushl params > >> pushl $0x4 > > > >I believe this should be $0x4, as you want to *set* the values, not > >get them. > > > is it necessary to restore the permissions on exit? > > >You also need to open the file "/dev/io". I believe that leaving this > >file open for anything more than a handful of instructions would be a > >bad thing, but I'm not going to verify it. > > > > i tried this, but without set_ioperm, it was not clear on the doc > that one have to use these two funcions: > in io man: i find SEE ALSO: i386_get(set)_ioperm... > > is my understanding correct? Sounds like it. You have to do i386_set_ioperm to say what port range you want access to, and open /dev/io to actually allow it to work. It doesn't look like it's order dependent, so doing the i386_set_ioperm and then opening/closing /dev/io should work. I no longer have root on a machine running i386 FreeBSD, so I can't test it very easily. This really is a kludge, though. You haven't said what you're trying to do. If you're trying to keep an old one-of device working, this is probably the best way. But if it's a real device that other people might be using, then writing a real device driver, or seeing if you can make the device work with something like the iic drivers might be better. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"