Everywhere: Remove references to the kernel

This commit is contained in:
Tim Ledbetter 2024-05-31 09:27:36 +01:00 committed by Andreas Kling
parent d147ed8549
commit 1a4fbfe495
Notes: sideshowbarker 2024-07-17 06:40:35 +09:00
12 changed files with 5 additions and 56 deletions

View file

@ -46,7 +46,7 @@ Checks: >
-readability-uppercase-literal-suffix, -readability-uppercase-literal-suffix,
-readability-use-anyofallof, -readability-use-anyofallof,
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: 'AK|Userland|Kernel|Tests' HeaderFilterRegex: 'AK|Userland|Tests'
FormatStyle: none FormatStyle: none
CheckOptions: CheckOptions:
- key: bugprone-dangling-handle.HandleClasses - key: bugprone-dangling-handle.HandleClasses

View file

@ -41,7 +41,7 @@ set(AK_SOURCES
Utf8View.cpp Utf8View.cpp
kmalloc.cpp kmalloc.cpp
) )
# AK sources are included from many different places, such as the Kernel, LibC, and Loader # AK sources are included from many different places
list(TRANSFORM AK_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") list(TRANSFORM AK_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/")
set(AK_SOURCES ${AK_SOURCES} PARENT_SCOPE) set(AK_SOURCES ${AK_SOURCES} PARENT_SCOPE)

View file

@ -129,18 +129,12 @@ endif()
if (ENABLE_ALL_DEBUG_FACILITIES) if (ENABLE_ALL_DEBUG_FACILITIES)
set(ENABLE_ALL_THE_DEBUG_MACROS ON) set(ENABLE_ALL_THE_DEBUG_MACROS ON)
set(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS ON)
# Immediately finds violations during boot, shouldn't be discoverable # Immediately finds violations during boot, shouldn't be discoverable
# by people who aren't working on fixing issues. Use this check to make # by people who aren't working on fixing issues. Use this check to make
# sure this code continues to build instead of all_debug_macros to avoid # sure this code continues to build instead of all_debug_macros to avoid
# people filing bugs. # people filing bugs.
set(KMALLOC_VERIFY_NO_SPINLOCK_HELD ON) set(KMALLOC_VERIFY_NO_SPINLOCK_HELD ON)
# Enables KCOV API and injects kernel coverage instrumentation via
# -fsanitize-coverage=trace-pc. Mostly here to ensure that the CI catches
# commits breaking this flag.
set(ENABLE_KERNEL_COVERAGE_COLLECTION ON)
endif() endif()
if (ENABLE_ALL_THE_DEBUG_MACROS) if (ENABLE_ALL_THE_DEBUG_MACROS)
@ -154,7 +148,6 @@ set(CMAKE_INSTALL_INCLUDEDIR usr/include)
set(CMAKE_INSTALL_LIBDIR usr/lib) set(CMAKE_INSTALL_LIBDIR usr/lib)
configure_file(AK/Debug.h.in AK/Debug.h @ONLY) configure_file(AK/Debug.h.in AK/Debug.h @ONLY)
configure_file(Kernel/Debug.h.in Kernel/Debug.h @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AK/Debug.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/AK") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AK/Debug.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/AK")
# We disable it completely because it makes cmake very spammy. # We disable it completely because it makes cmake very spammy.
@ -215,7 +208,6 @@ if (ENABLE_CLANG_PLUGINS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
endif() endif()
add_subdirectory(AK) add_subdirectory(AK)
add_subdirectory(Kernel)
# FIXME: vptr sanitizing requires.. intense ABI wrangling of std::type_info # FIXME: vptr sanitizing requires.. intense ABI wrangling of std::type_info
# And would be better served by porting ubsan_type_hash_itanium.cpp from compiler-rt # And would be better served by porting ubsan_type_hash_itanium.cpp from compiler-rt

View file

@ -42,7 +42,7 @@ want to exclude Toolchain files as well, follow the same procedure with the foll
## Include headers and source files for code insight ## Include headers and source files for code insight
To get proper code insight mark the folders `AK`, `Kernel` and `Userland` by right-clicking on them and selecting `Mark Directory as | Project Sources and Headers`. To get proper code insight mark the folders `AK` and `Userland` by right-clicking on them and selecting `Mark Directory as | Project Sources and Headers`.
A symptom of this not being configured correctly is CLion giving a warning for every single file: A symptom of this not being configured correctly is CLion giving a warning for every single file:
> The file does not belong to any project target, code insight features might not work properly. > The file does not belong to any project target, code insight features might not work properly.
@ -52,27 +52,6 @@ A symptom of this not being configured correctly is CLion giving a warning for e
To make code generated by CLion match the SerenityOS coding style, import the `CLionCodeStyleSettings.xml` from this directory as code style scheme via To make code generated by CLion match the SerenityOS coding style, import the `CLionCodeStyleSettings.xml` from this directory as code style scheme via
`Settings -> Editor -> Code Style -> C/C++ -> Scheme -> Cog icon -> Import Scheme...` `Settings -> Editor -> Code Style -> C/C++ -> Scheme -> Cog icon -> Import Scheme...`
## Quick switching between Kernel and Userland targets
In order to let CLion know what kind of code you're currently working on (Kernel / Userland) to make sure it parses and displays the correct half of statements like this:
```c++
#ifdef KERNEL
...
#else
...
#endif
```
You need to add build configurations for each:
Click on one of the buttons below (top right of the IDE) - If you have the second one, press Edit Configurations after the dropdown box opens, then press CTRL+A to select the 1000s of automatically generated targets, and then press Delete to remove them.
![Add Configuration...](CLion_Add_Configuration.png)
![Kernel | Default](CLion_Add_Configuration_Existing.png)
Then press the `+` button to add a new configuration, select `CMake Application`, name the configuration `Kernel`, set the target to `Kernel` (typing while the dropdown box is open searches), and then repeat the process one more time, this time with the name being `Userland` and the target being `true`.
Finally, to quickly switch between the two different contexts, simply click the `Kernel | Default` / `Userland | Default` button to switch.
## Notes for WSL Users ## Notes for WSL Users
### Toolchain ### Toolchain

View file

@ -15,8 +15,6 @@ First, make sure you have a working toolchain and can build and run SerenityOS.
* Edit the `serenity.config` file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it) * Edit the `serenity.config` file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it)
* Add the following `#define`s to the file: * Add the following `#define`s to the file:
``` ```
//#define KERNEL
#define ENABLE_UNICODE_DATA 1 #define ENABLE_UNICODE_DATA 1
//#define ENABLE_COMPILETIME_FORMAT_CHECK //#define ENABLE_COMPILETIME_FORMAT_CHECK
@ -24,7 +22,6 @@ First, make sure you have a working toolchain and can build and run SerenityOS.
#define SANITIZE_PTRS 1 #define SANITIZE_PTRS 1
#define __SSE__ #define __SSE__
``` ```
If you're working on the Kernel, just uncomment `#define KERNEL`.
* Edit the `serenity.cxxflags` file to say `-std=c++23 -fsigned-char -fconcepts -fno-exceptions -fno-semantic-interposition -fPIC` * Edit the `serenity.cxxflags` file to say `-std=c++23 -fsigned-char -fconcepts -fno-exceptions -fno-semantic-interposition -fPIC`
* Edit the `serenity.includes` file to list the following lines: * Edit the `serenity.includes` file to list the following lines:
``` ```

