IRC channel logs

2023-08-02.log

back to list of logs

<oriansj>muurkha: yeah the 8KB assembler found down on this page: https://board.flatassembler.net/topic.php?t=22633
<Piraty>is there a maintained variant of gcc4 ?
<drakonis>oriansj: it is a fun thing
<drakonis>how feature packed can you make a 8kb assembler?
<drakonis>alternatively, make it as basic as possible to bootstrap a better assembler on top of it
<muurkha>oriansj: thanks
<muurkha>fasm8k.zip
<notgull>Macro assemblers are trippy to me
<notgull>Potentially stupid bootstrap idea: bootstrap to a WASM vm to avoid target-specific work
<[exa]>...well you can bootstrap to a MIPS VM to avoid 10000x the amount of WASM-specific work
<[exa]>(and emulate MIPS)
<notgull>Interesting, I was under the impression that a WASM VM is easier to emulate than other contemporary architectures
<[exa]>wasn't WASM requiring a jit compilation to be cpu-style interpretable? (I never really got how the functions are actually labeled there)
<notgull> https://github.com/yblein/rust-wasm This is a very simple Rust implementation without any JIT whatsoever
<[exa]>ahhhhhhhhhh ok that was the other web thing that required linkage
<[exa]>this is basically miniforth, could work.
<notgull>I've been watching bootstrap from afar, been meaning to figure out how to setup QEMU and get into it
<notgull>Glad that you like the idea, time to write a WASM VM in macro assembly :-)
<[exa]>yeah actually shouldn't be THAT hard
<[exa]>it's got only <256 instructions :D
<notgull>The hardest thing would be implementing the external API that lets you have useful side effects (like int 18h)
<notgull>As well as getting actually useful software to run on it
<mala>this may be COMPLETELY unuseful but I heard that the Spritely kids are building a WASM VM in Guile
<[exa]>notgull: technically you don't need that much, unix is quite useful with like 10 syscalls
<stikonas>notgull: we discussed WASM before too... Potentially it can be used as a precursor to cc_* (WASM might be simpler than C)
<stikonas>but you would still need hex0->hex1->hex2->M0->wasm
<stikonas>though it is likely to be slow...
<stikonas>interpreters are much slower than compiles as can be seen from mes...
<stikonas>notgull: presumably for external API you need something like inline assembly...
<stikonas>and then instead of M2libc we have M2libwasm
<notgull>I was thinking that it might be useful in the bare metal to write the WASM interpreter to disk and then boot to it, that way we could use it as an OS to get around the 1MB memory restriction
<stikonas>no we have 1 MB memory restriction?
<stikonas>s/no/do/
<notgull>I thought that, on x86 BIOS, you can't use more than 1 MB of memory without entering real mode
<notgull>s/real/protected
<stikonas>real mode maybe, but you can switch to 32-bit mode
<stikonas>I think that's what builder-hex0 does
<notgull>Ah, I see, you switch back and forth
<stikonas>indeed
<notgull>In my own adventures I was going to see how little it would take to bootstrap to a minimal protected-mode OS that could then bootstrap OpenBSD or a simpler OS than that
<stikonas>well, given that builder-hex0 can bootstrap Linux, it can then also bootstrap OpenBSD
<stikonas>so that gives you an upper bound
<stikonas>and the stage1 part of builder-hex0 (which combines hex0 with reading disk and jumping to stage2) is about 200 bytes
<notgull>Okay, I may be a bit lost. Is there a way to patch TinyCC or whatever to not use syscalls outside of the ones that builder-hex0 supports?
<stikonas>that depends on your libc
<stikonas>builder-hex0 supports enough syscalls to run tcc
<stikonas>the questions is whether the software you are building with tcc needs those extra syscalls
<stikonas>and some stuff, .e.g. make indeed needs more
<stikonas>but by then you can build Fiwix (on x86)
<notgull>Oh, I see. That makes this whole thing make a lot more sense
<notgull>I remember reading the bootstrap list on the Miraheze wiki
<stikonas>parts.rst in live-bootstrap might have more descriptions
<stikonas> https://github.com/fosslinux/live-bootstrap/blob/master/parts.rst
<stikonas>though for full picture you might need to look at individual Readmes of some early projects
<stikonas>hmm, I'm struggling to make my riscv64 soc visionfive2 boot without initramfs :(
<notgull>I see, thanks!
<stikonas>can't understand why sdcard driver does not kick in. Even though I compiled it into kernel binary...