diff options
Diffstat (limited to 'prog')
-rw-r--r-- | prog/link.ld | 8 | ||||
-rw-r--r-- | prog/src/main.c | 8 | ||||
-rw-r--r-- | prog/src/startup.s | 17 |
3 files changed, 25 insertions, 8 deletions
diff --git a/prog/link.ld b/prog/link.ld index 7bd11eb..9644d59 100644 --- a/prog/link.ld +++ b/prog/link.ld @@ -3,8 +3,8 @@ /* Define memory regions */ MEMORY { - ROM (rx) : ORIGIN = 0x00010000, LENGTH = 0x400 /* 1024 bytes for ROM */ - RAM (rwx) : ORIGIN = 0x00100000, LENGTH = 0x400 /* 1024 bytes for RAM */ + ROM (rx) : ORIGIN = 0x00010000, LENGTH = 0x1000 /* 1024 bytes for ROM */ + RAM (rwx) : ORIGIN = 0x00100000, LENGTH = 0x1000 /* 1024 bytes for RAM */ } ENTRY(_start) @@ -43,7 +43,7 @@ SECTIONS .stack (NOLOAD) : { _stack_start = .; - . += 0x80; /* Adjust the size as needed */ + . += 0x100; /* Adjust the size as needed */ _stack_end = .; } > RAM @@ -51,7 +51,7 @@ SECTIONS .heap (NOLOAD) : { _heap_start = .; - . += 0x80; /* Adjust the size as needed */ + . += 0x100; /* Adjust the size as needed */ _heap_end = .; } > RAM } diff --git a/prog/src/main.c b/prog/src/main.c index 62b802b..082172d 100644 --- a/prog/src/main.c +++ b/prog/src/main.c @@ -1,13 +1,13 @@ #include <stdint.h> -volatile uint32_t *io_in = (volatile uint32_t *)0x00000000; -volatile uint32_t *io_out = (volatile uint32_t *)0x00000004; +//volatile uint32_t *io_in = (volatile uint32_t *)0x00000000; +//volatile uint32_t *io_out = (volatile uint32_t *)0x00000004; int main(void) { - *io_out = 0; while (1) { for (int i = 0; i < 32; ++i) { - *io_out = i; + *((volatile uint32_t *)0x00000004) = i; + for (int j = 0; j < 1024 * 128; ++j); } } } diff --git a/prog/src/startup.s b/prog/src/startup.s index 7adfb5e..963c288 100644 --- a/prog/src/startup.s +++ b/prog/src/startup.s @@ -1,6 +1,23 @@ .section .init .globl _start _start: + +prog: +/* + la t0, 4 + la t1, 1 + + sw t1, 0(t0) + + la t0, 0x00100000 + li t1, 1 + sw t1, 0(t0) + lw t2, 0(t0) + + + j halt + +*/ /* Set up stack pointer */ la sp, _stack_end |