If my program contains in out instructions and I want debug it using kolibri debugger Mtdbg, I get ??? at memory locations where I have thses instructions and when exection reaches these instructions I get this message Debugged Program Caused an exception 0D.Suspended.
Why is this heppening?
Could any body help?
Mtdbg and in out instructions.
If you watch the source code debugger, a message is issued in the following cases:
or
Code: Select all
; int3 command generates exception 0D, #GP
Code: Select all
; check for 0xCC byte at eip
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!
in and out instructions are privileged. User-mode code is not allowed to use them, they are intended for the kernel and drivers.
Сделаем мир лучше!
This means I cannot debug my code if it contains these instructions?There is no way to do that?
Mohsen47
Your application can request port i/o permissions with fn 46.
Alternatively, you can easily modify your Kernel to enable any in/out command in the userspace.
Your application can request port i/o permissions with fn 46.
Alternatively, you can easily modify your Kernel to enable any in/out command in the userspace.
art_zh
Thanks for the tip it worked well, but there is a little problem I tried to reserve the io port range for pci from 0xcf8 to 0xcfc and I was able to write a double word to pci config register but when I try to read a double word from pci data register I get the same exception, I am only able to read a word from data register, why is this?
Thanks for the tip it worked well, but there is a little problem I tried to reserve the io port range for pci from 0xcf8 to 0xcfc and I was able to write a double word to pci config register but when I try to read a double word from pci data register I get the same exception, I am only able to read a word from data register, why is this?
If you attach your full source code, it would be much easier to help you.
Mohsen47
PCI ports are restricted system resources.
Use fn 62 to access PCI configspace
(in Kolibri-A you will also enjoy MMIO access to the Extended PCIe configspace, but it only runs on AMD Fusion).
PCI ports are restricted system resources.
Use fn 62 to access PCI configspace
(in Kolibri-A you will also enjoy MMIO access to the Extended PCIe configspace, but it only runs on AMD Fusion).
Thanks for your interest guys.
This is my simple code:
This code doesn't work and gives me the same exception at instruction but if I replace it with it works and allows me to read the vendor id only in the lower two bytes of eax but I cannot get the device id.
I don't want to use fn 62 to access PCI configspace because I want to move this code to my OS so I want to accomplish this only using assembly instruction that are provided in every assembler, I am using kolbri because it is simple and allows me to debug the assembly code very easily.
This is my simple code:
Code: Select all
mov eax,46
mov ebx,0
mov ecx,0xcf8
mov edx,0xcfd
int 0x40
cmp eax,1
je exit
mov eax,0x80001800 ;get the vendor and device id for device number 3 in pci bus number 0 which is my network interface.
mov dx,0xcf8
out dx,eax
mov dx,0xcfc
in dx,eax
exit:
Code: Select all
in dx,eax
Code: Select all
in ax,dx
I don't want to use fn 62 to access PCI configspace because I want to move this code to my OS so I want to accomplish this only using assembly instruction that are provided in every assembler, I am using kolbri because it is simple and allows me to debug the assembly code very easily.
Probably it will help to you:Mohsen47 wrote:I don't want to use fn 62 to access PCI configspace because I want to move this code to my OS so I want to accomplish this only using assembly instruction that are provided in every assembler, I am using kolbri because it is simple and allows me to debug the assembly code very easily.
core/taskman.inc
Code: Select all
mov [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!
Thanks Mario_r4.
Actually I don't have all the source code on my computer but when I have it I will try what you said, really thanks a lot.
Actually I don't have all the source code on my computer but when I have it I will try what you said, really thanks a lot.
Who is online
Users browsing this forum: No registered users and 0 guests