Age | Commit message (Collapse) | Author |
|
|
|
The `File::can_write` mechanism lets us check that writes won't block,
meaning some bytes can be immediately written to the underlying device.
This means calling `File::write` in a situation where no data could be
written is a logic error, which we `VERIFY()` in `Process::do_write()`.
TTY, in particular, processes the write in 256-byte buffered chunks.
Previously, we would assert that none of these sub-writes returned zero.
This was a logic error, as this rejected some successful writes. For
example, if there was exactly enough free space in `SlavePty`'s internal
buffer for the previous sub-write to complete fully. This made it
impossible to perform writes larger than `SlavePty`'s internal buffer.
Note that it's not an issue if `on_tty_write` returns zero, as partial
writes are handled correctly by the `buffer.read_buffered` helper. We
won't spin in a loop trying to write to a full buffer.
Fixes #8090
|
|
If we have a VGA-capable graphics adapter that we support, we should
prefer it over any legacy VGA because we wouldn't use it in legacy VGA
mode in this case.
This solves the problem where we would only use the legacy VGA card
when both a legacy VGA card as well as a VGA-mode capable adapter is
present.
|
|
Steps to reproduce:
$ cat loop.c
int main() { for (;;); }
$ gcc -o loop loop.c
$ ./loop
Terminating this process wasn't previously possible because we only
checked whether the thread should be terminated on syscall exit.
|
|
This doesn't really matter in terms of writability for the kernel text
because we set up proper page mappings anyway which prohibit writing
to the text segment. However, this makes the profiler happy which
previously died when validating the kernel's ELF program headers.
|
|
Instead, try to create the device objects in separate static methods,
and if we fail for some odd reason to allocate memory for such devices,
just panic with that reason.
|
|
|
|
|
|
We now store the device descriptor obtained from the device
during enumeration in the device's object in memory instead
of exposing all of the different members contained within it.
|
|
USB Devices are now stored so that they may be later retrieved and
operated on (i.e, fetching their assigned device address via
ProcFS)
|
|
Steps to reproduce:
1. Change resolution to 640x480.
2. Change resolution to 1280x1024.
3. Observe the following kernel panic:
Kernel::__panic(char const*, unsigned int, char const*) +0x55
Kernel::handle_crash(Kernel::RegisterState&, char const*, ...) +0x112
page_fault_handler +0x1130
page_fault_asm_entry +0x26
Kernel::VirtualConsole::refresh_after_resolution_change() +0x35e4
Kernel::ConsoleManagement::resolution_was_changed() +0x38b
Kernel::Graphics::FramebufferConsole::set_resolution(...) +0x3e1
Kernel::BochsGraphicsAdapter::try_to_set_resolution(...) +0x319
.L4213 +0x40a
Kernel::Process::sys$ioctl(int, unsigned int, unsigned int) +0x2fa
Kernel::Syscall::handle(Kernel::RegisterState&, ...) +0xfdc
syscall_handler +0x19c0
Kernel::syscall_asm_entry_dummy() +0x31
|
|
inode identifiers in ProcFS are encoded in a way that the parent ID is
shifted 12 bits to the left and the PID is shifted by 16 bits. This
means that the rightmost 12 bits are reserved for the file type or the
fd.
Since the to_fd and to_proc_file_type decoders only decoded the
rightmost 8 bits, decoded values would wrap around beyond values of 255,
resulting in a different value compared to what was originally encoded.
|
|
Since no features inside the 0x80000001 leaf are required for
SerenityOS to work, don't assert if it's unavailable.
|
|
If FXSR is not present, fall back to fnsave and frstor instructions.
These instructions aren't available on the canonical i686 CPU which is
the Pentium Pro processor.
|
|
The fxsave and fxrstor instructions are available only if the FXSR
feature is present.
|
|
The nread variable can't be less than zero anymore.
|
|
|
|
This checks whether the address we're trying to use for DMA is low
enough so as not to overflow the I/O register.
|
|
This ensures that pages returned by
MM.allocate_supervisor_physical_page() have a physical address that
is in the bottom 16MB and can thus be used by the SB16 driver for DMA.
Fixes #8092.
|
|
|
|
|
|
If we are in a shared interrupt handler, the called handlers might
indicate it was not their interrupt, so we should not increment the
call counter of these handlers.
|
|
|
|
When we enumerate the interrupt handlers, it's a good idea to show a
meaningful name to the user instead of "IRQ Handler".
|
|
When asked to enumerate all interrupt handlers, display all shared
handlers within it instead of just returning the responsible handler of
them.
|
|
|
|
|
|
Previously the VirtualConsole::on_tty_write() method would return an
incorrect value when an error had occurred. This prompted me to
update the TTY subsystem to use KResultOr<size_t> everywhere.
|
|
Note that there are a few minor differences between the InlineLinekdList
and IntrusiveList API, so this isn't just a pure data structure change.
- first()/last() instead of head()/tail()
- There is no need for a for_each(..) implementation, as it already
exposes the ability to do range based for loops.
|
|
CLion found these, remove them.
|
|
This has a quirk with the AMD Hudson-2 SATA controller. [1022:7801]
Having this flag set makes the controller become stuck in a busy loop.
I decided to remove the flag instead of making it a quirk as it still
works with Qemu, VirtualBox, VMware Player and the Intel Wildcat
Point-LP SATA Controller [8086:9c83] without it, thus making it simpler
to just remove it.
Partial fix for #7738 (as it still does not work in IDE mode)
|
|
|
|
Previously, when e.g. the `SIGABRT` signal was sent to a process,
`Thread::dispatch_signal()` would invoke
`Process::terminate_due_to_signal()` which would then `::die()`. The
result `DispatchSignalResult::Terminate` is then returned to
`Thread::check_dispatch_pending_signal()` which proceeds to invoke
`Process::die()` a second time.
Change the behavior of `::check_dispatch_pending_signal()` to no longer
call `Process::die()` if it receives `::Terminate` as a signal handling
result, since that indicates that the process was already terminated.
This fixes #7289.
|
|
When you invoke a binary with a shebang line, the `execve` syscall
makes sure to pass along command line arguments to the shebang
interpreter including the path to the binary to execute.
This does not work well when the binary lives in $PATH. For example,
given this script living in `/usr/local/bin/my-script`:
#!/bin/my-interpreter
echo "well hello friends"
When executing it as `my-script` from outside `/usr/local/bin/`, it is
executed as `/bin/my-interpreter my-script`. To make sure that the
interpreter can find the binary to execute, we need to replace the
first argument with an absolute path to the binary, so that the
resulting command is:
/bin/my-interpreter /usr/local/bin/my-script
|
|
|
|
These are the actual structures that allow USB to work (i.e the ones
actually defined in the specification). This should provide us enough
of a baseline implementation that we can build on to support
different types of USB device.
|
|
Let's make it a bit more clear when we're appending the elements from
one vector to the end of another vector.
|
|
This is necessary since the Device class does not hold a reference to
its inode (because there could be multiple), and thus doesn't override
File::stat(). For simplicity, we should just always stat via the inode
if there is one, since that shouldn't ever be the wrong thing.
This partially reverts #7867.
|
|
Because of the 'default' label, the compiler did not warn about the
missing field. The `VERIFY_NOT_REACHED` was moved out of the switch to
fix this.
|
|
Previously we would not block the caller until the connection was
established and would instead return EPIPE for the first send() call
which then likely caused the caller to abandon the socket.
This was broken by 0625342.
|
|
Previously we'd just reset the CPU and reboot.
|
|
Fixes #7910.
|
|
We were accidentally increasing m_bytes_out by the packet size and then
immediately calling send_packet(), which did the same thing as well.
|
|
Specifically chip version 17.
|
|
These are pretty common on older LGA1366 & LGA1150 motherboards.
NOTE: Since the registers datasheets for all versions of the chip
besides versions 1 - 3 are still under NDAs i had to collect
several "magical vendor constants" from the *BSD driver and the
linux driver that i was not able to name verbosely, and as such
these are labeled with the comment "vendor magic values".
|
|
If we do not flush the dirty lines, characters typed in canonical mode
only appear after the virtual console has been switched away from, or
the application has been killed. Instead, we now immediately perform the
flush.
|
|
If lines are removed from the tail of the scrollback buffer, the
previous line indices will refer to different lines; therefore we need
to offset them.
|
|
This commit implements the left/right scrolling used in the `ICH`/`DCH`
escape sequences for `VirtualConsole`. This brings us one step closer to
VT420/xterm compatibility.
We can now finally remove the last escape sequence related `ifdef`s.
|
|
Previously, this was done by telling the client to put a space at each
character in the range. This was inefficient, because a large number of
function calls took place and incorrect, as the ANSI standard dictates
that character attributes should be cleared as well.
The newly added `clear_in_line` function solves this issue. It performs
just one bounds check when it's called and can be implemented as a
pretty tight loop.
|
|
As per the `xterm ctlseqs` documentation, `\e3J` should clear the
scrollback buffer, and leave the visible lines unchanged.
This commit fixes a FIXME.
|