I/O Address Bit Map and MINIX
Posted: Tue Dec 31, 2013 3:06 pm
I was reading Tanenbaum–Torvalds debate when I found this interesting post about MINIX drivers:
I'm interested in it as I'm trying to write a small microkernel. I have also decided to have kernel-mode drivers in separate address spaces, but then I found this in TSS and I don't know if it wouldn't be better if I chose to use this ability.
Thanks,
Filip.
Few posts later I found this:ast wrote: The I/O drivers are also separate processes (in the kernel, but only because the brain-dead nature of the Intel CPUs makes that difficult to do otherwise)
....
The drivers have to read and write the device registers in I/O space, and
this cannot be done in user mode on the 286 and 386. If it were possible
to do I/O in a protected way in user space, all the I/O tasks could have
been user programs, like FS and MM.
I opened original 80386 manual released in 1986 and there, chapter 8.3.2 informs about I/O permission map, which is able to handle user I/O port access using bit vectors in a task segment. Why couldn't MINIX use it? Linux 0.1 code in kernel/sched.c uses TSS, but getting through a bit of MINX3 code I couldn't find anything. Is it because of some performance penalty when using I/O permission map? Why was the emulation necessary?Jim Burns wrote: > The drivers have to read and write the device registers in I/O space, and
> this cannot be done in user mode on the 286 and 386. If it were possible
> to do I/O in a protected way in user space, all the I/O tasks could have
> been user programs, like FS and MM.
The standard way of doing that is to trap on i/o space protection
violations, and emulate the i/o for the user.
I'm interested in it as I'm trying to write a small microkernel. I have also decided to have kernel-mode drivers in separate address spaces, but then I found this in TSS and I don't know if it wouldn't be better if I chose to use this ability.
Thanks,
Filip.