IRC channel logs
2023-04-20.log
back to list of logs
<muurkha>oh hi roconnor, glad to see you here! this is Kragen <muurkha>unfortunately I don't know the answer to your question <roconnor>I've been playing with stage0-posix today. It's not nearly as intimidating as I thought it would be. <muurkha>maybe if you have qemu-user installed you can get test-all to work? <fossy>Mikaku: i've just been playing a bit with the kexec stuff you impl'd in Fiwix, and I tried to see if it could load GRUB (from which we could load anything) - this is the image I used http://ttm.sh/WG7.img. grub-file believes it is multibootv1 compliant. however it just hangs on the actual kexec invocation after shutdown. any ideas? <Mikaku>fossy: well I've only tested it with the Fiwix kernel and this ELF has different addresses in PLOADS <Mikaku>fossy: anyway, did you changed the hard core entry address? <Mikaku>unfortunately this is hard coded meanwhile I find a way to pass two values to 'ljmp' in inline assembly code <Mikaku>(I'll be away for a couple of hours, sorry) <fossy>Mikaku: no, i didn't missed that reading over the code! (no worries abt being away, TZ make this kind of thing very asynchronous anyways) <Mikaku>fossy: I'll use the file WG7.img to fix the kexec code and make a little bit more generic <fossy>fwiw, if i change that hardcoded address to grub's entrypoint 0x00009000 it does boot grub - however grub fails due to some kind of memory corruption - not sure why yet <Mikaku>fossy: I'm seeing that 'objdump -S' is unable to disassemble WG7.img, but I don't know why <Mikaku>the command 'file' says the same for WG7.img and for Fiwix, the only difference is that symbols in WG7.img are stripped <Mikaku>but that shouldn't suppose a problem <Mikaku>fossy: is this WG7.img a kind of a kernel? I mean, what should I expect to see if it runs correctly? <fossy>Mikaku: this is a multiboot GRUB image <fossy>as in, GRUB compiled into multibootv1 compatible elf <Mikaku>I see, and it loads and runs correctly when calling (like a kernel) from another GRUB? <fossy>hmmm, or maybe it doesn't, and grub is actually just resetting lol <fossy>it's a bit difficult to tell the difference... <Mikaku>well, I think GRUB expects to be executed in real-mode, which is not the case when using kexec <fossy>really? when I kexec'd it, it produced "Welcome to GRUB" at least, and got stuck on a sanity check <fossy>i thought that since the image (WG7.img) is multibootv1 compatible, it would work.. <Mikaku>in any case, is strange that objdump is unable to disassemble it <fossy>yes, i do find that rather strange <river>has anybody got a completely linear shell build script to build gcc? [please do not go to any trouble to answer this, this is not for anything useful. i am just wondering] <fossy>stikonas[m]: do you need to? this is to kexec fiwix->linux - we can build it with gcc <stikonas[m]>fossy: oh true, I forgot that this is for booting Linux <oriansj>river: but it is possible to generate one from the output of running of the makefile <stikonas[m]>And will need to create some extra files that autotools does for us <river>alright! sounds like no one has bothered to do this <river>so its not really a useful thing to have lying around <oriansj>well, makefiles really are much easier to maintain than the corresponding list of shell commands <stikonas[m]>No, in live-bootstrap we stop writing completely linear scripts after tcc <stikonas[m]>Which are still a bit annoying to write without configure but a bit easier <oriansj>river: bootstrapping doesn't have to be useful; it just has to help you get to the place where you want to be. Useful to others is just a nice extra. <Mikaku>but the keyboard doesn't works, I'll try enabling interrupts .. <Mikaku>fossy: do you know if GRUB configures the Interrupt Descriptor Table? that would be the cause that keyboard is not working <Mikaku>anyway, the original problem was that the Fiwix kexec implementation didn't clear the "low" memory (from 0x0 to 0xA0000) before copying the new kernel <Mikaku>so I guess that GRUB has uninitialized variables that it counts they will have a zero value <Mikaku>but well, I guess GRUB assumes that it will be always executed right after a reboot <stikonas>though in some modes it's definitely not true, e.g. UEFI gives no guarantees about state of memory <stikonas>though maybe in that case grub does initialization but not in bios/multiboot mode <stikonas>I remember when I was working on stage0-uefi, there were initially some bugs due to me not zero-initializing the memory (which we don't always do in stage0-posix) <roconnor>building tcc from mes has scary warning. :)