duskos

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

commit 2707d7a8286a35885d583c11d08e8bc2c0530219
parent bc9802aec56b479361ae1169fc4bc4b6a0096546
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Mon, 12 Jun 2023 16:53:30 -0400

rpi: turns out that lib/fmt works fine

I don't know why it seemed broken to me earlier...

Diffstat:
Mfs/xcomp/arm/rpi/build.fs | 1+
Mfs/xcomp/arm/rpi/init.fs | 24------------------------
2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/fs/xcomp/arm/rpi/build.fs b/fs/xcomp/arm/rpi/build.fs @@ -18,6 +18,7 @@ org value kernel S" /xcomp/arm/rpi/glue.fs" V1 spitfile S" /lib/struct.fs" V1 spitfile S" /sys/io.fs" V1 spitfile + S" /lib/fmt.fs" V1 spitfile S" /sys/rdln.fs" V1 spitfile S" /xcomp/arm/rpi/init.fs" V1 spitfile r> IO :flush ; diff --git a/fs/xcomp/arm/rpi/init.fs b/fs/xcomp/arm/rpi/init.fs @@ -1,28 +1,4 @@ : _:emit ( c self -- ) drop uart! ; ' _:emit ByteWriter :new dup to console writeio to stdio writeio -\ A poor man's lib/fmt -struct+[ IO - create _buf 11 allot - create _ ," 0123456789abcdef" - : _xh ( n -- c ) $f and _ + c@ ; - : _xn ( n digits self -- ) - >r dup >r for ( n ) \ V1=self V2=digits - dup _xh _buf i 1- + c! 4 rshift next drop - _buf r> r> :write ; - : :.x1 2 swap _xn ; - : :.x2 4 swap _xn ; - : :.x 8 swap _xn ; - - : _ ( n self -- ) >r 10 /mod ( r q ) ?dup if r@ _ then '0' + r> :putc ; - : :. ( n self -- ) >r - ?dup not if - '0' r> :putc else - dup 0< if '-' r@ :putc 0 -^ r> _ else r> _ then - then ; -]struct - -: .x stdio :.x ; -: . stdio :. ; - : init ." Dusk OS\n" rdln$ stdio$ quit ; init