summaryrefslogtreecommitdiff
path: root/src/kernel/util.c
diff options
context:
space:
mode:
authorBenji Dial <benji3.141@gmail.com>2020-05-24 21:55:12 -0400
committerBenji Dial <benji3.141@gmail.com>2020-05-24 21:55:12 -0400
commit021ea9b271f2144f7b16ae41a9236292dea7897d (patch)
tree77bae3af854f9ff1fb0298ae1f71b1395a392cc1 /src/kernel/util.c
parent02f14113cbf14c6f842fb43ecbc68d0c851ef3b0 (diff)
downloadportland-os-021ea9b271f2144f7b16ae41a9236292dea7897d.tar.gz
basic fs type stuff, fat16, removing stack segment and using data segment
Diffstat (limited to 'src/kernel/util.c')
-rw-r--r--src/kernel/util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/kernel/util.c b/src/kernel/util.c
index df6e7d8..c7a5035 100644
--- a/src/kernel/util.c
+++ b/src/kernel/util.c
@@ -2,8 +2,15 @@
#include "panic.h"
#include <stdbool.h>
-void memcpy(void *from, void *to, uint32_t n) {
- panic("Not implemented (memcpy).");
+void memcpy(void *to, void *from, uint32_t n) {
+ uint32_t *tp = to, *fp = from;
+ while (n >= 4) {
+ *(tp++) = *(fp++);
+ n -= 4;
+ }
+ uint8_t *tpp = (uint8_t *)tp, *fpp = (uint8_t *)fp;
+ while (n--)
+ *(tpp++) = *(fpp++);
}
void u32_dec(uint32_t n, uint8_t *b) {