diff options
author | Benji Dial <benji3.141@gmail.com> | 2020-05-24 21:55:12 -0400 |
---|---|---|
committer | Benji Dial <benji3.141@gmail.com> | 2020-05-24 21:55:12 -0400 |
commit | 021ea9b271f2144f7b16ae41a9236292dea7897d (patch) | |
tree | 77bae3af854f9ff1fb0298ae1f71b1395a392cc1 /src/kernel/util.c | |
parent | 02f14113cbf14c6f842fb43ecbc68d0c851ef3b0 (diff) | |
download | portland-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.c | 11 |
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) { |