From 5cdd815d98c57ba952042f37ffcfe5b74fae4a92 Mon Sep 17 00:00:00 2001 From: Gitea Date: Tue, 1 Dec 2020 21:00:41 -0600 Subject: [PATCH] Stuff I need to work on --- arch/i386/kclock.c | 3 +++ arch/i386/pmap.c | 3 +++ include/kernel/kclock.h | 4 ++++ include/kernel/pmap.h | 10 +++++++++ include/memlayout.h | 45 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100755 arch/i386/kclock.c create mode 100755 arch/i386/pmap.c create mode 100755 include/kernel/kclock.h create mode 100755 include/kernel/pmap.h create mode 100755 include/memlayout.h diff --git a/arch/i386/kclock.c b/arch/i386/kclock.c new file mode 100755 index 0000000..af14ed5 --- /dev/null +++ b/arch/i386/kclock.c @@ -0,0 +1,3 @@ +int main() { + +} diff --git a/arch/i386/pmap.c b/arch/i386/pmap.c new file mode 100755 index 0000000..af14ed5 --- /dev/null +++ b/arch/i386/pmap.c @@ -0,0 +1,3 @@ +int main() { + +} diff --git a/include/kernel/kclock.h b/include/kernel/kclock.h new file mode 100755 index 0000000..ed42d3c --- /dev/null +++ b/include/kernel/kclock.h @@ -0,0 +1,4 @@ +#ifndef _HEADER +#define _HEADER + +#endif /* not _HEADER */ diff --git a/include/kernel/pmap.h b/include/kernel/pmap.h new file mode 100755 index 0000000..29653fc --- /dev/null +++ b/include/kernel/pmap.h @@ -0,0 +1,10 @@ +#ifndef _KERN_PMAP +#define _KERN_PMAP + +struct PageInfo { + +}; + + + +#endif diff --git a/include/memlayout.h b/include/memlayout.h new file mode 100755 index 0000000..0074c84 --- /dev/null +++ b/include/memlayout.h @@ -0,0 +1,45 @@ +/* + * - Memory layout for Fenix + * Largely based off memlayout.h from Xv6. + */ + +#ifndef _MEMLAYOUT +#define _MEMLAYOUT + +/* + * For future reference on how memory works. + * Extended memory starts at 0x100000 (1 MB). + * It runs from there to some space below the + * end of the actual physical memory. Here, + * that space is defined at 0xE000000 (~224 MB). + * 32-bit devices fill in from the end of + * physical memory down, starting here at like + * 256 MB and filling down to the top of + * our available memory. + */ + +/* TODO: Maybe we want more than 256 MB available? */ +/* + Counterpoint: This system isn't designed to use + a lot of RAM, and it designed to be like a system + of yore. 256 MB may be too much. + -Kat + */ + +#define EXTMEM 0x100000 /* Extended memory start */ +#define PHYSTOP 0xE000000 /* Top of physical memory */ +#define DEVSPACE 0xFE000000 /* 32-bit devices */ + +/* Important address space layout stuff */ +#define KERNBASE 0x80000000 /* First kernel virtual address */ +#define KERNLINK (KERNBASE+EXTMEM) /* Kernel link address */ + +/* Translations between physical and virtual memory */ +#define V2P(a) (((uint) (a)) - KERNBASE) +#define P2V(a) ((void *)(((char *) (a)) + KERNBASE)) + +/* The above without casts (NC -> No Cast) */ +#define V2P_NC(a) ((a) - KERNBASE) +#define P2V_NC(a) ((a) + KERNBASE) + +#endif