summaryrefslogtreecommitdiff
path: root/Kernel/Devices/BXVGADevice.cpp
AgeCommit message (Collapse)Author
2020-03-06Kernel: Simplify a bunch of dbg() and klog() callsAndreas Kling
LogStream can handle VirtualAddress and PhysicalAddress directly.
2020-03-02Kernel: Use klog() instead of kprintf()Liav A
Also, duplicate data in dbg() and klog() calls were removed. In addition, leakage of virtual address to kernel log is prevented. This is done by replacing kprintf() calls to dbg() calls with the leaked data instead. Also, other kprintf() calls were replaced with klog().
2020-02-28Kernel: Implement basic support for sys$mmap() with MAP_PRIVATEAndreas Kling
You can now mmap a file as private and writable, and the changes you make will only be visible to you. This works because internally a MAP_PRIVATE region is backed by a unique PrivateInodeVMObject instead of using the globally shared SharedInodeVMObject like we always did before. :^) Fixes #1045.
2020-02-28Kernel: Validate changed framebuffer resolutionLiav A
Now we check before we set a FBResolution if the BXVGA device is capable of setting the requested resolution. If not, we revert the resolution to the previous one and return an error to userspace. Fixes #451.
2020-02-17Kernel: Replace "current" with Thread::current and Process::currentAndreas Kling
Suggested by Sergey. The currently running Thread and Process are now Thread::current and Process::current respectively. :^)
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-02-09Kernel: Apply changes to use LibBareMetal definitionsLiav A
2020-01-28BXVGA: Disallow resolutions higher than 4096x2160Andreas Kling
There's no sense in allowing arbitrarily huge resolutions. Instead, we now cap the screen size at 4K DCI resolution and will reject attempts to go bigger with EINVAL.
2020-01-28Kernel: AnonymousVMObject::create_for_physical_range() should fail moreAndreas Kling
Previously it was not possible for this function to fail. You could exploit this by triggering the creation of a VMObject whose physical memory range would wrap around the 32-bit limit. It was quite easy to map kernel memory into userspace and read/write whatever you wanted in it. Test: Kernel/bxvga-mmap-kernel-into-userspace.cpp
2020-01-21Kernel: Tidy up debug logging a little bitAndreas Kling
When using dbg() in the kernel, the output is automatically prefixed with [Process(PID:TID)]. This makes it a lot easier to understand which thread is generating the output. This patch also cleans up some common logging messages and removes the now-unnecessary "dbg() << *current << ..." pattern.
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.
2020-01-12Kernel: Add "video" pledge for accessing framebuffer devicesAndreas Kling
WindowServer becomes the only user.
2020-01-02Kernel: Create support for PCI ECAMLiav A
The new PCI subsystem is initialized during runtime. PCI::Initializer is supposed to be called during early boot, to perform a few tests, and initialize the proper configuration space access mechanism. Kernel boot parameters can be specified by a user to determine what tests will occur, to aid debugging on problematic machines. After that, PCI::Initializer should be dismissed. PCI::IOAccess is a class that is derived from PCI::Access class and implements PCI configuration space access mechanism via x86 IO ports. PCI::MMIOAccess is a class that is derived from PCI::Access and implements PCI configurtaion space access mechanism via memory access. The new PCI subsystem also supports determination of IO/MMIO space needed by a device by checking a given BAR. In addition, Every device or component that use the PCI subsystem has changed to match the last changes.
2019-12-31Kernel: Remove some unnecessary leaking of kernel pointers into dmesgAndreas Kling
There's a lot more of this and we need to stop printing kernel pointers anywhere but the debug console.
2019-12-19Kernel: Rename vmo => vmobject everywhereAndreas Kling
2019-11-13Kernel: Fix failing in can_read()/can_write()Sergey Bugaev
Now that the SystemMonitor queries which open files can be read and written to, having can_read()/can_write() unconditionally call ASSERT_NOT_REACHED() leads to system crashes when inspecting the WindowServer. Instead, just return true from can_read()/can_write() (indicating that the read()/write() syscalls should not block) and return -EINVAL when trying to actually read from or write to these devices.
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-02BXVGADevice: Log a debug message whenever the resolution changesAndreas Kling
Fixes #618.
2019-08-26Kernel: Display virtual addresses as V%p instead of L%xAndreas Kling
The L was a leftover from when these were called linear addresses.
2019-08-18Kernel: Implement generic framebuffer ioctls in BXVGAConrad Pankoff
This also hides some functions that were previously public, since that same functionality is now exposed via ioctl functions.
2019-08-12Kernel: Use established device name and number for framebufferConrad Pankoff
This is to prepare for other framebuffer implementations, for which it would be inappropriate to use the /dev/bxvga device name.
2019-08-07Kernel: Split VMObject into two classes: Anonymous- and InodeVMObjectAndreas Kling
InodeVMObject is a VMObject with an underlying Inode in the filesystem. AnonymousVMObject has no Inode. I'm happy that InodeVMObject::inode() can now return Inode& instead of VMObject::inode() return Inode*. :^)
2019-07-18Kernel: Remove unnecessary use of LibDraw.Andreas Kling
BXVGADevice was using a Size object for its framebuffer size. We shouldn't be pulling in userspace code in the kernel like this, even if it's just headers. :^)
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 LinearAddress => VirtualAddress.Andreas Kling
2019-06-07Kernel: Run clang-format on everything.Andreas Kling
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-06-02Kernel: Memory-mapped files now have the absolute path as their name.Andreas Kling
It's generated when the mapping is first created, so it won't update if the file moves. Maybe that's something we should support, too.
2019-05-30Kernel: Make the Process allocate_region* API's understand "int prot".Andreas Kling
Instead of having to inspect 'prot' at every call site, make the Process API's take care of that so we can just pass it through.
2019-05-30Kernel: Pass 'prot' argument to File::mmap() and act on it.Andreas Kling
Nothing crazy, this just means that PROT_READ allocates readable regions, and that PROT_WRITE allocates writable ones.
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-28Kernel: Make ProcessTracer inherit from File.Andreas Kling
2019-04-03Kernel: Move VM-related files into Kernel/VM/.Andreas Kling
Also break MemoryManager.{cpp,h} into one file per class.
2019-04-03Kernel: Move devices into Kernel/Devices/.Andreas Kling