Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I am on the part of my OS where I am trying to manage ports using a device manager (in its own separate task space at present). I am currently running this device manager at CPL=3.
So, when I launch the device manager, I set IOPL to 3, whereas normally, IOPL=0 for my user tasks.
The thing is, I would expect a port read to cause a GPF exception in ring 3 when IOPL=0, but in Bochs, I get the error message:
I have tried setting my TSS limit higher. I have been setting the IO Map field of my TSS to NULL, but have even tried creating a zeroed IO Map and I still get the same error message.
To make sure that no I/O permission bitmap (in the TSS) is used, you need to make the I/O bitmap base address greater than or equal to the TSS limit.
Basically, just put the value 0xFFFF at offset 0x66 in your TSS...
BTW for the I/O permission bitmap, '0' means allow access to the I/O port and '1' means don't allow access. Filling an I/O permission bitmap with zero will allow everything.
Also note that for some reason the information about the I/O permission bitmap is in Intel's "Basic Architecture" manual and not in the "System Programming Guide". I have no idea why (seems like it's in the wrong place to me)...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
I am on the part of my OS where I am trying to manage ports using a device manager (in its own separate task space at present). I am currently running this device manager at CPL=3.
So, when I launch the device manager, I set IOPL to 3, whereas normally, IOPL=0 for my user tasks.
The thing is, I would expect a port read to cause a GPF exception in ring 3 when IOPL=0, but in Bochs, I get the error message: