What's this "for"? I don't think it'll work on "normal PC hardware", but given hardware that behaves as you apparently expect, I guess you're on the right track. Previously, you posted some 64-bit code. I guess this is supposed to be 32-bit, but some of it appears to be 16-bit(?).
As you know (I assume), this generates a flock of errors, as posted. The most serious error, I think, is:
putchar: mov string, al ; initialize string
You almost certainly want "[string]" there.
Lessee... "resd" requires a parameter, and "res?" need to be in "section .bss" - don't forget to switch back to "section .text" before the code! (this may not be a problem in "-f obj" output mode.) Several errors about size not specified - I assumed that ports are "byte" and strptr is "dword". I had to make "getchar", "OS.SUSPEND" and "OS.RESUME" extern (since you've provided "putchar", I suspect you intend to provide "getchar"(?) - no idea about "OS.?"...) I got it to assemble without complaint, but that doesn't mean it's right.
I'm concerned about this section:
khandler: sti ; Re-enable interrupts
push ax ; Save register ax
mov al, [Kdataport] ; Read ASCII char
push ax ; Parameter in AL part
call putchar
add esp, 2
pop ax ; Restore register ax
iret
If this is 32-bit code, you want to push/pop eax, and add esp, 4. Currently, "putchar" doesn't get its parameter from the stack - just uses al - so I'm not sure what's intended. You seem to be putting characters into the first byte of [string], but reading them out from strptr, which you increment. That may need some adjusting(?)...
The way the bios handles the keyboard, there's a buffer... and two pointers into it, one for "last character written" (or "next character position" if it's incremented first), and another to "last character read". You may want to do something like that... so if your user can type faster than your printer can print, the characters are buffered, not "lost" (until the buffer fills up).
So I think you're on the right track, but I think you've got a way to go. ("I don't know where we're going, but we're making really good time!:
)