阅读:6029回复:7
how to debug scsi miniport driver with SoftIce?
as title.
|
|
|
沙发#
发布于:2004-05-14 09:34
WinDbg
|
|
|
板凳#
发布于:2004-05-11 17:35
[quote][quote]在控制面板 停用设备-->设断点-->启用设备 启用设备后会提示系统配置改变,需重启,设置的断点也没起作用。 工作环境为2K/XP [/quote] 调试SCSI mimiport驱动有点特殊,因为它在SoftICE之前加载,所以你的断点拦不到。 解决方法如下(不一定是最好的,但肯定可行,我以前一直这么作): 1. 启动Symbol Loader 2. EDIT -> SoftICE Initialization Settings 3. 在 Symbols 中添加你的驱动的符号文件 4. 在 General 中的Initialization文本框中输入: BPX DriverEntry; 即可拦截你的驱动的DriverEntry例程。你也可以设置别的断点。 5. 运行ICEPack.exe (在SoftICE目录下,如果你的驱动有更新,需要再次运行,它的用途看softICE的帮助吧) 6.在Startup中设置Boot Mode (SoftICE启动模式设置,选择在什么时候启动SoftICE)为boot: Boot: 在Windows启动之前加载SoftICE,主要是用于跟踪调试在Windows启动过程中加载的驱动程序,当然也可以调试所有的应用级程序。 7. 打开注册表中 Service下面,找到你的SCSI Miniport的Service键,将它的Start值改为1(原来应该是0).这一步保证SoftICE早于你的miniport加载. 8. Reboot [/quote] 按照你说的设置好了,reboot后提示driverentry symbol not found,跳出softice后就直接启动进系统了。 我的scsi miniport是虚拟一个scsi硬盘,系统启动后却提示无法正确启动设备,不知是什么原因? thanks in advance. |
|
|
地板#
发布于:2004-05-10 18:55
[quote]在控制面板 停用设备-->设断点-->启用设备 启用设备后会提示系统配置改变,需重启,设置的断点也没起作用。 工作环境为2K/XP [/quote] 调试SCSI mimiport驱动有点特殊,因为它在SoftICE之前加载,所以你的断点拦不到。 解决方法如下(不一定是最好的,但肯定可行,我以前一直这么作): 1. 启动Symbol Loader 2. EDIT -> SoftICE Initialization Settings 3. 在 Symbols 中添加你的驱动的符号文件 4. 在 General 中的Initialization文本框中输入: BPX DriverEntry; 即可拦截你的驱动的DriverEntry例程。你也可以设置别的断点。 5. 运行ICEPack.exe (在SoftICE目录下,如果你的驱动有更新,需要再次运行,它的用途看softICE的帮助吧) 6.在Startup中设置Boot Mode (SoftICE启动模式设置,选择在什么时候启动SoftICE)为boot: Boot: 在Windows启动之前加载SoftICE,主要是用于跟踪调试在Windows启动过程中加载的驱动程序,当然也可以调试所有的应用级程序。 7. 打开注册表中 Service下面,找到你的SCSI Miniport的Service键,将它的Start值改为1(原来应该是0).这一步保证SoftICE早于你的miniport加载. 8. Reboot |
|
|
地下室#
发布于:2004-05-10 17:42
有时候是会提示重起,看运气,最好先启用再重起,下次再试,呵呵。
一般是PNP没做好,你的SCSI设备出来没有,用winobj看得到吗? |
|
5楼#
发布于:2004-05-10 17:14
在控制面板 停用设备-->设断点-->启用设备 启用设备后会提示系统配置改变,需重启,设置的断点也没起作用。 工作环境为2K/XP |
|
|
6楼#
发布于:2004-05-05 11:19
This is copy form document of compuware,I hope you can got your anwser.
But it can not use under windows xp ,and windows 2000 with service pack. Debugging boot mode drivers FAQID1299 2002-05-31 Q: I want to debug a boot mode driver and SoftICE isn\'t starting early enough. How do I make SoftICE load earlier to debug these boot mode drivers? A: Using SoftICE to Debug Boot Mode Drivers Some drivers are loaded prior to softice loading and it is not possible to set breaks on the entry of these drivers. To resolve that we can get softice to load early. The steps are as follows. 1. Using regedt32 go to HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder. 2. After \"system reserved\" and before \"boot bus extender\" add \"Ntice\". 3. Run the settings dialog and go to softice initialization settings. Remove the \"x;\" from the init string. 4. Reboot. 5. When softice stops during boot type \"mod\". If a list of loaded modules is NOT returned then do the steps under \"Obtaining a mod list\" if the module list is present you can proceed with step 6. Either way continue booting. 6. Go into the setting dialog under softice then symbols. Here is were you need to add all the symbols you will need for this debug session. 7. Run the icepack.exe utility form the softice directory. This will package up debug symbols, settings and OS info for early use. Run Icepack after any changes. 8. Go to regedit and add the following items (or verify them if they exist). HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\siwsym (Add the key if it does not exist). DWORD named \"Type\" set to 1. STRING named \"Group\" set to \"NTICE\". DWORD named \"ErrorControl\" set to 1. DWORD named \"Start\" set to 0. DWORD named \"Tag\" set to 1. 9. Verify that the siwsym.sys is in the system32\\drivers directory if not move it there. 10. Reboot and you will stop with an early loaded softice and be able to set a break on your drivers entry points etc.. ///////////////////////////////////////////// NOTE: If you change anything in the settings or recompile etc.. You must rerun the icepack utility. ///////////////////////////////////////////// OBTAINING A MODULE LIST. 1. This step is only needed if the mod command does not work when loading softice early 2. If it exist remove Ntice from HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder using regedt32. 3. Check that the \"x;\" is remove from softice\'s init string (Running icepack if presently being used). 4. In the settings dialog under softice symbols add the symbols for ntoskrnl. Steps for this are located below under \"Tranlsating system files\". 5. Reboot the machine. 6. When it stops at boot type \"sym _psLoadedModiuleList\". note the address of the list. 7. Continue booting as normal. 8. Once booted then use regedit and go to HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\siwvid and add a DWORD value called \"modPtrLocation\" and set its value to the address of the module list obtained in the previous step. NOTE: you may need this under the ntice registry key also depending on the verison of softice. 9. Using regedt32 go to HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder. 10. After \"system reserved\" and before \"boot bus extender\" add \"Ntice\". 11. Go to step 6 above. TRANSLATING NTOSKRNL TO GET SYMBOLS 1. Find the correct ntoskrnl.exe for you machine. To do this right click on ntoskrnl.exe and select properties. Then select the version tab and then the original file name view. 2. If the original file name was something other than ntoskrnl.exe then copy and rename the copy of ntoskrnl back to its original name. 3. Copy the ntoskrnl.dbg (or pdb) that matches the original ntoskrnl.exe into the same directory as the exe. 4. Open SoftICE symbol loader. 5. Open the ntoskrnl.exe and translate the executable. 6. If the exe was renamed due to the original file name then rename the resulting nms file back to ntoskrnl.nms 7. Add ntoskrnl.nms to your list of symbol files to load at start using the SoftICE init settings dialog. To do this: 1. Open symbol loader. 2. From the edit menu choose \"SoftICE initialization settings\". 3. Go to \"symbols\" in the left side tree. 4. Use the add button and navigate to the nms file that you made and add it to the list. |
|
7楼#
发布于:2004-04-30 16:03
在控制面板 停用设备-->设断点-->启用设备
|
|