From 2c593fb0b99d4b743ecb8abf2bb6aa4694d78a89 Mon Sep 17 00:00:00 2001
From: Ribbon <peer_64x@protonmail.com>
Date: Tue, 28 Feb 2023 08:10:33 +0000
Subject: [PATCH] Move from CONTRIBUTING to kernel README.

---
 README.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/README.md b/README.md
index f20204a0..c1f09dcb 100644
--- a/README.md
+++ b/README.md
@@ -44,3 +44,9 @@ the process. See your debuggers man page for more information on useful commands
 [qemu]: https://www.qemu.org
 [gdb]: https://www.gnu.org/software/gdb/
 [lldb]: https://lldb.llvm.org/
+
+## Notes
+
+* When trying to access a slice, **always** use the `common::GetSlice` trait and the `.get_slice()` method to get a slice without causing the kernel to panic.
+  The problem with slicing in regular Rust, e.g. `foo[a..b]`, is that if someone tries to access with a range that is out of bounds of an array/string/slice, it will cause a panic at runtime, as a safety measure. Same thing when accessing an element.
+  Always use `foo.get(n)` instead of `foo[n]` and try to cover for the possibility of `Option::None`. Doing the regular way may work fine for applications, but never in the kernel. No possible panics should ever exist in kernel space, because then the whole OS would just stop working.
-- 
GitLab