Solved

VxD->Ring3->Ring0 Communication

Posted on 1997-03-02
16
371 Views
Last Modified: 2013-12-03
VDMAD:
   How do I make it appear to my ring3 app from my VxD that terminal count has occured using VDMAD vxd services when the DMA is in SCD mode?   TC Bit must be set and count must equal 0xffff (most important is the TC bit)...
    -- Aaron
0
Comment
Question by:amartin030297
  • 12
  • 3
16 Comments
 
LVL 2

Author Comment

by:amartin030297
ID: 1299981
Edited text of question
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299982
Edited text of question
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299983
Additionally, is it SAFE to issue and wait on an APC from within the IO Handler (just comment on this one, please)... As I have noticed SoftIce mouse-movement causes an exception occasionally after I hook/unhook any port..
0
 
LVL 1

Expert Comment

by:donc
ID: 1299984
This answer is Win95 specific, and is not guaranteed to work in any future version of the OS.  Also, it is not polite, and if everyone starts doing this it might mess up the world.

Make sure your ring 3 code will not cause a page fault  (This may be optional, I haven't tested to see what will happen if your ring 3 stuff is paged out.)

Make sure your ring 3 code is loaded in the common address space (above 2GB), so it doesn't matter what process is active at the time of the interrupt.

Make sure your ring 3 code is self contained, doesn't call into any other code.

Just call directly into your ring 3 code.  It works fine, I've been doing this for years :-)
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299985
While that may work for specific cases, there by copying the ring-3 code into ring-0, you do not run at user level, rather at kernel level...thus many (most) win32 functions will not work.

  Good ideas, but its not a solution for my problem..
     -- Aaron
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299986

****************************************************
I've since figured out how to do this... disregard this question please..
                   Thanks!
****************************************************


0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299987
Edited text of question
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299988
##############################

Okay,
   I changed the question entirely!! Anyone know the answer
to this one???

##############################
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Accepted Solution

by:
APWeir earned 150 total points
ID: 1299989
If you have virtualized the channel using the VDMAD_Virtualize_Channel call, you can apply the VDMAD_Set_Virt_State call, using the previously acquired DMA handle and the handle of the VM in which the APP is running, to set the count and physical address. If the Count specified is 0xffff, the VDMAD will virtualize the TC status bit  to the VM until the count changes.
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299990
I have tried (and just did again to verify)... Setting
the VirtualState of the dma channel to 0xffff yields
a value (when read from the vm) of 0xfffe, and NO TC BIT
(port 8) set.
Additonally, setting 0x10000 yields 0xffff in the vm, but
still no TC.
        -- Aaron

0
 

Expert Comment

by:APWeir
ID: 1299991
Aaron,

It seems to me based on your last comment that setting the count in the virtual state to 0x0000 would yield the desired result.

0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299992
No, setting a count of 0x0000 will yield a value of 1 in the
controller... a legal value, and is not a terminal count.
  -- Aaron

0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299993
hmm... maybe 0 will give 0xffff... I may be wrong..lemme check

0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299994
I have done testing around all the "Edges"... and
the TC bit (port 0x8) is NEVER set by VDMAD.  Unless
I'm missing something, you are not correct.

0
 

Expert Comment

by:APWeir
ID: 1299995
I have done a lot of investigation regarding this issue (for other reasons) and it has become clear to me that the VDMAD was never intended to fully virtualize a channel (e.g., virtualize DMA to a VM for a PCI audio card). The VDMAD assumes that the channel is physically driven by DRQs on the ISA bus. When a channel is unmasked, it polls the physical controller for a TC - it will never reflect TC to the VM unless it sees one physically. The VPICD has a similar virtualization flaw when there is no physical IRQ. Try virtualizing and IRQ to a VM using VCPICD_Set_Int_Request. If the VM has the IRQ masked, it cannot detect the IRQ assertion by reading the IRR.
0
 
LVL 2

Author Comment

by:amartin030297
ID: 1299996
You might as well take the points..... as I think all the
investigation in the world will yield identical results
as yours and mine..
  -- Aaron
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now