diff --git a/src/crt.S b/src/crt.S index 62d67b9..59c915b 100644 --- a/src/crt.S +++ b/src/crt.S @@ -3,20 +3,22 @@ .global irqCallback .section .start_jump,"ax",@progbits -crtStart: + +crtStart: // 0x 8000 0000 //long jump to allow crtInit to be anywhere //do it always in 12 bytes lui x2, %hi(crtInit) addi x2, x2, %lo(crtInit) jalr x1,x2 - nop + nop // 0x 8000 0010 .section .text .global trap_entry -.align 5 +.align 5 //2^5 = 32 = 0x 20 trap_entry: - sw x1, - 1*4(sp) + + sw x1, - 1*4(sp) // 0x 8000 0020 sw x5, - 2*4(sp) sw x6, - 3*4(sp) sw x7, - 4*4(sp) diff --git a/src/main.cpp b/src/main.cpp index 1e0756c..068fe55 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,10 +57,11 @@ int main() { TIMER_INTERRUPT->PENDINGS = 0xF; TIMER_INTERRUPT->MASKS = 0x1; - while(1){ - - ++mati; + // Thread 0 + while( 1){ + ++mati; } + } extern "C" void irqCallback(){