\ Print statistics about the size of Dusk OS needs io/stream fs/core fs/sh lib/str xcomp/deploy : bc walksize ; : bc< ( -- bytecount ) strings< 0 swap 0 do swap ".fs" strcat lookup# bc + loop ; : dirbc ( -- bytecount ) 0 enterdir begin gotonext while walkdir? if walk>r dirbc r>walk + else bc + then repeat ; : listbc ( stringlist -- bytecount ) 0 begin over c@ while over ".fs" strcat lookup# bc + dip s) | repeat nip ; stringlist ignore doc data tests bench : allcode ( -- bytecount ) 0 bootfs walk begin gotonext while walkname lowstr ignore sfind if drop else walkdir? if walk>r dirbc r>walk + else bc + then then repeat ; : .k $400 /+ formatdec 6 rot> rtypeleft ; : spit" ( n -- ) 40 [rcompile] " c@+ rtypeleft .k nl> ; ."Kilobytes of code in Dusk OS\n" allcode spit"Everything but /doc /data /tests /bench" p"doc" dirbc spit"Documentation" p"tests" dirbc p"bench" dirbc + spit"Automated tests and benches" bc< xcomp/boot xcomp/lo fsUnits listbc + fatUnits listbc + spit"Boot payload minus HAL" bc< com/link com/ether com/slip com/arp com/ip4 com/udp com/net com/tcp com/tcb spit"TCP/IP stack (in progress)" bc< comp/tok comp/sym comp/sig comp/reg comp/mem const compcommon p"comp/c.fs" bc p"comp/c" dirbc + compcommon + spit"C compiler" p"comp/oberon.fs" bc p"comp/oberon" dirbc + compcommon + spit"Oberon compiler" p"oberon" dirbc spit"Oberon system" p"comp/lisp" dirbc bc< comp/lisp mem/cons + spit"Lisp" bc< text/ed app/ed spit"Text Editor" p"drv" dirbc spit"All drivers" p"bench/codesz.fs" bc spit"This script" nl> : .col1" 16 [rcompile] " c@+ rtypeleft ; ."CPU-specific... i386 amd64 arm riscv m68k \n" .col1"Assembler" p"asm/x86.fs" bc .k ."same " p"asm/arm.fs" bc .k p"asm/riscv.fs" bc .k p"asm/m68k.fs" bc .k nl> .col1"Disassembler" p"asm/x86d.fs" bc .k ."same " p"asm/armd.fs" bc .k p"asm/riscvd.fs" bc .k p"asm/m68kd.fs" bc .k nl> .col1"Kernel" bc< xcomp/x86/kernel xcomp/x86/kernelm const x86kernel p"xcomp/i386/kernel.fs" bc x86kernel + .k p"xcomp/amd64/kernel.fs" bc x86kernel + .k p"xcomp/arm/kernel.fs" bc .k p"xcomp/riscv/kernel.fs" bc .k p"xcomp/m68k/kernel.fs" bc .k nl> .col1"HAL" p"xcomp/hallo.fs" bc const hallo bc< xcomp/x86/hallo xcomp/x86/hal2 xcomp/x86/hal4 const x86hal bc< xcomp/i386/hal1 xcomp/i386/hal3 xcomp/i386/hal5 x86hal + .k bc< xcomp/amd64/hal1 xcomp/amd64/hal3 xcomp/amd64/hal5 x86hal + .k bc< xcomp/arm/hallo xcomp/arm/hal .k bc< xcomp/riscv/hallo xcomp/riscv/hal .k bc< xcomp/m68k/hallo xcomp/m68k/hal .k nl> .col1"EFI interface" p"xcomp/i386/efi/kernel.fs" bc .k p"xcomp/amd64/efi/kernel.fs" bc .k nl>