View file

@ -40,8 +40,6 @@ set(E1000_DEBUG ON)
set(EDITOR_DEBUG ON) set(EDITOR_DEBUG ON)
set(ELF_IMAGE_DEBUG ON) set(ELF_IMAGE_DEBUG ON)
set(EMOJI_DEBUG ON) set(EMOJI_DEBUG ON)
set(ENABLE_KERNEL_COVERAGE_COLLECTION ON)
set(ENABLE_KERNEL_COVERAGE_COLLECTION_DEBUG ON)
set(ESCAPE_SEQUENCE_DEBUG ON) set(ESCAPE_SEQUENCE_DEBUG ON)
set(ETHERNET_DEBUG ON) set(ETHERNET_DEBUG ON)
set(EVENT_DEBUG ON) set(EVENT_DEBUG ON)

View file

@ -7,11 +7,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/common_options.cmake NO_POLICY_SCOPE)
serenity_option(ENABLE_PCI_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pci.ids database at build time") serenity_option(ENABLE_PCI_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pci.ids database at build time")
serenity_option(ENABLE_USB_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the usb.ids database at build time") serenity_option(ENABLE_USB_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the usb.ids database at build time")
serenity_option(ENABLE_PNP_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pnp.ids database at build time") serenity_option(ENABLE_PNP_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pnp.ids database at build time")
serenity_option(ENABLE_KERNEL_ADDRESS_SANITIZER OFF CACHE BOOL "Enable kernel address sanitizer testing in gcc/clang")
serenity_option(ENABLE_KERNEL_COVERAGE_COLLECTION OFF CACHE BOOL "Enable KCOV and kernel coverage instrumentation in gcc/clang")
serenity_option(ENABLE_KERNEL_COVERAGE_COLLECTION_DEBUG OFF CACHE BOOL "Enable KCOV and kernel coverage instrumentation debugging")
serenity_option(ENABLE_KERNEL_LTO OFF CACHE BOOL "Build the kernel with link-time optimization")
serenity_option(ENABLE_KERNEL_UNDEFINED_SANITIZER ON CACHE BOOL "Enable the Kernel Undefined Behavior Sanitizer (KUBSAN)")
serenity_option(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS OFF CACHE BOOL "Enable -Og and -ggdb3 options for Kernel code for easier debugging")
serenity_option(ENABLE_MOLD_LINKER OFF CACHE BOOL "Link the SerenityOS userland with the mold linker") serenity_option(ENABLE_MOLD_LINKER OFF CACHE BOOL "Link the SerenityOS userland with the mold linker")
serenity_option(ENABLE_USERSPACE_COVERAGE_COLLECTION OFF CACHE BOOL "Enable code coverage instrumentation for userspace binaries in clang") serenity_option(ENABLE_USERSPACE_COVERAGE_COLLECTION OFF CACHE BOOL "Enable code coverage instrumentation for userspace binaries in clang")

