Re: direct I/O access
- From: Mike Meyer <mwm-keyword-freebsdhackers2.e313df@xxxxxxxxx>
- Date: Wed, 30 May 2007 12:39:10 -0400
In <20070530085506.163217000088@xxxxxxxxxxxxxxxxxxx>, rmgls@xxxxxxxxxx typed:
And I have to ask. The hardware has changed a lot since the days ofyes i am aware of this, and have a few understanding of protected mode too,
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?
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---
is it necessary to restore the permissions on exit?
.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.
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 <mwm@xxxxxxxxx> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Re: direct I/O access
- From: rmgls
- Re: direct I/O access
- Prev by Date: Re: SoC / PMC
- Next by Date: Re: direct I/O access
- Previous by thread: Re: direct I/O access
- Next by thread: Re: direct I/O access
- Index(es):
Relevant Pages
- Re: Vista support for legacy applications
... Of course they don't need replacement. ... The problem is that continuing to
try to support them in a modern ... Even on the least used of modern roads that
would get you into trouble ... work perfectly well on the hardware and OS they were designed
for. ... (microsoft.public.windowsxp.basics) - Re: DOES IT MAKE ANY SENSE
... Since hardware emulation has at least an order of magnitude advantage over software
emulation speed, ... Modern games run on the equivalent of supercomputers compared to even
a 100MHz Apple II! ... (comp.sys.apple2) - Re: Do we need this junk?
... a single modern core 2 server under virtualization like jails is beyond me. ...
FreeBSD, some mailing list users blasted him. ... also often true that an old P1 server
grade hardware use less power ... fast enough it is choosen for exactly the reason of power
consumption. ... (freebsd-current) - Re: DOES IT MAKE ANY SENSE
... modern Mac or PC, you'd still be looking largely at the "geek" crowd. ... LAN
without any fiddling (just like my Linux box) we have something ... hand with the hardware
and software. ... need to give people in the home and office market a reason to switch.
... (comp.sys.apple2) - Re: Scientific Computing on FPGA
... There is another simple possibility to speed up calculations. ... Do you know
that the GPU on a modern graphics card can do matrix ... SDKs and you wont need special
Hardware for that. ... FPGA solution. ... (comp.arch.fpga)