diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-01 01:04:02 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-01 01:05:59 +0100 |
commit | a685809e754005dca5dd8abc78b3de677bf64f8e (patch) | |
tree | fdb41c963f28474a57195063151eeef9daa0b898 /Kernel/VirtualConsole.cpp | |
parent | 9a086b2d3584f13d47e8d625035fe72cc2f3aea2 (diff) | |
download | serenity-a685809e754005dca5dd8abc78b3de677bf64f8e.zip |
Waiters should be notified when a waitee is killed.
Ran into a horrendous bug where VirtualConsole would overrun its buffer
and scribble right into some other object if we were interrupted while
processing a character. Slapped an InterruptDisabler onto onChar for now.
This provokes an interesting question though.. if a process is killed
while its in kernel space, how the heck do we release any locks it held?
I'm sure there are many different solutions to this problem, but I'll
have to think about it.
Diffstat (limited to 'Kernel/VirtualConsole.cpp')
-rw-r--r-- | Kernel/VirtualConsole.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/VirtualConsole.cpp b/Kernel/VirtualConsole.cpp index 433b438d48..6395fa03e1 100644 --- a/Kernel/VirtualConsole.cpp +++ b/Kernel/VirtualConsole.cpp @@ -300,6 +300,8 @@ void VirtualConsole::scrollUp() void VirtualConsole::setCursor(unsigned row, unsigned column) { + ASSERT(row < m_rows); + ASSERT(column < m_columns); m_cursorRow = row; m_cursorColumn = column; if (m_active) @@ -308,6 +310,8 @@ void VirtualConsole::setCursor(unsigned row, unsigned column) void VirtualConsole::putCharacterAt(unsigned row, unsigned column, byte ch) { + ASSERT(row < m_rows); + ASSERT(column < m_columns); word cur = (row * 160) + (column * 2); m_buffer[cur] = ch; m_buffer[cur + 1] = m_currentAttribute; @@ -317,6 +321,7 @@ void VirtualConsole::putCharacterAt(unsigned row, unsigned column, byte ch) void VirtualConsole::onChar(byte ch, bool shouldEmit) { + InterruptDisabler disabler; if (shouldEmit) emit(ch); |