View file

@ -20,8 +20,7 @@ done < <(
git ls-files -- \ git ls-files -- \
'*.cpp' \ '*.cpp' \
'*.h' \ '*.h' \
'*.in' \ '*.in'
':!:Kernel/FileSystem/Ext2FS/Definitions.h'
else else
# We're in the middle of a pre-commit run, so we should only check the files that have # We're in the middle of a pre-commit run, so we should only check the files that have
# actually changed. The reason is that "git ls-files | grep" on the entire repo takes # actually changed. The reason is that "git ls-files | grep" on the entire repo takes

View file

@ -24,4 +24,4 @@ if [ -z "$SERENITY_SOURCE_DIR" ] ; then
fi fi
# shellcheck disable=SC2086 # Word splitting is intentional here # shellcheck disable=SC2086 # Word splitting is intentional here
find AK Base Documentation Kernel Meta Ports Tests Userland -path Tests/LibWeb/WPT/wpt -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" -b "${SERENITY_SOURCE_DIR}/Base" $EXTRA_MARKDOWN_CHECK_ARGS README.md CONTRIBUTING.md find AK Base Documentation Meta Tests Userland -path Tests/LibWeb/WPT/wpt -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" -b "${SERENITY_SOURCE_DIR}/Base" $EXTRA_MARKDOWN_CHECK_ARGS README.md CONTRIBUTING.md

View file

@ -20,8 +20,6 @@ def should_check_file(filename):
return False return False
if filename.startswith('Tests/LibWeb/Layout/'): if filename.startswith('Tests/LibWeb/Layout/'):
return False return False
if filename == 'Kernel/FileSystem/Ext2FS/Definitions.h':
return False
if filename.endswith('.txt'): if filename.endswith('.txt'):
return 'CMake' in filename return 'CMake' in filename
return True return True

View file

@ -74,12 +74,6 @@ def should_check_file(filename):
return False return False
if filename.startswith('Base/'): if filename.startswith('Base/'):
return False return False
if filename == 'Kernel/Devices/HID/VirtIO/EvDevDefinitions.h':
return False
if filename == 'Kernel/FileSystem/Ext2FS/Definitions.h':
return False
if filename == 'Kernel/FileSystem/FUSE/Definitions.h':
return False
return True return True

View file

@ -12,8 +12,6 @@ if [ "$#" -eq "1" ]; then
'*.h' \ '*.h' \
'*.mm' \ '*.mm' \
':!:Base' \ ':!:Base' \
':!:Kernel/Devices/HID/VirtIO/EvDevDefinitions.h' \
':!:Kernel/FileSystem/Ext2FS/Definitions.h' \
':!:Userland/Libraries/LibCodeComprehension/Cpp/Tests/*' \ ':!:Userland/Libraries/LibCodeComprehension/Cpp/Tests/*' \
':!:Userland/Libraries/LibCpp/Tests/parser/*' \ ':!:Userland/Libraries/LibCpp/Tests/parser/*' \
':!:Userland/Libraries/LibCpp/Tests/preprocessor/*' ':!:Userland/Libraries/LibCpp/Tests/preprocessor/*'