debugging
authorAlyssa Rosenzweig <alyssa@backtick.town>
Mon, 22 Aug 2016 03:13:44 +0000 (20:13 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Mon, 22 Aug 2016 03:13:44 +0000 (20:13 -0700)
arm_chainloader/drivers/mbr_disk.cc
arm_chainloader/main.c
arm_loader.c
arm_monitor.c

index bfc468e..de95a70 100644 (file)
@@ -119,6 +119,9 @@ struct MbrImpl {
                }\r
 \r
                if (!validate_signature()) {\r
+                        /* poke the VPU */\r
+                        volatile unsigned int* mail = (volatile unsigned int*) 0x2000B8A0;\r
+                        while(1) *mail = 0xA1755A01;\r
                        panic("invalid master boot record signature (got 0x%x)", mbr->mbr_sig);\r
                }\r
 \r
@@ -195,4 +198,4 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff) {
                        return (DRESULT)0;\r
        }\r
        return RES_PARERR;\r
-}
\ No newline at end of file
+}\r
index 4a8b62a..d2d506e 100644 (file)
@@ -36,12 +36,15 @@ void main() {
        heap_init();\r
 \r
        /* c++ runtime */\r
-       //cxx_init();\r
+       cxx_init();\r
 \r
         /* poke the VPU */\r
-        printf("Poking the VPU..\n");\r
-        while( (mmio_read32(0x2000B898) & 0x80000000) != 0);\r
-        mmio_write32(0x2000B8A0, 0xA1755A01);\r
+/*        __asm__ volatile("mov r3, #0\n" \\r
+                         "mcr p15, 0, r3, C7, C6, 0\n" \\r
+                         "mcr p15, 0, r3, C7, C10, 0\n" \\r
+                         "mcr p15, 0, r3, C7, C14, 0\n" \\r
+                         "mcr p15, 0, r3, C7, C10, 4\n" \\r
+                         "mcr p15, 0, r3, C7, C10, 5\n");*/\r
 \r
        panic("Nothing else to do!");\r
 \r
index 6513956..fe0ea44 100644 (file)
@@ -256,7 +256,7 @@ void arm_init() {
         * set the mem size for who knows what reason.\r
         */\r
        ARM_CONTROL0 |= 0x008 | ARM_C0_APROTSYST | ARM_C0_SIZ1G | ARM_C0_FULLPERI;\r
-        ARM_CONTROL1 |= ARM_C1_PERSON;\r
+        //ARM_CONTROL1 |= ARM_C1_PERSON;\r
 \r
         ARM_IRQ_ENBL3 |= ARM_IE_MAIL;\r
 \r
index f066a38..ab5149e 100644 (file)
@@ -27,13 +27,18 @@ void monitor_irq() {
 void monitor_start() {\r
        printf("Starting IPC monitor ...\n");\r
 \r
+        /* dump status */\r
+        printf("Status --- %X\n", mmio_read32(0x7E00B9B8));\r
+\r
         /* enable IRQ */\r
         mmio_write32(0x7E00B9BC, 0x1);\r
 \r
         for(;;) {\r
-            for(unsigned int i = 0; i < 99999; ++i);\r
-\r
-            printf("  --- %X\n", mmio_read32(0x7E00B9B0));\r
+            if(mmio_read32(0x7E00B9B8) != 0x40000000) {\r
+                printf("Squeal!\n");\r
+            }\r
         }\r
-//     __asm__ __volatile__ ("sleep" :::);\r
+\r
+       __asm__ __volatile__ ("sleep" :::);\r
+        for(;;);\r
 }\r
This page took 0.029018 seconds and 4 git commands to generate.