summaryrefslogtreecommitdiff
path: root/Kernel/API
AgeCommit message (Collapse)Author
2022-01-23Kernel: Add ioctl to get the EDID from a framebufferTom
2022-01-23Kernel/Devices: Introduce the Device Control DeviceLiav A
This device will assist userspace to manage hotplug events. A userspace application reads a DeviceEvent entry until the return value is zero which indicates no events that are queued and waiting for processing. Trying to read with a buffer smaller than sizeof(DeviceEvent) results in EOVERFLOW. For now, there's no ioctl mechanism for this device but in the future an acknowledgement mechanism can be implemented via ioctl(2) interface.
2022-01-20Kernel: Add horizontal mouse scroll supportDmitry Petrov
2022-01-12Kernel+LibC+LibCore+UE: Implement `fchmodat(2)`Daniel Bertalan
This function is an extended version of `chmod(2)` that lets one control whether to dereference symlinks, and specify a file descriptor to a directory that will be used as the base for relative paths.
2022-01-09Everywhere: Add `serenity_dev_{makedev,major,minor}`Michel Hermier
Add them in `<Kernel/API/Device.h>` and use these to provides `{makedev,major,minor}` in `<sys/sysmacros.h>`. It aims to be more in line with other Unix implementations and avoid code duplication in user land.
2022-01-08Kernel: Remove EWHYTHO error code :^)Andreas Kling
This error code was a hack for catching error handling mistakes in the kernel. It's no longer used anywhere.
2022-01-04Kernel: Update key_code_countAatos Majava
This was not updated when the Menu button was added.
2022-01-03Kernel: Allow backspace '\b' to be remappedCorey Williamson
Previously, one could put '\b' in a keymap, but in non-Terminal applications, it would just insert a literal '\b' character instead of behaving like backspace. This patch modifes `visible_code_point_to_key_code` to include backspace, as well as renaming it to `code_point_to_key_code` since '\b' is not a visible character. Additionally, `KeyboardDevice::key_state_changed` has been rearranged to apply the user's keymap before checking for things like caps lock.
2022-01-01Kernel+LibC+LibCore: Add lchown and fchownat functionscircl
This modifies sys$chown to allow specifying whether or not to follow symlinks and in which directory. This was then used to implement lchown and fchownat in LibC and LibCore.
2021-12-29Kernel: Add EPROMISEVIOLATION as a kernel ErrnoCodeBrian Gianforcaro
2021-12-29Kernel+LibC: Add ECANCELED errno valueDaniel Bertalan
This is needed for clangd to compile.
2021-12-28Kernel: Implement and use the syscall/sysret instruction pair on x86_64Owen Smith
2021-12-28Kernel: Add _SC_MAPPED_FILES sysconf APIBrian Gianforcaro
This is mandated by POSIX, it's fine that we don't actually implement it, just as long as it's present during compilation. :^)
2021-12-28LibC: Add in6addr_loopback and IN6ADDR_LOOPBACK_INIT constantBrian Gianforcaro
Much like the existing in6addr_any global and the IN6ADDR_ANY_INIT macro, our LibC is also expected to export the in6addr_loopback global and the IN6ADDR_LOOPBACK_INIT constant. These were found by the stress-ng port.
2021-12-23Kernel+UE+LibC: Store address as void* in SC_m{re,}map_paramsDaniel Bertalan
Most other syscalls pass address arguments as `void*` instead of `uintptr_t`, so let's do that here too. Besides improving consistency, this commit makes `strace` correctly pretty-print these arguments in hex.
2021-12-23Kernel+UE: Add MAP_FIXED_NOREPLACE mmap() flagDaniel Bertalan
This feature was introduced in version 4.17 of the Linux kernel, and while it's not specified by POSIX, I think it will be a nice addition to our system. MAP_FIXED_NOREPLACE provides a less error-prone alternative to MAP_FIXED: while regular fixed mappings would cause any intersecting ranges to be unmapped, MAP_FIXED_NOREPLACE returns EEXIST instead. This ensures that we don't corrupt our process's address space if something is already at the requested address. Note that the more portable way to do this is to use regular MAP_ANONYMOUS, and check afterwards whether the returned address matches what we wanted. This, however, has a large performance impact on programs like Wine which try to reserve large portions of the address space at once, as the non-matching addresses have to be unmapped separately.
2021-12-22LibC: Add support for `posix_madvise(..)`Brian Gianforcaro
Add the `posix_madvise(..)` LibC implementation that just forwards to the normal `madvise(..)` implementation. Also define a few POSIX_MADV_DONTNEED and POSIX_MADV_NORMAL as they are part of the POSIX API for `posix_madvise(..)`. This is needed by the `fio` port.
2021-12-22Kernel: Add the si_errno and si_band siginfo_t membersIdan Horowitz
These 2 members are required by POSIX and are also used by some ports. Zero is a valid value for both of these, so no further work to support them is required.
2021-12-22Kernel: Move userspace virtual address range base to 0x10000Idan Horowitz
Now that the shared bottom 2 MiB virtual address mappings are gone userspace can use lower virtual addresses.
2021-12-22Kernel+LibC: Stub out getifaddrs() and freeifaddrs()Idan Horowitz
These are required for some ports.
2021-12-22Kernel+LibC: Stub out if_nameindex() and if_freenameindex()Idan Horowitz
These should allow users to receive the names of network interfaces in the system, but for now these are only stubs required to compile some ports.
2021-12-22Kernel: Define and return the ARPHRD_* device type in SIOCGIFHWADDRIdan Horowitz
The sa_family field in SIOCGIFHWADDR specifies the underlying network interface's device type, this is hardcoded to generic "Ethernet" right now, as we don't have a nice way to query it.
2021-12-21Kernel: Implement sysconf(_SC_SYMLOOP_MAX)Martin Bříza
Not much to say here, this is an implementation of this call that accesses the actual limit constant that's used by the VirtualFileSystem class. As a side note, this is required for my eventual Qt port.
2021-12-16Kernel+LibC: Move errno definitions to Kernel/API/POSIXsin-ack
This fixes at least half of our LibC includes in the kernel. The source of truth for errno codes and their description strings now lives in Kernel/API/POSIX/errno.h as an enumeration, which LibC includes.
2021-12-12Kernel: Remove sys$select() syscallJean-Baptiste Boric
Now that the userland has a compatiblity wrapper for select(), the kernel doesn't need to implement this syscall natively. The poll() interface been around since 1987, any code still using select() should be slapped silly. Note: the SerenityOS source tree mostly uses select() and not poll() despite SerenityOS having support for poll() since early 2019...
2021-12-12Kernel+LibC: Implement sigtimedwait()Idan Horowitz
This includes a new Thread::Blocker called SignalBlocker which blocks until a signal of a matching type is pending. The current Blocker implementation in the Kernel is very complicated, but cleaning it up is a different yak for a different day.
2021-12-05Kernel: Implement new ptrace function PT_PEEKBUFBen Wiederhake
This enables the tracer to copy large amounts of data in a much saner way.
2021-12-05Kernel+strace: Remove unnecessary indirection for PEEKBen Wiederhake
Also, remove incomplete, superfluous check. Incomplete, because only the byte at the provided address was checked; this misses the last bytes of the "jerk page". Superfluous, because it is already correctly checked by peek_user_data (which calls copy_from_user). The caller/tracer should not typically attempt to read non-userspace addresses, we don't need to "hot-path" it either.
2021-12-05Kernel: Define PT_WRITE_I and PT_WRITE_DIdan Horowitz
These are aliases for PT_POKE that are used in some *BSDs.
2021-12-05Kernel: Add support for the POLLWRBAND poll eventIdan Horowitz
2021-12-05Kernel: Define the POLLRDNORM alias for POLLINIdan Horowitz
This flag is equivalent to POLLIN.
2021-12-05Kernel: Define the POLLWRNORM alias for POLLOUTIdan Horowitz
This is defined by posix to be equivalent to POLLOUT
2021-12-05Kernel: Add the IPPROTO_{IGMP, IPIP, RAW} protocol macrosIdan Horowitz
These are not implemented currently, but are required for some ports to compile.
2021-12-05Kernel: Add the IP_{BLOCK_SOURCE, UNBLOCK_SOURCE, OPTIONS} macrosIdan Horowitz
These are not implemented currently, but are required for some ports to compile.
2021-12-05Kernel: Add the SO_OOBINLINE SOL_SOCKET-level option macroIdan Horowitz
This is not actually implemented, as we don't have any support for out-of-band right now, but this is required for some ports to compile.
2021-12-05Kernel: Implement the SO_DONTROUTE SOL_SOCKET-level optionIdan Horowitz
2021-12-05Kernel: Implement the SO_ACCEPTCONN SOL_SOCKET-level optionIdan Horowitz
2021-12-05Kernel: Stub out the SO_DEBUG SOL_SOCKET-level optionIdan Horowitz
2021-12-05Kernel: Add support for the MSG_WAITALL sys$recvmsg flagIdan Horowitz
2021-12-05Kernel: Add support for the MSG_DONTROUTE sys$sendmsg flagIdan Horowitz
2021-12-04Kernel: Wrap x86 assembly behind `ARCH(...)` in Syscall.hDaniel Bertalan
Unlike GCC, Clang parses assembly eagerly, and immediately rejects inline assembly that's not for the right architecture.
2021-12-01Kernel+LibC: Implement sigaltstack()Idan Horowitz
This is required for compiling wine for serenity
2021-12-01LibC: Define the MADV_DONTNEED madvise advice macroIdan Horowitz
This isn't actually implemented at the moment, but it is required for wine to compile
2021-12-01LibC: Make the madvise advice field a value instead of a bitfieldIdan Horowitz
The advices are almost always exclusive of one another, and while POSIX does not define madvise, most other unix-like and *BSD systems also only accept a singular value per call.
2021-12-01LibC: Add the SIGFPE si_code macrosIdan Horowitz
2021-11-26Kernel: Ensure KeyEvent::key sent to Userspace respects keyboard layoutmacarc
Before, only KeyEvent::code_point took the user's keyboard layout into consideration, while KeyEvent::key was hardcoded QWERTY. This affected, among other things, Vim Emulation. Now, KeyEvent::key respects the user's keyboard layout, so will be the same as KeyEvent::code_point for visible (alphanumeric + symbol) keys. Co-Authored-By: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
2021-11-24Kernel+UE+LibC: Remove unused dbgputch syscallBen Wiederhake
Everything uses the dbgputstr syscall anyway, so there is no need to keep supporting it.
2021-11-21Kernel+LibC: Fix misspelled "VERTICAL" in framebuffer ioctlsAndreas Kling
2021-11-20Kernel+LibC: Fix ptrace for 64-bitItamar
This makes the types used in the PT_PEEK and PT_POKE actions suitable for 64-bit platforms as well.
2021-11-17Kernel+LibC: Add msync() system callAndreas Kling
This allows userspace to trigger a full (FIXME) flush of a shared file mapping to disk. We iterate over all the mapped pages in the VMObject and write them out to the underlying inode, one by one. This is rather naive, and there's lots of room for improvement. Note that shared file mappings are currently not possible since mmap() returns ENOTSUP for PROT_WRITE+MAP_SHARED. That restriction will be removed in a subsequent commit. :^)