浏览代码

stdio: fix broken ReadC logic

Looping inside ReadC broke the shell's hook logic. We have to
return immediately when nothing is typed.
pull/10/head
Virgil Dupras 5 年前
父节点
当前提交
23354eba94
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      kernel/stdio.asm

+ 4
- 1
kernel/stdio.asm 查看文件

@@ -112,11 +112,14 @@ printHexPair:
;
; This routine also takes care of echoing received characters back to the TTY.
;
; This routine doesn't wait after a typed char. If nothing is typed, we return
; immediately with Z flag unset.
;
; Note that this routine doesn't bother returning the typed character.
stdioReadC:
; Let's wait until something is typed.
call stdioGetC
jr nz, stdioReadC ; nothing typed? loop
ret nz ; nothing typed? nothing to do
; got it. Now, is it a CR or LF?
cp ASCII_CR
jr z, .complete ; char is CR? buffer complete!


正在加载...
取消
保存