IRC channel logs

2021-08-14.log

back to list of logs

***Noisytoot_ is now known as Noisytoot
<fossy>wtf mpfr
<fossy>configure: error: libgmp not found or uses a different ABI (including static vs shared).
<fossy>it is THERE
<pabs3>homemade silicon IC fab process: http://sam.zeloof.xyz/second-ic/ https://news.ycombinator.com/item?id=28176255
<stikonas>fossy: anything else in config.log?
<oriansj>fossy: as they say: bootstrapping is the discovery of all programming sins. Including unreliable kludges
<oriansj>pabs3: 1200 transistors!!! that is enough for a 12bit CPU (the PDP-8s only needed 519 gates total)
<oriansj>once it gets to the 16bit level, we will be able to leverage it to bootstrap all the way to up cc_* (32bit is needed for M2-Planet and above)
<stikonas>which tools require 16-bit?
<stikonas>just cc?
<oriansj>stikonas: no tools require 16bit. just only some tools fit within 64KB of RAM for both program and all working data
<stikonas>catm actually reserved 1MiB but that can be reduced...
<oriansj>absolutely (it can be reduced down to 1byte and still work; if only much slower)
<stikonas>and it's only on POSIX that it needs that...
<stikonas>on paper tape catm is almost optional...
<oriansj>stikonas: actually catm on bare metal would be needed on media forms that can not be manually combined. with a hit enter after inserting next media sort of thing
<oriansj>(hit q to finish sort of thing)
<stikonas>oh yes, if you use something like floppies
<oriansj>or magnetic tape or USBs or MicroSD cards, etc
<stikonas>btw, I spotted that bootstrap-seeds has an outdated amd64 hex0-seed...
<stikonas> https://github.com/oriansj/bootstrap-seeds/pull/7
<stikonas>and later (hopefully today) I should also have hex1 for risc-v
<stikonas>only need to encode branching jumps now (other ones are now done)
<oriansj>stikonas: nice
<oriansj>and thank you. merged
<stikonas>oriansj: and hex1 is up https://github.com/oriansj/stage0-posix/pull/37/
<stikonas>it's almost as large as hex2 for x86...
<oriansj>stikonas: well we knew that was likely because of the encoding complexity of RISC-V but it is nice to see that you managed to find a small subset for RISC-V to make the step a bit more auditable.
<oriansj>and merged
<stikonas>at least no more of this complicated label encoding
<stikonas>well, we'll still need to do other things (including encoding actual immediates) until we reach M1...
<oriansj>stikonas: atleast encoding immediates by hand is much less difficult.
<oriansj>Also the platform specific version of M1 is M0 which will support immediate encoding
<oriansj>hopefully this work has helped clear out any encoding bugs in hex2 that might cause us issues for RISC-V
<stikonas>well, yeah, I meant M0 actually...
<stikonas>and yes, I think encoding bugs should be cleared now
<stikonas>we'll see eventually
<stikonas>but in any case if there is anything left, should be a minor bug
<stikonas>but I did build those development files with C versions of hex2 and M1
<oriansj>stikonas: good. hopefully after you finish M0, we will have found and cleared out all M1 RISC-V bugs as well.
<stikonas>that will take some time... I'll be less available for half a month
<stikonas>but we'll get there
<oriansj>understandably. a half-month delay is no problem. Take care of your personal life first, the bootstrapping work can always wait. (If anyone has a problem with that, they are free to do all the work required themselves.)
<stikonas[m]>Sure, it's less tedious from now on anyway
<oriansj>stikonas: well in terms of manual offset calculations absolutely. In terms of effort: nope
<oriansj>everytime we make something easier, we use that additional power to build yet a bigger effort saver.
<stikonas[m]>Yeah, but that's more interesting coding
<oriansj>but also more difficult because it becomes large enough to lose track of all the pieces.
<stikonas[m]>I understand that effortwise it's not always easier
<oriansj>I like to think of it as a gently escalating slope. Requiring greater and greater skill in assembly programming.
<oriansj>hex0 one can do without any experience in assembly programming but by M0 you absolutely have to have the basics down solid.
<oriansj>cc_* requires the skills associated with large assembly program development and after which point you can consider yourself a skilled assembly programmer.
<stikonas>hmm, I guess so. Although things are made easier but lots of existing examples. It's quite a bit easier to retrace the steps once somebody did it for the first time
<stikonas>well, the simplest program is probably kaem-micro now :D
<stikonas>or maybe catm...
<stikonas>speaking of which, I should do catm for riscv64. Should be fairly quick
<oriansj>stikonas: to be honest, probably submitting proper ELF headers for RISC-V in mescc-tools along with a basic test https://github.com/oriansj/mescc-tools/tree/master/elf_headers would probably be a needed first step to enable Gnu MES to leverage our mescc-tools work for RISC-V
<oriansj>(you can literally just copy any of the hex2 and/or M1 programs already written and plug them in as a valid test)
<stikonas>yeah, I was thinking about them too. In any case it's simple
<stikonas>just need to replace a couple of hardcoded constants with labels
<stikonas>is somebody working on gnu mes?
<stikonas>for risc-v?
<oriansj>I believe so. give me a minute to check my notes to see who
<stikonas>ok, I found a commit from May by janneke
<stikonas> https://git.savannah.gnu.org/cgit/mes.git/log/?h=wip-riscv
<stikonas>that might not be the latest info
<stikonas>anyway, elf headers would be required for M1 in any case
<stikonas>sorry for cc_*
<stikonas>it's written in .M1
<stikonas>so we need to prepend the header
<oriansj>it does match the info I have saying a laanwj is doing RISC-V work for MES
<oriansj>actually elf headers are written in hex2 not M1 and are needed for M0
<oriansj>that is why the %label1>label2 support is needed in hex2
<stikonas>it's probably a good idea to use headers by then, but I guess that's not stricly a requirement.
<stikonas>M0 is written in hex2, so can still prepend it
<oriansj>it is required for: ph_filesz, ph_memsz, e_phoff and e_shoff
<stikonas>(that doesn't win us anything though)
<stikonas>M0 uses those fields?
<oriansj>stikonas: ALL ELF files do
<oriansj>you just have been manually calculating them up until this point
<stikonas>well, yes, but that is one time job since header is static
<stikonas>it becomes more important once you have debug builds etc...
<oriansj>ph_filesz and ph_memsz are just the size of the file
<stikonas>oh, I think for riscv we don't calculate those..
<stikonas>hmm
<stikonas>at least I didn't change anything
<stikonas>let me check
<stikonas>oh yes, might need to update those...
<stikonas>I didn't update those for any of my hex0 files
<stikonas>they still seemed to work but I guess better to fix
<stikonas>I guess it sets .text are RO there
<stikonas>oriansj: that's for bootstrap-seeds https://github.com/oriansj/bootstrap-seeds/pull/8
<oriansj>stikonas: if the values are wrong a little bit it is ok. BUT if the values are too low and your program will not be entirely loaded into memory
<stikonas>once you merge it, I'll update submodule in stage0-posix and do fixes there too
<stikonas>well, let's fix them properly
<stikonas>because for hex1 it was already 3 times smaller than program size
<oriansj>e_phoff is either 0x34 or 0x40 for 32- and 64-bit ELF executables, respectively. and e_shoff are where to lookup the section headers (blood-elf output) in early stages will just be zero
<stikonas>yeah, e_phoff was already set to 0x40
<oriansj>bootstrap-seeds merged
<stikonas>and there is an unnecessary TODO in e_entry, I think it can be removed...