IRC channel logs
2022-11-10.log
back to list of logs
<zacque>Hi, I've just started learning about bootstrappable builds. I've done `nasm -o stage0_monitor stage0_monitor.S`, but how can test the output? <zacque>The instruction states `qemu -fda stage0_monitor`, but there is no qemu, only qemu-* on my system. (x86_64, Linux, Ubuntu) <zacque>Oh, I can boot with `qemu-system-x86_64 stage0_monitor` instead! Thanks, myself =D <rickmasters>zacque: maybe you know this but stage0_monitor is very low level program to start with. <rickmasters>zacque: running "./kaem.x86" from the top will run the normal build <stikonas[m]>./will start with bash. If you to use kaem run bootstrap-seeds/POSIX/AMD64/kaem-optional-seed <stikonas[m]>zacque: oh and you might want to start with stage0-posix first <zacque>rickmasters: Thanks! I'm fascinated by the idea that one can bootstrap everything from stage0_monitor(?), so I'm eager to study how it works <zacque>stikonas[m]: Oh, is stage0 and stage0-posix not the same? <stikonas[m]>rickmasters also has very small kernel that uses BIOS calls to run stage0-posix <zacque>Oh, is it the live-bootstrap project? <stikonas[m]>So we are still a bit away from being able to build Linux with it <rickmasters>the kernel builder-hex0 is a submodule and the source is from live-bootstrap, another submodule <zacque>Wow, all these sound amazing, and intrigue me to learn more! =D <zacque>I'm gonna start learning from hex0? Is this a good place to start? <stikonas[m]>Yes, it's fairly simple though you need to pick arch <zacque>I'm on x86_64, so it's AMD64 for me <zacque>Ah, I'm not family with uefi, so I'll start with POSIX one <zacque>Thanks for the C and assembly prototype! Now things start to make sense! <stikonas[m]>We probably need nicer M0 defines though, I've switched cc_amd to newer style that are closer to GAS syntax <stikonas[m]>Anyway, that will become clearer as you go through hex0, hex1 hex2 M0 and cc_amd64 <rickmasters>for hex0, I found that understanding the first command in x86/mescc-tools-seed-kaem.kaem was a good place to start because it's basically building itself <stikonas[m]>Basically it strips comments and converts ASCII encoded hexadecimals into bytes <zacque>I see, I'm looking at AMD64/mescc-tools-seed-kaem now <zacque>Can I know what does "kaem" stand for? <zacque>Not sure how to pronounce it as well, kaa-emm? <rickmasters>I don't know where kaem comes from. That's probably a question for oriansj <zacque>This link has other useful info as well! <rickmasters>yeah, the chat logs are invaluable, but unfortunately the search is not very good <zacque>Oh, the previous kaem-optional-seed.hex0 is rename to kaem-minimal.hex0? <zacque>And so kaem-minimal.hex0 is still 1:1 to kaem-optional-seed? <rickmasters>AMD64/kaem-minimal.hex0 and bootstrap-seeds/POSIX/AMD64/kaem-minimal.hex0 are the same <rickmasters>I'm not sure why the duplication but bootstrap-seeds is a submodule so its probably for convenience <rickmasters>but yes, I'm pretty sure the kaem-optional-seed binary originates from kaem-minimal.hex0 <rickmasters>Everyone: I have an update on my efforts on the next bootstrap kernel. <rickmasters>As a reminder, I reported on 10/17 that my efforts to build Linux with tcc were failing. <rickmasters>This project was started about 25 years ago and is still being worked on. <rickmasters>I have spent the last three weeks working with Fiwix and I believe it fits our requirements <rickmasters>for the next kernel system which can carry us the rest of the way to building and booting Linux. <rickmasters>I'm still in the early stages of this effort but I've learned a lot and solved some difficult problems along the way. <rickmasters>My initial focus has been on building it normally (with gcc), running it in qemu, and booting from a large ram drive. <rickmasters>I had to get really familiar with how it boots and manages memory, which evolves in several stages, <rickmasters>so that I could implement a new strategy for booting off a very large ram disk. <rickmasters>I'm pretty happy with how I got that working so I'm going to proceed soon on to building it with tcc. <rickmasters>There are errors compiling some of the assembly language with tcc so I'll have to work though that. <rickmasters>Anyway, I've got a pretty good idea of all the work that will be needed. <rickmasters>It will probably take a number of months to do but I'm pretty hopeful I'll be able to get it done. <rickmasters>I'll try to post updates periodically of my progress. <zacque>Okay! Now I've got an rough idea. But question: At the end of kaem.run, what do I have at my disposal? Is it M2-Planet or M2-Mesoplanet? <zacque>I don't see any mescc-tool around? <zacque>Ah, I get it, I get it. Thanks =D <stikonas[m]>M2-Mesoplanet is just a C preprocessor that can invoke M2-Planet, M1 and hex2 <stikonas[m]>M2-Planet has far weaker preprocess integrated but it has no include support <oriansj>zacque: I suggest learning posix -> uefi -> Bare metal and hex0->hex1->hex2->M0->cc_amd64->M2-Planet (yes kaem [I pronounce it like common] is just make scrambled ^_^) <oriansj>and of course rickmasters' kernel is currently the most advanced x86 bare-metal bootstrap to date <zacque>stikonas[m] oriansj: I see, thanks! <oriansj>zacque: and if anything doesn't seem obvious in bootstrap-seeds, stage0, stage0-posix, mescc-tools, mescc-tools-extra, M2-Planet or M2-Mesoplanet doesn't appear totally obvious please tell me as I consider that a defect that needs to be fixed.