Skip to content

fix(ostool): throttle shell init input#148

Merged
ZR233 merged 1 commit into
mainfrom
codex/qemu-shell-init-throttle
Jun 26, 2026
Merged

fix(ostool): throttle shell init input#148
ZR233 merged 1 commit into
mainfrom
codex/qemu-shell-init-throttle

Conversation

@ZR233

@ZR233 ZR233 commented Jun 26, 2026

Copy link
Copy Markdown
Member

问题

rcore-os/tgoskits#1391 中的 Starry x86_64 tty-console-input-burst CI 超时并不是单个测试超时时间不足。失败日志显示系统已经进入 Starry shell,并开始接收 shell_init_cmd heredoc,但后续 EOF 和执行命令没有稳定完成。

根因在 ostool 的自动 shell 初始化输入路径:检测到 shell_prefix 后,当前实现会把整个 shell_init_cmd 作为一个大块一次性写入 QEMU/serial stdin。长 heredoc 会形成输入 burst,容易超过 guest console/TTY 的处理窗口,导致 shell 初始化命令卡在半途。

修改

  • TerminalHandle 增加 send_after_chunks,支持延迟后按固定大小拆分输入,并在 chunk 间短暂让出。
  • 将 QEMU、HTTPBoot board、U-Boot 的自动 shell_init_cmd 注入改成 64 字节一块、块间 2ms 发送。
  • 保持普通交互输入和 boot offer 等其他自动发送路径不变。
  • 增加单元测试,覆盖长输入会被拆分发送。

验证

  • cargo fmt --all -- --check
  • cargo clippy --target x86_64-unknown-linux-gnu --all-features
  • cargo test --target x86_64-unknown-linux-gnu -- --nocapture
  • 在 tgoskits 中通过 [patch.crates-io] 指向本地 ostool 后验证原失败用例:
    cargo xtask starry test qemu --arch x86_64 -c qemu-smp1/tty-console-input-burst
    结果:PASS tty-console-input-burstall starry qemu tests passed

Fixes rcore-os/tgoskits#1391

@ZR233 ZR233 merged commit 1838bdf into main Jun 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(starry): x86_64 tty-console-input-burst times out after serial IRQ refactor

1 participant