mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Documentation: Add a note on paths in the kernel development guidelines
Add a note on hardcoded paths so everyone know that this is not an appropriate thing to do when writing kernel code.
This commit is contained in:
parent
6a555af1f1
commit
968e1a6efc
Notes:
sideshowbarker
2024-07-17 03:34:29 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/968e1a6efc Pull-request: https://github.com/SerenityOS/serenity/pull/16283 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 15 additions and 0 deletions
|
@ -123,6 +123,21 @@ as long as it doesn't hurt other security measures.
|
||||||
We also consider performance metrics, so a tradeoff between two mostly-contradictive metrics
|
We also consider performance metrics, so a tradeoff between two mostly-contradictive metrics
|
||||||
is to be discussed when an issue arises.
|
is to be discussed when an issue arises.
|
||||||
|
|
||||||
|
## No hardcoded userspace paths
|
||||||
|
|
||||||
|
To ensure the kernel stays flexible to future changes, we should not put hardcoded
|
||||||
|
paths or assume where filesystem items (nor where filesystems are mounted) reside on - we should
|
||||||
|
always let userspace to inform the kernel about paths and assume nothing else.
|
||||||
|
Even when it's obvious some file will always be located in a certain path, it is considered
|
||||||
|
a violation of an abstraction layer to hardcode it in the kernel code, because we put an hard effort
|
||||||
|
to keep the abstractions we have intact and clean.
|
||||||
|
|
||||||
|
There's one exception to this rule - the kernel will use a `dbgln` statement to
|
||||||
|
warn the user in case that the dynamic loader is not the usual binary we use.
|
||||||
|
To generalize the exception a bit more - debug messages (being used sparingly) with
|
||||||
|
assumption of paths could be OK, as long as they never have any functional implication
|
||||||
|
on the user.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
As with any documentation, it's always good to see more of it, either with a new manual page,
|
As with any documentation, it's always good to see more of it, either with a new manual page,
|
||||||
|
|
Loading…
Reference in a new issue