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.
Simple problem in my opinion, but i'm unable to solve it.
I don't want user space programs to execute I/O instructions (IN, OUT,...). Bochs reports me EFLAGS is 0x202 (so IOPL is 0) and CS is 0x1B (so CPL is 3). Conclusion: CPL(3)>IOPL(0). That means the processor should checks the I/O bitmap in the TSS, which I do not have:
Yes, the IO permission bitmap is incorrect (it points to the first byte in the TSS). Normally, you would want it to point to a location beyond the register save area, and the last byte in the TSS should be FF.