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.
use asm volatile anyway and there is nothing wrong with the code. however at what ring is it executed? If it's executed on ring 0 i don't understand the problem on any other ring you should have enable the access to io via the io_bitmap of the tss or via the flags. If you didn't do that it would generate an exception. Its all in the manuals
Have you checked the value of EIP when the program crashes and cross-referenced that with an objdump of your kernel? It may for some reason not be calling on an instruction boundary (some kind of stack craziness maybe).
Are you running it in bochs? If so check bochsout.txt, it should dump the register state when it encounters an illegal instruction.
I can't actually remember whether illegal instruction triggers an exception or an immediate restart. If it triggers an exception you can inspect the EIP field the processor pushes to the stack. (I don't think it does cause an exception though... at work atm so can't check)
the code is ok as it i the same as mine. so it is something else. I strongly suggest that you learn to use bochs because the internal debugger is very handy as in situation like this.
PS. Regarding your signature, I am not over-educated. Funny though