|
Thankx for the Info
A couple of quick questions in 32 bit Windows is the concept of segment offset still valid ?? however the offset is 32 bits
Anyway to access the CRs ??? or it all strictly hardware ???
Thankx
|
|
|
|
|
In 32-bit protected mode the segment registers still work. The segment registers themselves are 16 bits wide and point to segment descriptors which have 32-bit base and limit fields. The base and limit fields are interpreted as virtual addresses. The segment registers are really only for aliasing and setting protection information.
Windows doesn't bother with segmented addressing, bar one case: it uses the FS segment register to point to the thread's Thread Information Block. This means code can use FS:[0] to point to the TIB throughout, without having to perform another lookup to find out where the TIB is. All the other segment registers point to segments (of the correct type) which have a base of 0 and a limit of 0xFFFFFFFF, that is, they can reference any address in the system. SS, DS, ES and GS are all set to the same value, while CS points to a different selector as selectors differentiate between code and data.
For exception handling, 32-bit Windows uses the TIB to carry a chain of exception handlers, so if you look at disassembly of a function which has an exception handler, you'll see instructions referring to FS:[0].
In 64-bit long mode (x64), AMD decided to effectively remove the legacy segment registers apart from FS and GS. (Some operating systems used GS, I think.) The legacy segment registers still have to be set to point to segment descriptors but the base and limit aren't checked. The instructions that used to manipulate some of these registers (e.g. PUSH CS) have been removed. (Currently the opcodes do nothing but are reserved for future use.) The MOV CS,rnn instructions are now the only way of loading these registers.
The processor includes MOV CRn,rr and MOV rr,CRn instructions but they can only be executed at privilege level ('ring') 0, which means in kernel mode. I'd strongly recommend not trying to change them as the OS will get very confused. There are device driver APIs documented for mapping a user-mode buffer into the system address space if necessary. If you want to share some address space between processes, use a file mapping object (CreateFileMapping ).
For a reference on all this information, you can try volume 3 of the Intel Architecture Software Developer's Manuals[^]. It's hard going but this really is the master reference.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
You have beeb very helpfull so the segement registers CS,DS etc..
are still 16 bit pointing to segemnt discriptors
EBX and EDX are 32 bit registers
In order to really understand I should write some X86 assembler programs My bacgound is In Mainframe 370 Assembler internals etc
So it shouldn't be that difficult
Sometimes in Visual Studio when I do a watch on data name I get this error CXXX017 it cann't evaluate the expression but when I go into disassembly mode I can see the value that get loaded so knowing masm is helpfull
On last question the CS registers is never really primed or loaded on X86 systems when process get control initially it get intialized to the first procedure and the value only changes with a Call inst/macro right ??
Thankx again
|
|
|
|
|
Anyone know of some kind of generic Win32 driver for DFU?
The protocol is standardized even though the format of the downloaded files may differ, so it should be possible to create a generic driver for it and modify the .inf-file with the correct VID and PID for the device.
This is what I'm talking about:
http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf[^]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi all
when i use my pendrive on my system it will hang but the same pen drive works fine in my friends pc we both have the same antivirus protection enabled and there is no virus in my pc .
What would thye cause for the same
Yogesh Agarwal
|
|
|
|
|
Hi Yogesh
if you installel driver for this. you must uninstall dirver then retry to install for this.
|
|
|
|
|
Hi guys,
I'm trying to build a DLL using the DDK.
My Sources file is:
----- START SOURCES FILE -----
TARGETNAME = VirtualDiskTools
TARGETPATH = obj
TARGETTYPE = DYNLINK
USE_MSVCRT=0
INCLUDES = C:\WinDDK\2600.1106\inc\ddk\wxp
LIBS = %BUILD%\lib
SOURCES = VirtualDiskTools.c
----- END SOURCES FILE -----
And the MAKEFILE contains only this line:
!INCLUDE $(NTMAKEENV)\makefile.def
When I try to compile the project through Visual Studio, using the ddkbuild tool, I get the following error:
1>NMAKE : U1073: don't know how to make 'VirtualDiskTools.def'
I should change something in my sources file, maybe?
Thanks in advance
|
|
|
|
|
OK, I'll ask the obvious - do you have a VirtualDiskTools.def and is it located in the source directory?
Judy
|
|
|
|
|
Hi Judy,
no, I don't have any VirtualDiskTools.def in my source directory. The strange thing is that I can get a correct build of another project without a def file, compiled using TARGETTYPE=DRIVER (instead of TARGETTYPE=DYNLINK).
Maybe, compiling with DYNLINK, I need to create a def file?
So, how can I create VirtualDiskTools.def in my source directory?
Thanks for your reply
|
|
|
|
|
Member 4124873 wrote: Maybe, compiling with DYNLINK, I need to create a def file?
So, how can I create VirtualDiskTools.def in my source directory?
I agree that you need to create a .DEF file - in my quick search, I didn't find a single sources file that created a DYNLINK that didn't have an accompanying DEF file.
A DEF file is a plain text file that lists the exported functions from your DLL. A bare-bones file would be like:
LIBRARY YourNameHere
EXPORTS
FuncName1
FuncNAme2
For all the gory details, see Module Definition File[^]
Judy
|
|
|
|
|
Maybe I'm too late, I'm sorry Judy.
I tried using your instructions. Please, confirm me the follow:
In my def file I define the name that I want for my DLL (LIBRARY), under the EXPORTS section, I can define a list of functions declared in my DDL source code, that can be accessible from external applications that are referencing the DLL. Is it right?
Because I tried to add into the EXPORTS section a function name (FileDiskCreateDevice) but when I try to compile, I get a lot of errors like:
Error 48 fatal error LNK1120: 23 unresolved externals objchk_wxp_x86\i386\VirtualDiskTools.dll
Error 17 error LNK2019: unresolved external symbol _KeGetCurrentThread@0 referenced in function _FileDiskDeviceControl@8 virtualdisktools.obj
Error 41 error LNK2019: unresolved external symbol _KeGetCurrentThread@0 referenced in function _FileDiskDeviceControl@8 virtualdisktools.obj
Error 11 error LNK2019: unresolved external symbol __imp__SeTokenType@4 referenced in function _FileDiskDeleteDevice@4 virtualdisktools.obj
What's wrong?
Thanks in advance.
|
|
|
|
|
Member 4124873 wrote: What's wrong?
Exactly what the error message says. You've used the functions KeGetCurrentThread and SeTokenType without including the implementations of them. You need to include the libraries for the functions in your sources file. I believe the first is in ntdll.lib but I'm not sure where the second one is since I've never done stuff that needed the IFS kit before. Look in an IFS example and see which libraries are included in that source file.
When I look up SeTokenType in the ddk documentation, it says that routine is reserved for system use. You should be using the recommended alternative SeQueryInformationToken .
Judy
|
|
|
|
|
I tried adding into my Sources file this line:
TARGETLIBS = C:\VirtualDiskTools\lib\ntdll.lib
Anyway, while compiling I get the same errors (I cut here all compiler output for your reference):
1>OSR DDKBUILD.BAT V6.11 - OSR, Open Systems Resources, Inc.
1>WXP BUILD using WNET DDK
1>build in directory C:\VirtualDiskTools with arguments -cZ (basedir C:\WinDDK\2600~1.110)
1>run build -Ze -cZ -MI for checked version in C:\VIRTUA~2
1>BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
1>BUILD: Using 2 child processes
1>BUILD: Object root set to: ==> objchk_wxp_x86
1>BUILD: Compile and Link for i386
1>BUILD: Examining c:\virtua~2 directory for files to compile.
1> c:\virtua~2
1>BUILD: Compiling c:\virtua~2 directory
1>Compiling - virtualdisktools.c for i386
1>Building Library - objchk_wxp_x86\i386\virtualdisktools.lib for i386
1>BUILD: Linking c:\virtua~2 directory
1>Linking Executable - objchk_wxp_x86\i386\virtualdisktools.dll for i386
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ExFreePoolWithTag@8 referenced in function _DriverEntry@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ExAllocatePoolWithTag@12 referenced in function _DriverEntry@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeSetEvent@12 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ObReferenceObjectByHandle@24 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__IoDeleteDevice@4 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsCreateSystemThread@28 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeInitializeEvent@12 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeInitializeSpinLock@4 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__IoCreateDevice@28 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeGetCurrentIrql@0 referenced in function _FileDiskUnload@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeTokenType@4 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ObfDereferenceObject@4 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeWaitForSingleObject@20 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@IofCompleteRequest@8 referenced in function _FileDiskCreateClose@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ExfInterlockedInsertTailList@12 referenced in function _FileDiskReadWrite@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeCreateClientSecurity@16 referenced in function _FileDiskDeviceControl@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol _KeGetCurrentThread@0 referenced in function _FileDiskDeviceControl@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsRevertToSelf@0 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeImpersonateClient@8 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__MmMapLockedPagesSpecifyCache@24 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ExfInterlockedRemoveHeadList@8 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsTerminateSystemThread@4 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeSetPriorityThread@8 referenced in function _FileDiskThread@4
1>objchk_wxp_x86\i386\virtualdisktools.dll : error LNK1120: 23 unresolved externals
1>BUILD: Done
1> 2 files compiled
1> 1 library built
1> 1 executable built - 24 Errors
1>=============== build warnings ======================
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ExFreePoolWithTag@8 referenced in function _DriverEntry@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ExAllocatePoolWithTag@12 referenced in function _DriverEntry@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeSetEvent@12 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__ObReferenceObjectByHandle@24 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__IoDeleteDevice@4 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsCreateSystemThread@28 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeInitializeEvent@12 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeInitializeSpinLock@4 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__IoCreateDevice@28 referenced in function _FileDiskCreateDevice@12
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeGetCurrentIrql@0 referenced in function _FileDiskUnload@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeTokenType@4 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ObfDereferenceObject@4 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeWaitForSingleObject@20 referenced in function _FileDiskDeleteDevice@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@IofCompleteRequest@8 referenced in function _FileDiskCreateClose@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ExfInterlockedInsertTailList@12 referenced in function _FileDiskReadWrite@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeCreateClientSecurity@16 referenced in function _FileDiskDeviceControl@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol _KeGetCurrentThread@0 referenced in function _FileDiskDeviceControl@8
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsRevertToSelf@0 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__SeImpersonateClient@8 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__MmMapLockedPagesSpecifyCache@24 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp_@ExfInterlockedRemoveHeadList@8 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__PsTerminateSystemThread@4 referenced in function _FileDiskThread@4
1>virtualdisktools.obj : error LNK2019: unresolved external symbol __imp__KeSetPriorityThread@8 referenced in function _FileDiskThread@4
1>objchk_wxp_x86\i386\VirtualDiskTools.dll : fatal error LNK1120: 23 unresolved externals
1>
1>
1>build complete
1>building browse information files
This is, if it can be usefull, the command line that I use to compile the project:
C:\ddkbuild\ddkbuild -WNETXP chk C:\VirtualDiskTools -cZ
I'm new in driver developing and I'm not able to find out the cause of my troubles compiling this project.
If you need more information on my source, project etc., please ask me.
Thanks in advance
|
|
|
|
|
Member 4124873 wrote: TARGETLIBS = C:\VirtualDiskTools\lib\ntdll.lib
ntdll.lib is part of the ddk, not part of your project. You'd use something like $(DDK_LIB_PATH)\ntdll.lib in your TARGETLIBS statement. However, looking at your output, you're missing some very common functions like ExAllocatePoolWithTag. I'm concerned that your sources file is messed up since you're not picking up the libs that contain those common functions. Compare it with a sources file that builds a dll in the ddk examples.
Judy
|
|
|
|
|
i am studying RObotics cource ..
my project is to develop a "object following robot"
description...
basically it is a car(i will use toy car first) has camera
on it that will capture picture of a object at run time and follow it ......... it takes a check on object through camera and follow it it detects target object by sensors,,or through camera it is not decided yet
this iz alll detail of my project
i want to know how could i start working on it plz any one guide me to the whole process
waiting for replysss.
thks
|
|
|
|
|
kanza azhar wrote: any one guide me to the whole process
waiting for replysss.
Go for it and let us know what happens
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi kanza azhar.
I am industrial automation programmer.
you must select a camera atleast with 640*480 resolation and then you must khow about image processing programming for detect object. then you must khow how to capture camera with this programming language. if you search image processing in google, you can download ebook about this.
thanks
|
|
|
|
|
thanks for ur rply
i have done this analysis already n some form ur rply too
nw i am working for mechinacal structure of my proj. now i am
bulding mechinical design ..........
hope for guidence here too..
|
|
|
|
|
you need guidance about Mechanic, software,hardware or optic?
if you design mechanic , you must describe about your mechanic design type then i guide you about hardware and software.
|
|
|
|
|
thanks for your rply
my mechinical part includes "a car mainly,,,
but that includes a flat wood or iron platform ,,4 wheels and
two motors for straight and left right motion ,,,
trying to cmplete it hope you understand
any suggestions are welcomed....
|
|
|
|
|
Really you design a basic machine for move in two axis;I suggest you used position servo motor for axis moving(left-right and back-front)if you want used cheap motor you can use step motor for this but you need encoder for control position and your accuracy is low with this motor;in both two motors you need supply driver and interface for control(motor);
|
|
|
|
|
hello
my design is complete andstructure is almost done
now i have to do path planning
could you plz guide me again that what path planning should i do
i have a restricted domain
and i have to move my vehicle in that domain
waiting for your reply
thanks
|
|
|
|
|
you want to use servo or step motor with encoder or no?
first estimate your robot need which motor(5kg or 10kg or ...)
select motor; then select driver for this type of motor .
|
|
|
|
|
Hi All,
I need urgent help. We have console based driver installation EXE which is developed through DDK APIs.
On my PC two network adapter card are inserted (D-Link) in two PCI slots.
When i install both Network Adapetr PCI Ethernet throgh my application, It installs the driver properly.
But in Device manager it shows 2 Network Adpater Card (D-Link) properly installed and one extra Network Adpater
Card(D-Link) entry with yellow mark (black exclamation) [This device cannot start. (Code 10)].
Why this third extra driver entry viewing in Device manager.
Entries in Device Manager :
1. D-Link DGE-530T Gigabit Ethernet Adapter
2. D-Link DGE-530T Gigabit Ethernet Adapter # 2
3. D-Link DGE-530T Gigabit Ethernet Adapter #15 (With Yellow,black exclamation mark) Location : Unknown
I am using UpdateDriverForPlugAndPlayDevices() API to install the driver.
Is there any other API need to call before UpdateDriverForPlugAndPlayDevices().
How to select device to install in particular PCI slot.
Or is there any API which takes Location like PCI Slot 3 (PCI bus 4, device 2, function 0) and install driver for
that location.
Any suggestion is most welcome.
Thanks.
Manasi
|
|
|
|
|
UpdateDriverForPlugAndPlayDevices() only works on existing devices.
You can call this first of course, and when it gfails use SetupCopyOEMInf() to do a first time install.
If you get any errors you need to make sure you put all the files in the same place on the hard disk and used that path in the call to setupcopyoeminf.
Morality is indistinguishable from social proscription
|
|
|
|