IRC channel logs
2024-01-31.log
back to list of logs
<azert>Hello damo22, is the stack setup when you run the code you are fixing? <azert>Ok, you could still use the stack registers to store a pointer and do a far ret instead of a jmp <damo22>does a far ret cause protected mode to initiate? <damo22>the point is to ljmp intersegment to cause a switch to protected mode <damo22>or do you mean to flush the queue? <azert>Thing is that you don’t need to setup a stack for that, you just need to use the stack as a pointer <azert>Remember that on x86 the stack grows down <azert>Cannot you set sp to a label? <azert>I really don’t see the difference, can be even there where you already self modify the code <ids1024>Hm, when I try to rpctrace a statically linked hello world program, it just shows `vm_statistics` then fails with a "child killed" message? <damo22>youpi: when i set console=com0 my AMD board reboots <damo22>but otherwise detects IOAPICs and ACPI <damo22>if i insert com_reprobe(0) before cninit() , it faults but i cant get a log <damo22>i think something in last 8 commits broke serial port <damo22>aha, apic mode is broken with com0 <damo22>even though my patch works for 115200 <anatoly>solid_black: I went to sleep so I didn't try it and also haven't managed to do it today <damo22>it appears serial console never worked with apic <damo22>maybe when i refactored the unmask_irqs <youpi>damo22: you need to also set the segment, to be able to switch mode <youpi>you can use C to write to ljmp_offset32 yes <youpi>(btw, there is no stack yet at that point) <anatoly>sneek: how do you do your thing, sude? <damo22>[NOTE ] coreboot-4.16-4-g1a497b41d1-dirty Sat Jan 20 07:44:47 UTC 2024 bootblock starting (log level: 7). <damo22>this is essential on bare metal because it reboots so fast <damo22>IOAPIC 0 configured with GSI 0-23 <damo22>IOAPIC 1 configured with GSI 24-55 <solid_black>apparently the reason OpenRC boot appeared to hang was because I never enabled the Hurd console service <solid_black>I kinda assumed that installing the file would be enough for it to be enabled; though it makes perfect sense that it's not <solid_black>need to investigate how all the other services are getting enabled then <anatoly>solid_black: am I correct in my thinking that you relied on passive translator mechanism to start this service? <anatoly>that's how I interpreted "installing the file" <damo22>now i can put a breakpoint somewhere and see it stop in serial console <damo22>ok, sending the startup IPI to AP crashes the cpu <damo22>[NOTE ] coreboot-4.16-4-g1a497b41d1-dirty Sat Jan 20 07:44:47 UTC 2024 bootblock starting <damo22>and i put a 0: jmp 0b in boot code <damo22>i noticed that pit_msleep(1000) does not sleep for one second, any idea why? <solid_black>idk how familiar you are with the Hurd console, sorry in advance if the following is over-explaining it <solid_black>but, there's the getty, which itself is a service... except managed by sysv init (from busybox), not even by OpenRC <solid_black> /dev/tty1 has, indeed, a static translator record to run /hurd/term (which adds Unix terminal functionality to an underlying device/file) <solid_black>in case of /dev/tty1, the underlying device is /dev/vcs/1/console <solid_black>next, /dev/vcs itself has a static translator record to start /hurd/console, the Hurd console server <solid_black>which can be thoughr of as a super glorified pipe with tons of bells and whistles <solid_black>but it doesn't itself disply anything anywhere, it just lets you write things into it and read them back <solid_black>to get anything displayed, you need a console client, aka /bin/console <solid_black>that one is not a translator, it just an executable that you run <solid_black>and its primary mode of operation is ona physical terminal via VGA + PC keyboard + PS/2 mouse (not that I have any idea how those work) <solid_black>so, this one you better run as a system service on startup <solid_black>the other ones (/dev/tty1, /dev/vcs), they run as autostarted translators indeed <etno>damo22: I just tried the ACPIv2 patch (v3) on my Inspiron, it says "ACPI >= v2.0" <etno>There are 2 "Unhandled APIC entry type 0x4" <etno>There are 2 "IRQ override..." <etno>Last line is "IOAPIC 0 configured with GSI 0-23" and it hangs here. <damo22>* db5dcd75 (HEAD -> fix-ioapic, zam/fix-ioapic) model_dep: Fix serial console with APIC enabled <damo22>* 6db43b33 ACPI: Support XSDT (ACPI >= v2.0) <damo22>* d66e2cfb smp: Remove hardcoded AP_BOOT_ADDR <damo22>* 0f9822d2 (zam/master, origin/master, origin/HEAD) Add vm_pages_phys <etno>I think I just miss the SMP stuff, could this be the source of the hang? <damo22>its safer with the smp patch because it wont try to clobber 0x7000 <youpi>etno: are you building with --enable-cpus ? <youpi>if not, then you don't care about the 0x7000 thing <damo22>--enable-ncpus=8 --enable-apic --disable-linux-groups <youpi>and if yes, I'd advise not building with --enable-ncpus for now since it's still wip :) <etno>I don't build with --enable-cpus <etno>apboot_addr: undeclared identifier <etno>youpi: Building this morning, the doc change from yesterday evening seemed to break <etno>damo22: builds fine with cpus=8. <damo22>etno: for testing my branch you must configure with these options: --enable-ncpus=8 --enable-apic --disable-linux-groups <damo22>you can choose any value fo ncpus > 1 <etno>It results in an almost instant reboot <damo22>i believe it crashes during startup IPI <damo22>but i have serial log to prove it <etno>damo22: Do you think that the hang I have when building in single-CPU requires to enable SMP to be fixed ? <damo22>i think if you configure with --enable-ncpus=1 --disable-apic (the defaults) it should almost boot <damo22>but my machine may not work unless i patch the pirq tables somehow (i have no clue how irqs are routed) <damo22>even my vendor bios is broken for NIC in pic mode <etno>I am having interrupt issues with this machine, so my goal was to give a try to your ACPIv2 work. I would love to have a basic system running, even in SP mode :-) <damo22>try compiling without apic stuff or smp <damo22>maybe your cmos settings for bios have IRQ settings that are configurable <damo22>many old machines have this option <damo22>im reading the osdev pages for programmable interval timer (pit) but it looks like we may be using the pit 2 timer correctly <damo22>its not a qemu bug because it does the same thing on hw <damo22>the timer expires almost immediately <damo22>i made it count ten seconds in a loop of 1 second sleeps <damo22>it just printed 1..10 immediately <damo22>ah the pit cannot sleep for more than 54.925ms <damo22>because the timer count has to fit in 16 bits <youpi>probably a loop can be added around it, so callers don't have to care <damo22>i have a fix for pit, its working mostly, but every so often, it goes into a bad state and either hangs or takes a variable amount of time to count to 10 <damo22>there must be a trippy way to configure repeated use of the pit that im missing <damo22>apparently you cant use one-shot pit mode to calibrate anything because SMM interferes with timing <etno>Yay! I got Debian to boot on my Dell Inspiron 1750! With gnumach's AHCI driver, good-old PIC, a change to vremap() to allow unaligned BARs. Ethernet and console are working. <Pellescours>flavioc: for your cross-hurd, you need to bump zlib to 1.3.1, with your current version (1.3) I get a 404 not found at the download step <gnucode>solid_black: Can we schedule a phone call? I want to brain storm the newest Hurd distro. <gnucode>yes. :) communication is fun, isn't it? <gnucode>I think the best time that works for us is sometime in the morning for me, and sometime is the late afternoon/evening for you. <gnucode>You free tomorrow, Friday, or Saturday? <solid_black>I don't think I have anything scheduled for any evening for the rest of this weak, so pick any day <gnucode>ok. How about Friday? I can't convert the times at the moment, but 9AM on Friday (EST) should work for me. <gnucode>I actually prefer later! Let's go for 11am EST, which should be 19 PM for you. <anatoly>solid_black: thanks for the good explanation. When you called it as "console client" it reminded me of xserver architecture and its client-server separation. Is it something similar? <azert>A cool Linux project that got discontinued <azert>Probably because people don’t use terminal consoles anymore? <azert>Like they use them implemented in qt/gtk under a windowing system <jpoiret>azert: discontinued but still used by eg. the Guix installer :) <youpi>anatoly: it's quite different <youpi>in that in the X case, the server is what contains drivers and multiplexing, and clients are applications which connect to display something <youpi>and in the hurd console case, the server is what contains the multiplexing and connects to ttys <youpi>applications display something through the tty <youpi>and the client contains the drivers to actually display it <anatoly>youpi: I might have rememebered a wrong understanding of client-server roles in X in sense that it's opposite to the classic understanf of client-server separation :-) <youpi>it completely depends on what you are talking about exactly <youpi>xdmcp for instance is inverted <youpi>but that depends on your point of view <anatoly>youpi: seems I remembered something without properly understanding its context :-) <anatoly>youpi: in the case of hurd cosole, why is client called client? <anatoly>beside the fact it connects to a "server" <youpi>server is just a server because it's there before the client, waiting for a client to connect <anatoly>but actually it's an abstraction on top of implementations but with reversed "dependency" <youpi>depends what you call a dependency <anatoly>kind of discovery process in runtime <anatoly>it's not the hurd console goes over various implementation and selects apropriate one to the environment but 3rd party needs to provide it and register with the hurd console if they wish <youpi>it doesn't really register, it just picks up the text to be rendered <youpi>you can have several console clients running at the same time <youpi>even showing different consoles <anatoly>and they will basically mirror output? <anatoly>so it's a fanout messaging kind of thing <youpi>the setup is essentially just like screen & tmux <apteryx>what is the binary file format on the Hurd? ELF? Mach-o? Something else? <solid_black>anatoly: I see youpi has already explanied you how the console architecture differs from X <solid_black>apteryx: it is ELF, but actually the Hurd cares very little about that <solid_black>the only part that cares really is the exec server (and the core dumping part of the crash server, the implementation of which is too located inside the exec server source directory) <solid_black>and the exec server used to use BFD, which meant it could load a binary in any supported binary format, be it ELF, Mach-O, PE, or whatever else BFD supports <solid_black>what doesn't work though, it realistically, you need glibc to run anything on the Hurd <solid_black>it apparently used to support a.out, but no longer does <solid_black>besides, there's little reason not to use ELF when you can <solid_black>though Mach-O does have some nice features that ELF lacks <solid_black>the minimum symbol version is now GLIBC_2.39, let me rebuild the world <damo22>pit one-shot is unreliable, acpi timer doesnt work until acpi server is inited, tsc is difficult to calibrate, so im working on HPET <solid_black>my sed s/38/39/g has of course also replaced i386 with i396 🤦️ <anatoly>solid_black: it could've helped damo with real mode stuff :-) <anatoly>solid_black: I'll do tomorrow, bed time now <damo22>this cant be right can it? HPET at physical address 0xfed0000000004000 <etno>0xfec0xxxx is the default LAPIC address in 32b, so this could be the hpet in 64 ? <damo22>how do acpi tables get stored if they are not all the same width for pointers? <damo22>but that only explains the top level <etno>I am no expert at all, but I think there are 64 bit register locations specific to 64 bits machines <damo22>what i am saying is that the tables are only one way in memory so how do they cope wth machine running in IA32 mode or 64 bit mode? <etno>Like entry type 0x5 in MADT <damo22>when there is a pointer being stored in an ACPI table, it must consume 64 bits always <damo22>it doesnt seem to be working the way i expected <damo22>i thought i could read 64 bits and then cast it to 32 and that would be enough because it would truncate the top 32 bits <damo22>i think all pointers that are below 4GB just store 0x00000000abcd1234 in LE within the field? <damo22>so you parse it as a 64 bit address and combine it with ( & 0xffffffff) <damo22>then you have a 32 bit address that works in 32 bit mode <solid_black>so what would be the most promising dhcp client implementation to ship? <youpi>dhcpcd is the one that debian intends to keep <youpi>see with gnu_srs, he has started working on the port <solid_black>last I looked at busybox's udhcpc, it seemed hopeless, but I should take another look <apteryx>has someone tried the mold linker to link Hurd binaries? <solid_black>we should of course s/Alpine/somename/g and change the motd altogether