os-series
os-series copied to clipboard
Im trying to make input.
Is there any way I can include stdio.h or something just to get scanf func, or how to make it and include it like in print.h thanks in advance
probably not, i tried
Adding input requires that you add:
- interrupt handlers / interrupt service routines
- the interrupt descriptor table
- PIC support
and various other items before you can even begin to add keyboard support. I'm sure we'll get there eventually, but it'll take at least an episode or two more before we are there (if we keep up the current pace, that is).
take a look at this
I went and started implementing this
thx
Issue #14 is also helpfull
I went and started implementing this
This seems a very good start, but it has several problems that should be fixed:
- There is an unneeded delay between pressing different keys and there is too short delay between autorepeating the same key that is pressed for a long time. Probably, as a start, "no autorepeating at all" seems a good strategy, because actually autorepeating is usually needed only for long cursor movement and long backspaces.
- Delay currently depends on CPU speed. Using timer will be better. Do you have ideas how to implement this?
- Depressing Left Shift still continues to input upper case letters.
- Caps lock is not processed correctly - instead it is processed as some unknown key.
- Pressing Right Shift hangs the whole program.
- Pressing Backspace results in strange behavior when near left edge of the screen.
I went and started implementing this
Thank you so much for your inspiration! It is interesting that input can be implemented without interrupts. I tried to improve input code:
- Removed delay between different characters, added longer delay before first symbol autorepeat
- Fixed shift keys
- Return string that was input
- Return if Enter or Esc was pressed
- Added cursor movement
- Added color spin to demonstrate how to do multiple tasks without threads
I also implemented precise nanosleep and added beep.
https://github.com/rualark/SimpleOsDemo