avsm changed the topic of #mirage to: mirage 2 released! party on!
rgrinberg has quit [Ping timeout: 276 seconds]
rgrinberg has joined #mirage
rgrinberg has quit [Ping timeout: 276 seconds]
brson has joined #mirage
brson has quit [Quit: leaving]
insitu has joined #mirage
insitu has quit [Ping timeout: 264 seconds]
insitu has joined #mirage
srenatus has joined #mirage
copy` has quit [Quit: Connection closed for inactivity]
insitu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
insitu has joined #mirage
dexterph has joined #mirage
AltGr has joined #mirage
andreas23 has joined #mirage
mort___ has joined #mirage
tg has quit [Ping timeout: 246 seconds]
tg has joined #mirage
mort___ has quit [Quit: Leaving.]
AltGr has left #mirage [#mirage]
jermar has joined #mirage
insitu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yomimono has joined #mirage
yomimono has quit [Quit: Leaving]
mort___ has joined #mirage
<mato> hannes: around now, was not checking irc earlier
<hannes> mato: so I generated an iso image, and tried to boot it with this grub, but that complained that the magic is wrong... I modified grub to not check for the magic, then it complained it cannot boot 32bit mode, I removed that check as well, but it doesn't seem to boot...
<mato> interesting
<mato> can you point me to the source of the grub that bhyve uses?
<hannes> mato: and https://gist.github.com/hannesm/0577518a05f2ad507f6812ee2aaf154b is my patch to make it not complain at the virtio image
<hannes> (I've no clue about booting)
<hannes> (it might be that some memory massaging is necessary, afaik they do it in the patched grub for open/netbsd already..)
<mato> that's weird, it shouldn't be using the linux load code
<mato> how exactly do you boot it? can you give me a list of commands?
<hannes> mato: oh, it might as well be sth I do wrong...
<hannes> grub-bhyve -m device.map -r cd0 -M 1024M console (where device.map contains (cd0): mir-console.iso)
<hannes> linux (cd0)/boot/kernel in the grub shell ; boot
<hannes> and then bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 4:0,ahci-cd,./mir-console.iso -l com1,stdio -c 4 -m 1024M console
<mato> hannes: try "multiboot (cd0)/boot/kernel" instead of "linux ..."
<hannes> i will after coffee :)
mort___ has quit [Quit: Leaving.]
<hannes> grub> multiboot (cd0)/boot/kernel
<hannes> error: no multiboot header found.
mort___ has joined #mirage
<mato> hannes: did you change anything while getting virtio to build for you on freebsd? linker script, etc?
<hannes> no
<hannes> if you've a virtio multiboot image build on some linux, can you mail that to me to see whether my grub bhyve is happy with it
<hannes> ?
<mato> hannes: done
<mato> still going thru the grub code...
<mato> i don't see why it should fail -- the multiboot header is correctly aligned and starts at 0x1000 in the ELF file
<hannes> your image was accepted by my grub
<mato> aha!
<hannes> looks like I've to investigate (and see how to connect a console to see actual output)
<hannes> it would help (me) if you could also give me an image which uses ocaml + mirage... :)
<mato> sure, hang on
mort___ has quit [Quit: Leaving.]
<hannes> .oO(sorry for being pretty clueless about booting and bhyve... I just want to have it running here on my laptop ;)
<mato> i just emailed you a mir-stackv4.iso.gz
<hannes> got output \o/ (from the solo5)
<hannes> happy hannes :D
<mato> goodo
<hannes> soon burning down all the xen machines I have ;)
<mato> hey, nothing wrong with xen :)
<hannes> I tried running FreeBSD-dom0 for some time on my laptop, it is a pain
<hannes> (but that is me struggling with this linux)
<hannes> I'll as a first step try to build a solo5-test-iso on my box
<mato> i'd help you test but the only freebsd i have is a xen vm and bhyve won't run on that...
<hannes> no worries
<mato> incidentally, i don't know what grub-bhyve can or can't do -- if it can access files on the "host" then you might not need an ISO at all and could boot the .virtio file directly
<hannes> yes, needs investigation... likely that we don't need the iso (but y'day I was stuck so I tried an iso)
<hannes> (solo5: is there a reason the makefile targets are named with postfix _target? virtio_target ukvm_target)
<mato> hannes: there are virtio/ and ukvm/ subdirs in kernel/, that's probably why
<mato> i'd make the default not build ukvm on non-Linux but that would need some kind of configure script, feels like too much work :)
<hannes> so, building here the resulting virtio image does not work (bad multiboot magic)...
<mato> go look at 0x1000 with a hex editor and see what's in there :)
<hannes> and yes, no need for .iso... I can multiboot (host)/bla.virtio
<hannes> 0
<hannes> 00000b0 0000 0000 0000 0000 0000 0000 0000 0000
<hannes> *
<hannes> 0100000 b002 1bad 0003 0001 4ffb e451 0000 0010
<hannes> (where's yours has the b002 at 0x1000, mine has it at 0x100000)
<mato> can you post the output of "readelf -S" on your .virtio somewhere?
raindev has joined #mirage
jmiven has quit [Quit: co'o]
jmiven has joined #mirage
<mato> hannes: No idea what's going on there :( It looks like your ld is laying out sections at 1MB in the output file, when it should just be setting the virtual address to start at 1MB
<mato> hannes: FreeBSD seems to be using a very old version of GNU ld (2.17.50 from 2007 on my FreeBSD 10 box) so it might be a linker bug
<hannes> this is a GNU ld 2.17.50... I'll dig a bit more
<mato> anyhow, the good news is that a correctly built image boots on bhyve!
raindev has quit [Ping timeout: 246 seconds]
raindev has joined #mirage
<mato> hmmm, there is a bunch of skeletons hiding in the linker script stuff, i may have found something....
<hannes> setting . = 0x1000 let's the multiboot command to come through, but boot doesn't like it..
mort___ has joined #mirage
rgrinberg has joined #mirage
<mato> hannes: no, that won't work. interestingly, if i remove the max-page-size option from the final ld command, I get the same behaviour on Linux as you see on FreeBSD
<mato> i'm trying to figure out why that option is required in the first place, since it's not used for rumprun
<mato> however all of the linker script stuff is a bit voodoo
<hannes> ack
mort___ has left #mirage [#mirage]
<hannes> mato: using 0x1000 as start for .bootstrap results in https://0bin.net/paste/QXruVa9mnl9cC9ur#6fdP1Pvb-wAd20NI3/U/XEVBwZhWF5u8xfMUrUpcAHM which looks very similar to yours
raindev has quit [Ping timeout: 260 seconds]
<mato> yeah, but that won't work, the virtual address needs to be at 1M
<mato> hannes: what happens if you use the original linker script (with . = 1m) and link with --nmagic ?
<hannes> works! \o/
<mato> hmph
<hannes> not good?
<mato> no, good.
* mato mumbles something about obscure linker "defaults"
<mato> i'll fix it to do that and clean up the linker scripts at the same time, will give you a branch to test
<hannes> I have had some experience with linker scripts (and arguments), but similar to today it is hard to find decent documentation thereof...
insitu has joined #mirage
raindev has joined #mirage
<mato> hannes: can you verify that https://github.com/djwillia/solo5/pull/52 works as expected for you?
<hannes> mato: thx, it does
jmiven is now known as vpm
agarwal1975 has quit [Quit: agarwal1975]
<mato> great, will merge it
<mato> when you get a moment, perhaps send a report (with the grub-bhyve instructions) to mirageos-devel
srenatus has quit [Quit: Connection closed for inactivity]
<hannes> mato: https://github.com/djwillia/solo5/pull/53 ... would be great if you can test that on non-BSD (I tried it with all the cc's I have around, also on some ubuntu)
<hannes> mato: I'd rather work a bit more to get MirageOS on bhyve, and then write that up :)
<hannes> also works with clang here locally :)
<mato> as in "just works"? cool!
<hannes> well... I removed libgcc.a from LDFLAGS... and still need to provide it with some headers (stddef.h stdint.h)
<hannes> which I currently use the gcc48 ones...
<mato> yeah, i'm not entire sure what to do about that -- stddef.h & friends are technically "compiler specific"
<mato> where does clang get those from? are they just shipped as part of /usr/include on freebsd?
<hannes> yes
<hannes> (and with openlibm it gets worse.. that also wants to have machine/endian.h (which here depends on x86/endian.h) and osreldate.h (all 3 in /usr/include))
agarwal1975 has joined #mirage
tg has quit [Quit: Leaving]
tg has joined #mirage
<mato> ugh ugh ugh. --nmagic has other side effects, which has broken the ukvm target
<hannes> when I try the mirage stack on top of solo5, I get on the console:
<hannes> multiboot: Using memory: 0x100000 - 0x40000000
<hannes> TSC frequency estimate is 2593960720 Hz
<hannes> Solo5: new bindings
<hannes> STUB: getenv() called
<hannes> exception from rip=0x18
<hannes> got page fault (0xe)
<hannes> PANIC: interrupts.c:200
<hannes> errorcode was (0x0)
<hannes> where I expected to see an OCaml hello world..
<mato> hmm, right, but it was working at some stage before, wasn't it? (with the original ISOs I gave you)
<hannes> I have not tested that iso yet.. ;) (was busy cleaning/streamlining my patches and getting clang in the game)
<hannes> ok, yours works...
<mato> aw great, *now* some neighbour decides to start drilling
andreas23 has quit [Quit: Leaving.]
<hannes> (thus likely some stupidity in my freestanding/libm/bindings, will investigate..)
<mato> it may also be a consequence of the ldscript / nmagic stuff, which I need to revert
<mato> I *think* I've found a workaround that will make your old ld work
<mato> hannes: can you check the link still works for you with this?
<mato> hannes: The workaround seems to be not to muck with OUTPUT_FORMAT() in the ldscript, otherwise it triggers a bug in the (old!) FreeBSD linker: https://sourceware.org/ml/binutils/2009-08/msg00512.html
<hannes> it does work!
<mato> ok, great
raindev has quit [Ping timeout: 240 seconds]
<hannes> mato: does alpine provide a cc (as a symlink to gcc); if so, could you please merge https://github.com/djwillia/solo5/pull/55 (so that I have less git branch/merge headaches)
insitu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
insitu has joined #mirage
<hannes> (but even with those changes, a MirageOS virtio VM compiled locally doesn't work, will dig deeper)
insitu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dexterph has quit [Ping timeout: 264 seconds]
<mato> hannes: yes it does, will do in a sec
<mato> does a gcc-compiled version work? that'd be the first thing i'd check.
agarwal1975 has quit [Quit: agarwal1975]
raindev has joined #mirage
raindev has quit [Remote host closed the connection]
agarwal1975 has joined #mirage
<hannes> same issue with gcc...
<hannes> there's a page fault while initialising the caml runtime afaics...
<mato> hannes: time to pull out the debugger :)
<hannes> yes.. do you in general have sensible backtraces using solo5? or should I start (as usual) with printf debugging?
<mato> hannes: backtraces should in general work
<hannes> ok, will try :)
<mato> hannes: i have to go now, may be around briefly tomorrow to merge things, if not then monday
<hannes> thanks for your time! highly appreciated!
<hannes> oh, one minor thing..
<mato> yes?
<hannes> you sent me mir-stackv4... would you mind sending me a mir-console.virtio (not iso) as well? thus I can comapre hexdumps
<mato> sure
jermar has quit [Ping timeout: 272 seconds]
<mato> hannes: done. other things worth comparing are readelf -l and readelf -S
<mato> hannes: cyl...
brson has joined #mirage
tg has quit [Ping timeout: 264 seconds]
tg has joined #mirage
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #mirage
tg has quit [Ping timeout: 250 seconds]
tg has joined #mirage
jermar has joined #mirage
rgrinberg has quit [Ping timeout: 260 seconds]
betheynyx has quit [Read error: Connection reset by peer]
jermar has quit [Read error: Connection reset by peer]
sigjuice has quit [Ping timeout: 252 seconds]
rektide_ has quit [Ping timeout: 252 seconds]
aantron has quit [Ping timeout: 252 seconds]
insitu has joined #mirage
sigjuice has joined #mirage
aantron has joined #mirage
rektide has joined #mirage
jermar has joined #mirage
copy` has joined #mirage
insitu has quit [Ping timeout: 260 seconds]
insitu has joined #mirage
betheynyx has joined #mirage
jermar has quit [Read error: Connection reset by peer]
insitu has quit [Ping timeout: 250 seconds]
insitu has joined #mirage
tg has quit [Quit: Leaving]
tg has joined #mirage
jermar has joined #mirage
insitu has quit [Ping timeout: 244 seconds]
StrykerKKD has joined #mirage
rgrinberg has joined #mirage
raboof_ has joined #mirage
agarwal1975 has quit [Quit: agarwal1975]
raboof has quit [Write error: Broken pipe]
sknebel has quit [Write error: Broken pipe]
tg has quit [Quit: Leaving]
sknebel has joined #mirage
tg has joined #mirage
agarwal1975 has joined #mirage
tg has quit [Ping timeout: 264 seconds]
tg has joined #mirage
tg has quit [Quit: Leaving]
tg has joined #mirage
jermar has quit [Ping timeout: 240 seconds]
tg has quit [Ping timeout: 276 seconds]
tg has joined #mirage
StrykerKKD has quit [Read error: Connection reset by peer]
rgrinberg has quit [Ping timeout: 276 seconds]