From 021ea9b271f2144f7b16ae41a9236292dea7897d Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 24 May 2020 21:55:12 -0400 Subject: basic fs type stuff, fat16, removing stack segment and using data segment --- src/kernel/util.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/kernel/util.c') 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 -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) { -- cgit v1.2.3