summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2020-05-28Kernel: Remove outdated FIXME in InterruptManagement::locate_apic_dataAndreas Kling
2020-05-28Kernel: Stop bootloader from setting video mode with MultibootetaIneLp
Meta: Update INSTALL.md and grub configs for new boot_mode option
2020-05-27Kernel: Introduce "boot_mode" and "init" cmdline optionsSergey Bugaev
Together, they replace the old text_debug option. * boot_mode should be either "graphical" (the default) or "text". We could potentially support other values here in the future. * init specifies which userspace process the kernel should spawn to bootstrap userspace. By default, this is SystemServer, but you can specify e.g. init=/bin/Shell to run system diagnostics.
2020-05-27Kernel: Port VirtualConsole to LibVT :^)Sergey Bugaev
Unfortunately this drops the feature of preserving VGA buffer contents. Resolves https://github.com/SerenityOS/serenity/issues/2399
2020-05-26AK: Rename FileSystemPath -> LexicalPathSergey Bugaev
And move canonicalized_path() to a static method on LexicalPath. This is to make it clear that FileSystemPath/canonicalized_path() only perform *lexical* canonicalization.
2020-05-26Kernel: Introduce "sigaction" pledgeSergey Bugaev
You now have to pledge "sigaction" to change signal handlers/dispositions. This is to prevent malicious code from messing with assertions (and segmentation faults), which are normally expected to instantly terminate the process but can do other things if you change signal disposition for them.
2020-05-26Kernel: fix assertion on readlink() syscallAngel
The is_error() check on the KResultOr returned when reading the link target had a stray ! operator which causes link resolution to crash the kernel with an assertion error.
2020-05-26Kernel: Plumb KResult through FileDescription::read_entire_file() ↵Brian Gianforcaro
implementation. Allow file system implementation to return meaningful error codes to callers of the FileDescription::read_entire_file(). This allows both Process::sys$readlink() and Process::sys$module_load() to return more detailed errors to the user.
2020-05-26Kernel: Clang format file system in prep for changes.Brian Gianforcaro
2020-05-26Kernel: Unmap first MB after jumping above 3GBetaIneLp
2020-05-26Kernel: Create page structures correctly in boot.setaIneLp
2020-05-25Kernel: Fix returning random children from waitid(WNOHANG)Sergey Bugaev
In case WNOHANG was specified, we want to always set should_unblock to true (which we do since commit 4402207b983b6ad4e317ef5affa4a78f10903a26), not wait_finished -- the latter causes us to immediately return this child to our caller, which is not what we want -- perhaps we should return another child which has actually exited or stopped, or nobody at all. To avoid confusion, also rename wait_finished to fits_the_spec. This fixes service keepalive functionality in SystemServer.
2020-05-23Kernel: Use TypedMapping for accessing IOAPIC registersAndreas Kling
2020-05-23Kernel: Add non-const version of TypedMapping::operator->()Andreas Kling
2020-05-23Kernel: Oops, we need to use map_typed_writable() for write access :^)Andreas Kling
2020-05-23Kernel: Use TypedMappings when looking for APIC informationAndreas Kling
2020-05-23Kernel+LibC: Fix various build issues introduced by ssize_tAndreas Kling
Now that ssize_t is derived from size_t, we have to
2020-05-23Kernel: Use TypedMappings in the very unfinished APIC codeAndreas Kling
2020-05-23Kernel+LibC: Let's say that off_t is a ssize_tAndreas Kling
2020-05-23Kernel: Add missing casts when calling AK::min()Andreas Kling
2020-05-23Kernel: Tweak some suspicious casts in InterruptManagementAndreas Kling
This code needs a closer looking-into at some point. It doesn't seem entirely safe to be casting u32's to pointers like it does.
2020-05-23Kernel: Dont't static_assert that size_t is 32-bit :^)Andreas Kling
2020-05-23Kernel: Use a FlatPtr for the "argument" to ioctl()Andreas Kling
Since it's often used to pass pointers, it should really be a FlatPtr.
2020-05-23Kernel: Simplify MP table parser a little bit moreAndreas Kling
Get rid of the ConfigurationTableEntryLength enum and just look at the sizeof() for each entry type.
2020-05-23Kernel: Make dump_backtrace_impl() take base pointer as a FlatPtrAndreas Kling
Since FlatPtr is register width agnostic. :^)
2020-05-22Kernel: Return ESPIPE when seeking an unseekableSergey Bugaev
This is what Dr. POSIX says it should do.
2020-05-22Kernel: Remove some now-unnecessary casts in ProcFSAndreas Kling
Now that we can pass arbitrary integer types to the JSON serialization code, we don't have to cast to u32 as much!
2020-05-22Kernel: Remove outdated FIXME's in the static ACPI parserAndreas Kling
We no longer blindly use PAGE_SIZE here. :^)
2020-05-22Kernel: Simplify scanning BIOS/EBDA and MP parser initializationAndreas Kling
Add a MappedROM::find_chunk_starting_with() helper since that's a very common usage pattern in clients of this code. Also convert MultiProcessorParser from a persistent singleton object to a temporary object constructed via a failable factory function.
2020-05-22Kernel: Add convenient ways to map whole BIOS and EBDA into memoryAndreas Kling
This patch adds a MappedROM abstraction to the Kernel VM subsystem. It's basically the read-only byte buffer equivalent of a TypedMapping. We use this in the ACPI and MP table parsers to scan for interesting stuff in low memory instead of doing a bunch of address arithmetic.
2020-05-22Kernel: Clean up and simplify MP table parsingAndreas Kling
Use map_typed<T> to map physically addressed structs into kernel VM. This is so much easier than doing address arithmetic everywhere. :^)
2020-05-22Ext2FS: Fix indirect-blocks iterationYonatan Goldschmidt
For singly-indirect blocks, "callback" is just "add_block". For doubly-indirect blocks, "callback" is the lambda function iterating on singly-indirect blocks: so instead of adding itself to the list, the doubly-indirect block will add all its childs, but they add themselves again when they run the callback of singly-indirect blocks. And nothing adds the doubly-indirect block itself :( This leads to a double free of all child blocks of the doubly-indirect block, which is the failed assert described in #1549. Closes: #1549.
2020-05-20Kernel: Fix invalid jump in case RDRAND failsAndreas Kling
If RDRAND doesn't give us data, we want to try again, not jump to some low address like 0x80 :^)
2020-05-20Revert "Kernel: Add implementation of operator new and delete to kmalloc.cpp"Andreas Kling
This reverts commit 6d0d8487201eb3cc8d63a1d066a0735a97cdc6e3.
2020-05-20Revert "Kernel: Don't link against libstdc++"Andreas Kling
This reverts commit bde7bc3472e0541583ed333efc42a3bde53881ad.
2020-05-20Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"Andreas Kling
This reverts commit c1eb744ff0a82cf6c8e3470ac10e2f417c7d9de2.
2020-05-20Kernel: Always inline stac(), clac() and SmapDisablerAndreas Kling
Let's not be paying the function call overhead for these tiny ops. Maybe there's an argument for having fewer gadgets in the kernel but for now we're actually seeing stac() in profiles so let's put that above theoretical security issues.
2020-05-20Kernel: Validate access to whole regionsSergey Bugaev
2020-05-20Kernel: Look for a user region firstSergey Bugaev
We're far more likely to be looking for a user region than otherwise, so optimize for that case.
2020-05-20AK+Kernel: Help the compiler inline a bunch of trivial methodsSergey Bugaev
If these methods get inlined, the compiler is able to statically eliminate most of the assertions. Alas, it doesn't realize this, and believes inlining them to be too expensive. So give it a strong hint that it's not the case. This *decreases* the kernel binary size.
2020-05-20Build: Include headers from LibC, LibM, and LibPthread with -isystemAndrew Kaster
Make sure that userspace is always referencing "system" headers in a way that would build on target :). This means removing the explicit include_directories of Libraries/LibC in favor of having it export its headers as SYSTEM. Also remove a redundant include_directories of Libraries in the 'serenity build' part of the build script. It's already set at the top. This causes issues for the Kernel, and for crt0.o. These special cases are handled individually.
2020-05-20Kernel: Don't link against libstdc++Andrew Kaster
It has nothing we need anymore :^)
2020-05-20Kernel: Add implementation of operator new and delete to kmalloc.cppAndrew Kaster
This was missing before, we were getting it for free from libstdc++
2020-05-20Kernel+LibC: Switch isatty() to use a fcntl()Sergey Bugaev
We would want it to work with only stdio pledged.
2020-05-19Kernel: Tweak FileBackedFS API to avoid intermediary copiesSergey Bugaev
read_block() and write_block() now accept the count (how many bytes to read or write) and offset (where in the block to start; defaults to 0). Using these new APIs, we can avoid doing copies between intermediary buffers in a lot more cases. Hopefully this improves performance or something.
2020-05-19Kernel: Make FS::block_size a size_tSergey Bugaev
2020-05-19Kernel: Inline Inode::fsid()Sergey Bugaev
2020-05-18Kernel: WaitBlocker should always unblock immediately on WNOHANGAndreas Kling
This fixes a problem where we'd block if a process with no children would call sys$waitid() with WNOHANG. This unbreaks bash :^)
2020-05-17Kernel + LibC: Handle running processes in do_waitid()AnotherTest
2020-05-17Kernel: wait() should not block if WNOHANG is specifiedAnotherTest