summaryrefslogtreecommitdiff
path: root/Kernel/Devices/KeyboardDevice.h
AgeCommit message (Collapse)Author
2021-02-01Kernel+LibKeyboard: Define the default keymap only in one placeBen Wiederhake
Because it was 'static const' and also shared with userland programs, the default keymap was defined in multiple places. This commit should save several kilobytes! :^)
2021-02-01LibKeyboard: Don't assert on failureBen Wiederhake
2021-02-01Kernel+LibKeyboard: Enable querying the current keymapBen Wiederhake
2021-01-22Kernel: Make device generate their own namesJean-Baptiste Boric
Besides removing the monolithic DevFSDeviceInode::determine_name() method, being able to determine a device's name inside the /dev hierarchy outside of DevFS has its uses.
2020-12-27Kernel: Add a method to determine the desired permissions of a DeviceLiav A
This method will be used later in DevFS, to set the appropriate permissions for each device node.
2020-11-12Kernel: Add I8042Controller to detect and manage PS/2 devicesTom
Rework the PS/2 keyboard and mouse drivers to use a common 8042 controller driver. Also, reset and reconfigure the 8042 controller as they are not guaranteed to be in the state that we expect.
2020-09-25Meta+Kernel: Make clang-format-10 cleanBen Wiederhake
2020-09-13Kernel: Make copy_to/from_user safe and remove unnecessary checksTom
Since the CPU already does almost all necessary validation steps for us, we don't really need to attempt to do this. Doing it ourselves doesn't really work very reliably, because we'd have to account for other processors modifying virtual memory, and we'd have to account for e.g. pages not being able to be allocated due to insufficient resources. So change the copy_to/from_user (and associated helper functions) to use the new safe_memcpy, which will return whether it succeeded or not. The only manual validation step needed (which the CPU can't perform for us) is making sure the pointers provided by user mode aren't pointing to kernel mappings. To make it easier to read/write from/to either kernel or user mode data add the UserOrKernelBuffer helper class, which will internally either use copy_from/to_user or directly memcpy, or pass the data through directly using a temporary buffer on the stack. Last but not least we need to keep syscall params trivial as we need to copy them from/to user mode using copy_from/to_user.
2020-08-25Kernel: Switch singletons to use new Singleton classTom
MemoryManager cannot use the Singleton class because MemoryManager::initialize is called before the global constructors are run. That caused the Singleton to be re-initialized, causing it to create another MemoryManager instance. Fixes #3226
2020-08-22Revert "Kernel: Switch singletons to use new Singleton class"Andreas Kling
This reverts commit f48feae0b2a300992479abf0b2ded85e45ac6045.
2020-08-21Kernel: Switch singletons to use new Singleton classTom
Fixes #3226
2020-08-06Kernel+LibKeyboard: Store the keymap name when setting system keymapValtteri Koskivuori
This way we can query the kernel to see which keymap is currently in use.
2020-08-04Kernel: Make File::write() and File::read() return KResultOr<size_t>Andreas Kling
Instead of returning a ssize_t where negative values mean error, we now return KResultOr<size_t> and use the error state to report errors exclusively.
2020-07-04Kernel: Move headers intended for userspace use into Kernel/API/Andreas Kling
2020-06-25Kernel: Harvest randomness from various driversPeter Elliott
Random now gets entropy from the following drivers: - KeyboardDevice - PATAChannel - PS2MouseDevice - E1000NetworkAdapter - RTL8139NetworkAdapter Of these devices, PS2MouseDevice and PATAChannel provide the vast majority of the entropy.
2020-06-13Kernel: KeyboardDevice, remove char mapping logicHüseyin ASLITÜRK
Remove char mapping logic and constant character map.
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-04-10Kernel: Add explicit offset parameter to File::read etcConrad Pankoff
2020-03-19Kernel: Use a const reference to RegisterState in IRQ handlingLiav A
2020-03-06Kernel: Change HandlerPurpose to HandlerTypeLiav A
Also, GenericInterruptHandler class requires to implement two new methods.
2020-02-24Kernel: Update system components to use the new IRQHandler classLiav A
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-01-22Revert "Kernel: Replace IRQHandler with the new InterruptHandler class"Andreas Kling
This reverts commit 6c72736b26a81a8f03d8dd47989bfffe26bb1c95. I am unable to boot on my home machine with this change in the tree.
2020-01-22Kernel: Replace IRQHandler with the new InterruptHandler classLiav A
System components that need an IRQ handling are now inheriting the InterruptHandler class. In addition to that, the initialization process of PATAChannel was changed to fit the changes. PATAChannel, E1000NetworkAdapter and RTL8139NetworkAdapter are now inheriting from PCI::Device instead of InterruptHandler directly.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-12-31Kernel: Implement AltGr key supportTibor Nagy
2019-11-25Kernel: Implement the setkeymap() syscall.Hüseyin ASLITÜRK
2019-11-04Kernel: Make File's can_read/can_write take a const FileDescription&Andreas Kling
Asking a File if we could possibly read or write it will never mutate the asking FileDescription&, so it should be const.
2019-10-17KeyboardDevice: Rename 0xe0 flag for clarity.Nufflee
2019-10-17KeyboardDevice: Support whole numpad and Num Lock.Nufflee
We now support all numpad keys and the Num Lock key.
2019-10-17KeyboardDevice: Implement Caps Lock handling.Nufflee
2019-07-16Kernel: Remove use of [[gnu::pure]].Andreas Kling
I was messing around with this to tell the compiler that these functions always return the same value no matter how many times you call them. It doesn't really seem to improve code generation and it looks weird so let's just get rid of it.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-07Kernel: Rename FileDescriptor to FileDescription.Andreas Kling
After reading a bunch of POSIX specs, I've learned that a file descriptor is the number that refers to a file description, not the description itself. So this patch renames FileDescriptor to FileDescription, and Process now has FileDescription* file_description(int fd).
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-29Kernel: Have File virtuals take a FileDescriptor& rather than a Process&.Andreas Kling
This will allow us to implement different behaviors depending on the role of the descriptor a File is being accessed through.
2019-04-03Kernel: Move devices into Kernel/Devices/.Andreas Kling