diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-08 01:23:23 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-08 01:23:47 +0100 |
commit | da3857b0c23a4e99edc2481c93c7f3bebda510cc (patch) | |
tree | e32c162d311a06f3678b28a967344b04c9f77ee0 /Kernel/VirtualConsole.cpp | |
parent | e287f8ef3adc88112e1c2336adc4a27365058db8 (diff) | |
download | serenity-da3857b0c23a4e99edc2481c93c7f3bebda510cc.zip |
Add some simple write buffering to LibC's stdio.
Plumb it all the way to the VirtualConsole. Also fix /bin/cat to write()
the whole chunks we get from read() directly to stdout.
Diffstat (limited to 'Kernel/VirtualConsole.cpp')
-rw-r--r-- | Kernel/VirtualConsole.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Kernel/VirtualConsole.cpp b/Kernel/VirtualConsole.cpp index 6512758c92..d77fb06888 100644 --- a/Kernel/VirtualConsole.cpp +++ b/Kernel/VirtualConsole.cpp @@ -320,7 +320,6 @@ void VirtualConsole::put_character_at(unsigned row, unsigned column, byte ch) void VirtualConsole::on_char(byte ch, bool shouldEmit) { - InterruptDisabler disabler; if (shouldEmit) emit(ch); @@ -397,15 +396,18 @@ void VirtualConsole::onKeyPress(Keyboard::Key key) void VirtualConsole::onConsoleReceive(byte ch) { + InterruptDisabler disabler; auto old_attribute = m_current_attribute; m_current_attribute = 0x03; on_char(ch, false); m_current_attribute = old_attribute; } -void VirtualConsole::onTTYWrite(byte ch) +void VirtualConsole::onTTYWrite(const byte* data, size_t size) { - on_char(ch, false); + InterruptDisabler disabler; + for (size_t i = 0; i < size; ++i) + on_char(data[i], false); } String VirtualConsole::ttyName() const |