What is the purpose of io_wait, and what does it do?
Posted: Wed Feb 17, 2016 1:50 am
Hello,
I've been looking to implementing interrupts in my OS, and I was looking at the basic IO functions the wiki provides. I've written my own versions of inx and outx in full assembly instead of inline, since I'm more comfortable with full assembly and it looks cleaner, and now I need to implement the io_wait function if I'm going to follow the advice of the wiki when it comes to programming the PICs. My question is, what does the io_wait function on the wiki do, and why is it required when reprogramming the PICs? I implemented cursor movement in text mode using the VGA registers, which are accessed by ports, and they don't seem to require any kind of explicit waiting period, so what makes the PICs unique?
Also, the code on the wiki, http://wiki.osdev.org/Inline_Assembly/Examples#IO_WAIT shows 2 methods of implementing a wait function, one apparently just doing 2 consecutive jumps and the other writing to an unused port. How do each of these methods actually work, and if I were to implement something in full assembly, what would be the *best* way of going about it?
I think my OS code isn't really relevant to this question, but I can provide it if necessary.
Thanks for reading,
Mikumiku747
I've been looking to implementing interrupts in my OS, and I was looking at the basic IO functions the wiki provides. I've written my own versions of inx and outx in full assembly instead of inline, since I'm more comfortable with full assembly and it looks cleaner, and now I need to implement the io_wait function if I'm going to follow the advice of the wiki when it comes to programming the PICs. My question is, what does the io_wait function on the wiki do, and why is it required when reprogramming the PICs? I implemented cursor movement in text mode using the VGA registers, which are accessed by ports, and they don't seem to require any kind of explicit waiting period, so what makes the PICs unique?
Also, the code on the wiki, http://wiki.osdev.org/Inline_Assembly/Examples#IO_WAIT shows 2 methods of implementing a wait function, one apparently just doing 2 consecutive jumps and the other writing to an unused port. How do each of these methods actually work, and if I were to implement something in full assembly, what would be the *best* way of going about it?
I think my OS code isn't really relevant to this question, but I can provide it if necessary.
Thanks for reading,
Mikumiku747