aboutsummaryrefslogtreecommitdiff
path: root/src/kern/main.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-24 16:41:49 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-24 16:41:49 -0700
commitc29e0323020e0f96932d0f9b09747d5b2e28e5a6 (patch)
treec6100f1a4702d14548f5b82d72afb85340711a68 /src/kern/main.c
parent0c0f5c3d8397ba5168f0cd01b25ba70c238b36e0 (diff)
downloadstm32l4-c29e0323020e0f96932d0f9b09747d5b2e28e5a6.tar.gz
stm32l4-c29e0323020e0f96932d0f9b09747d5b2e28e5a6.tar.bz2
stm32l4-c29e0323020e0f96932d0f9b09747d5b2e28e5a6.zip
Changes to painic. It now prints the stack at the time of failure (if logging is initialized).
Diffstat (limited to 'src/kern/main.c')
-rw-r--r--src/kern/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kern/main.c b/src/kern/main.c
index a6743d5..c85decb 100644
--- a/src/kern/main.c
+++ b/src/kern/main.c
@@ -4,6 +4,7 @@
#include "kern/log.h"
#include "kern/panic.h"
#include "kern/init.h"
+#include "kern/mem.h"
void on_systick() /* Overrides weak-symbol on_systick. */
{
@@ -20,13 +21,17 @@ int main()
klogf("Heap End : %p\n", &HEAP_STOP);
/* Set the countdown to start from 10,000,0000. */
- SCB.strv_r = 10000000;
+ SCB.strv_r = 10000000 / 20;
/* Enable interrupts. */
regset(SCB.stcs_r, scb_tickint, 1);
/* Start the systick. */
regset(SCB.stcs_r, scb_enable, 1);
+
+ void* hunk = kalloc(25);
+ kfree(hunk);
+ kfree(hunk); /* Invalid free. */
}
#endif