Skip to content

Block process while waiting for keyboard input#34

Merged
ryuukumar merged 6 commits intohw/keyboardfrom
process/blocked-state
Apr 25, 2026
Merged

Block process while waiting for keyboard input#34
ryuukumar merged 6 commits intohw/keyboardfrom
process/blocked-state

Conversation

@ryuukumar
Copy link
Copy Markdown
Owner

No description provided.

@ryuukumar ryuukumar changed the base branch from main to hw/keyboard April 25, 2026 06:14
@ryuukumar ryuukumar merged commit c4f57ba into hw/keyboard Apr 25, 2026
1 check passed
@ryuukumar ryuukumar deleted the process/blocked-state branch April 25, 2026 06:15
ryuukumar added a commit that referenced this pull request Apr 25, 2026
* Setup basic keyboard init

* Add keyboard interrupt handler

* Ignore compile_commands.json

* Remove return from kb_handler and mark registers unused

* Fix bug where kb handler would permahang because IRQ would be permaset

* Add a keypress map

* Include it + minor fixes

* Add some extended keyboard actions

* Add some util functions

* Add statemachine struct and parser for scancode 1

* Use map_keypress in keyboard handler

* Remove the while loop from the handler

* Add pop_next_char

* Expose do_sched_yield

* Add stdin_read

* Add optional tty handler which keyboard may call

* Block process while waiting for keyboard input (#34)

* Add inode info

* Inject chardev_info

* Add a simple process block

* Add block and unblock

* Format

* Block process when char unavailable

* Fix issue causing a permaloop + format

* Hover the user process

Without this, the kernel process also goes unblocked, which means the scheduler sees that there are no processes to run. That causes it to hang, since we do not handle that specially.

* Change the hover loop of kernel thread to echo keypresses

* Filter by regular character only (no action keys)

* Remove the print statement for every keypress

* Handle backspaces in console

* do_sched_yield can be static
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.

1 participant