duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit a5d95cbcf1b1de79345be35deadc0fdc5d92a667
parent da407eb0ef095f30d93d88d329f10e7066a8db0b
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Tue,  6 Jun 2023 20:58:15 -0400

rpi: add dump

I realize that my writing words (entry, code etc.) don't work at all when ran
on a real raspberry pi and that the fix is non trivial.

I need debugging tools...

Diffstat:
Mfs/xcomp/arm/rpi/kernel.fs | 24++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs @@ -144,7 +144,7 @@ xcode parse ( str -- n? f ) mov) r2 rd) r1 rm) ,) L4 abs>rel b) ,) -xcode emit ( c -- ) +xcode emit ( c -- ) \ Preserves r0, r1, r2 pc ldr) r3 rd) r7 rn) UART0_FR +i) ,) tst) r3 rn) $20 i) ,) @@ -392,7 +392,7 @@ lblnextmeta xaddr nextmeta xcode entry pushret, ( 'dict s -- ) mov) r6 rd) rTOP rm) ,) - ldr) r5 rd) r6 rn) 8b) 1 +i) post) ,) \ r7=a r6=len + ldr) r5 rd) r6 rn) 8b) 1 +i) post) ,) \ r5=a r6=len add) rTOP rd) r5 rn) 1 i) ,) \ rTOP=len+1 wcall, align4 \ rTOP='dict mov) r0 rd) r6 rm) ,) @@ -871,6 +871,26 @@ xcode uartinit str) r1 rd) r7 rn) UART0_CR +i) ,) exit, +pc to L1 ( halfbyte -- ) + cmp) rTOP rn) 10 i) ,) + add) lo) rTOP rdn) '0' i) ,) + add) hs) rTOP rdn) 'a' 10 - i) ,) + wjmp, emit + +\ Temporary debug tool +xcode dump ( a u -- ) + pushret, + r0 ppop, \ r0=a + mov) r1 rd) rTOP rm) ,) \ r1=u + xdrop, +pc + ldr) r2 rd) r0 rn) 8b) 1 +i) post) ,) + xdup, mov) rTOP rd) r2 rm) 4 lsr) ,) L1 abs>rel bl) ,) + xdup, and) rTOP rd) r2 rn) $f i) ,) L1 abs>rel bl) ,) + sub) r1 rdn) 1 i) f) ,) + ( pc ) abs>rel b) nz) ,) + popret, exit, + xcode main pc w>e lblsysdict pc>addr le! lblmain forward! pc