IRC channel logs
2024-04-15.log
back to list of logs
<sneek>solid_black, you have 2 messages! <sneek>solid_black, azert says: that I made substantial advances toward enabling IRQs and I figured out that kalloc has some serious bug <sneek>solid_black, azert says: please consider reviewing and applying this patch, https://paste.debian.net/1314115/ , for me it makes little sense to work on this more until we fix kalloc, since results are quite unpredictable <azert>solid_black: that’s a tentative workaround <azert>I had to use static allocation otherwise the content of the srcs[] array is inconsistent <azert>It returns memory that doesn’t exist <azert>You write in it and it is ignored <solid_black>are we doing something wrong with the RAM vs vm_page? <solid_black>I mean, our handling of available RAM is certainly not in any way robust, but I wouldn't expect us to straight out hand out nonexistent memory <solid_black>also, if you write to bad memory I'd expect it to raise an exception or something <solid_black>part of it is a linear mapping, but we also just map individual pages <azert>Then im not sure what is happening <azert>Where is the ram detected? Might be an issue with the detection <azert>The jtag connectionof my board is used for the smart card <solid_black>and it kind of continues in pmap_bootstrap and pmap_bootstrap_misc <azert>It’s probably trivial to enable the inkernel debugger <solid_black>(or, maybe I could annoy youpi until he explains it to me :D) <azert>We use the same kernel debugger <azert>Where would you add some messages about memory ranges detected? <solid_black>you could log it inside pmap_discover_physical_memory if you want to, but be aware that this runs before we turn on the MMU so you need to use the UART's address without the highmem 0xffff thing <solid_black>I don't think there's anything too broken about that logic though <solid_black>maybe you could try to add some tracing to whatever code allocates physical pages / kalloc <azert>Could you add that it would be useful for me <solid_black>what you could certainly do (do you do that already?) is add tracing to pmap_enter <solid_black>so you see what physical address is that problematic virtual address mapped to, at least as far as Mach itself is aware <azert>Im not sure im confident enough in that part <azert>Ok, I suspect I found the buf <azert>No device of type memory on my device tree <solid_black>but I can't imaigne how that could work, under any kernel <azert>There might be other ways to discover the memory on such chips <solid_black>could it just be named something else in the device tree? <solid_black>dma-ranges = <0x00 0x40000000 0xc0000000> that looks like your ram, no? <solid_black>I'm honestly surprised that anything has worked for you at all w/o physical memory <solid_black>does Linux boot on your board using UEFI and not DT? <azert>It’s booted using the device tree <solid_black>can you see (and maybe post) logs of Linux bootup? does it discover memory? <azert>I cannot find how netbsd finds the physical memory otherwise I’d tell you <azert>I’d prefer not to look at Linux, i would rather check netbsd <azert>Their kernel is based on Mach too, although much more advanced <azert>the Mach vm to the bsd kernel <anatoly>was it like big single unix process for everything unix on earlier versions of mach? <azert>The vm subsystem evolved considerably <solid_black>anatoly: early versions of Mach (pre 3.0) were colocated with BSD <azert>anatoly that was cales BSD Lite <solid_black>this is coincidentally (not) what NeXT did with their system <solid_black>they pretty much took Mach 2 / BSD, and based their system on that <solid_black>then in Mach 3, they (Mach developers) were finally able to more BSD from kernel space to userland, as one giant server ("Lites"), yes <solid_black>they ported to Mach 3 later, but retained the in-kernel BSD design <solid_black>which was a framework for writing device drivers, inside the kernel, in objective-C <anatoly>but the time to rewrite all of that in rust has come :-D <solid_black>yes, I've long wanted somebody to made gnumach-rs :D <solid_black>could even make it a drop-in replacement, keeping ABI <azert>netbsd is much more simple, but they took a lot from Mach. I’m not sure stating that they just ported the vm is accurate. Although it’s hard to say what went in which directions for me, since I don’t know the pre mach bsd enough <anatoly>I was thinking about mig as a possible exercise to learn that part <azert>The similarities in the code base are quite clear <anatoly>but I guess there's not much in it to benefit from such rewrite <azert>MIG is pure yacc and bison, you might as well write a better idl compiler instead of rewriting MIG <solid_black>azert: the device tree spec really requires a /memory node as you can see <solid_black>so I'm inclined to say that this is a bug in your device tree <solid_black>that you could report to... whatever the source of that is, Linux probably <solid_black>but in the mean time, you could try adding a /memory node from U-Boot? <azert>solid_black I don’t think I’m going anywhere with this <azert>if that node is not there it means surely something <solid_black>it would be best to research how others deal with it, sure <azert>I’ll add this node from u-boot, it should be easy. But others deals with it for sure <azert>Let me just add the node. There are more pressing things to fix <azert>Could you copy paste here the one from qemu? <anatoly>azert: that's what I think as well, not so much there beside yacc <solid_black>sure, memory@40000000 { reg = <0x00 0x40000000 0x00 0x40000000>; device_type = "memory"; } <anatoly>Oh! What's the state of rust on hurd? Patches were submitted, right? <solid_black>since you have it set to 1 as I can see, drop both 0x0-s <solid_black>anatoly: I think they were all even merged into upstream Rust <solid_black>so, I'd say, it's waiting for Debian to build Rust packages <anatoly>solid_black: yep, wasn't sure about the merge part <azert>Adding the memory node doesn’t help <azert74>vm_page: page table size: 262144 entries (20480k) <azert74>vm_page: DMA: pages: 262144 (1024M), free: 213940 (835M) <azert74>vm_page: DMA: min:13107 low:15728 high:26214 <azert74>timer: found armv8 compatible timer, clock-frequency=24000000 <azert74>gicv2: found gic-v2 compatible interrupt controller at distributor=ffff000001c81000(size=00001000), cpu=ffff000001c82000(size=00002000) <azert74>gicv2: prop name interrupts, length 48 <azert74>gicv2: isppi, irq, flags = 0x00000001, 0x0000001d, 0x00000f04; nsrcs = 0 <azert74>../aarch64/arm/gic-v2.c:170: gic_v2_add_src: Assertion `gic->srcs[irq - 16] == NULL' failed.panic ../kern/debug.c:107: Debugger: Debugger invoked, but there isn't one! <azert74>the latest assertion happens just because the kalloced memory doesn't work <azert74>I reverted the static allocation of srcs <azert74>since the kalloc bug is worse than anything <solid_black>azert: the assertion is there because we don't support two devices sharing the same irq <solid_black>so when setting an irq handler, we want to make sure nothing else uses the same irq <solid_black>this same assertion also fails for me on qemu after reboot (but not on initial boot) <solid_black>which might indicate that we don't always zero out memory properly, or something like that <azert>That’s not the case over here, nsrcs was zero <azert>The assertion fails because kalloc provides something unreliable <solid_black>so this must be that special kind of memory that ignores writes and always reads 0xff? <solid_black>can you print the address you got from kalloc, and also trace pmap_enter's? <dsmith>(Still reading through the backlog) Often on uboot/linux, uboot probes memory and updates the device tree. Maybe that's why you are not seeing it in there. <solid_black>axert: are you loading the dtb as an opaque just a blob? <azert>I don’t think uboot does any magic with the device tree <solid_black>from looking at u-boot source, it does, but this depends on the board for some reason, and also on the command <azert>I just load it from disk, modify it transparently in memory <azert>Yes, I confirm , u-boot fixes this <azert>Why opaque blob? I open this in u-boot to add the module infos <Pellescours>sneek: later tell almuhs I was able to compile rumpkernel with netbsd10, only 1 file was missing "opt_ahcisata.h" <Pellescours>When trying to compile rumpdisk with my new rumpkernel libraries (netbsd10), I have these undefined reference "rumpns_bus_dmatag_subregion" called from the function "rumpns_ehci_init" <sneek>Welcome back AlmuHS, you have 1 message! <sneek>AlmuHS, Pellescours says: I was able to compile rumpkernel with netbsd10, only 1 file was missing "opt_ahcisata.h" <AlmuHS>Pellescours: could you explain me, step-by-step, how did you download and compile the rumpdisk sources?