aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-17 21:49:10 -0700
committerChristian Cunningham <cc@localhost>2022-03-17 21:49:10 -0700
commit15205711b35db0d8ac5516f84ba73fa3550ccc62 (patch)
treee160ef7caaad605b8641548f9569cdc3409ec8b4
parent7943bed3d5e6a803aa022bd237dd365471bb78bc (diff)
Initialize all BSS sections in MMU
-rw-r--r--include/sys/schedule.h2
-rw-r--r--src/lib/mmu.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/include/sys/schedule.h b/include/sys/schedule.h
index f32044c..d0d938c 100644
--- a/include/sys/schedule.h
+++ b/include/sys/schedule.h
@@ -1,7 +1,7 @@
#ifndef SYS_SCHEDULE_H
#define SYS_SCHEDULE_H
-#define TQUEUE_MAX 0x100
+#define TQUEUE_MAX 0x800
#define STACK_SIZE 0x4000
#define TQUEUE_CNT 3
#define PRIORITIES 8
diff --git a/src/lib/mmu.c b/src/lib/mmu.c
index 6a947c5..0a2f892 100644
--- a/src/lib/mmu.c
+++ b/src/lib/mmu.c
@@ -15,11 +15,15 @@ void mmu_section(unsigned long virtual, unsigned long physical, unsigned long fl
*entry = physval;
}
+extern unsigned long __bss_end;
void mmu_init(void)
{
- mmu_section(0x00000000, 0x00000000, CACHABLE | BUFFERABLE);
- for (unsigned long addr = 0x00100000;; addr += 0x00100000) {
- mmu_section(addr, addr, NO_PERMISSIONS_REQUIRED);
+ for (unsigned long addr = 0x00000000;; addr += 0x00100000) {
+ if (addr < (unsigned long)&__bss_end) {
+ mmu_section(addr, addr, CACHABLE | BUFFERABLE);
+ } else {
+ mmu_section(addr, addr, NO_PERMISSIONS_REQUIRED);
+ }
if (addr == 0x02000000)
mmu_section(addr, addr, CACHABLE | BUFFERABLE | NO_PERMISSIONS_REQUIRED);
//else if (addr == 0x3F000000)