<AlmuHS>I also need to initialize lapic LVT <AlmuHS>I enumerated the apic_id of each processor, but I need to initialize the another lapic registers <AlmuHS>but I don't know how do It exactly <damo22>it doesnt have all the detail required but there is some setup we need to do so that legacy PIC doesn't conflict <AlmuHS>you can read chapter 10 in Intel Manuals, to get more info about APIC <AlmuHS>btw, other problem with Mach is that, the most modern cpu which have registered in its code is Pentium Pro <AlmuHS>the table which stores the APIC data is MADT <damo22>mach supporting pentium pro is not a bad thing <damo22>it means it will theoretically work on any x86 <AlmuHS>but could be necessary to detect more modern models <damo22>we can forget about the extended apic setups <AlmuHS>my implementation is xAPIC based <AlmuHS>because original APIC don't works in Pentium 4 or later <damo22>i mean, there is a mode of apic that uses logical clusters of NUMA nodes <AlmuHS>but could be interesting detect if the cpu use x2APIC and, in this case, enable xAPIC compatibility mode <AlmuHS>the latest Core iX models use x2APIC <AlmuHS>x2APIC has a legacy xAPIC mode, but It is not enabled by default (and I have not implemented It) <AlmuHS>in my Final Degree Thesis I explain all about this. But this is wrotten in spanish <AlmuHS>if you understand spanish, I can share the link <damo22>why dont we use Fixed mode for all interrupts in the IO APIC <damo22>and route them to actual interrupt vectors <AlmuHS>but I don't understand APIC very well, so I avoided It <AlmuHS>if you want implement this, I can say you where is the structures in my code <damo22>ive been reading some gnumach code <AlmuHS>I recovered It from old Mach 4 headers, and updated It with latest lapic table <damo22>there is an ugly hack in gnumach that enables interrupts when setting the IPL <damo22>to allow linux drivers to call cli/sti <AlmuHS>I have to rename some functions, btw <AlmuHS>the name is not clear about its purpuse <AlmuHS>in the README I explain a bit about the implementation, although is a bit outdated <damo22>doesnt the bootloader start in protected mode? <damo22>you're basically switching back to flat 16 bit mode and starting from scratch <AlmuHS>when the computer starts, it initialize some apic structures. But, after this, the BIOS select a cpu (called BSP), and start It. And the another are set as standby <AlmuHS>to start the another cpus (called AP), It's needed to send an IPI (a special type of IRQ): the startup IPI <youpi>on x86 the boot loader starts in real mode indeed. but grub loads the kernel in protected mode <AlmuHS>but, when the cpu receive the IPI, It wake up in real mode <AlmuHS>but the kernel starts, at first, with only the BSP cpu <AlmuHS>if the kernel wants to use another processors, It has to wake up them using startup IPI <AlmuHS>and these processor (the AP processors) starts in real mode, as I said <damo22>"(22:58:58) AlmuHS: but, when the cpu receive the IPI, It wake up in real mode" This explains all <AlmuHS>the BSP continue in protected mode, there isn't problem with this <AlmuHS>and, during the kernel boot, I need to start the another processor (AP processors) <AlmuHS>when I send startup IPI to APs, the APs wake up in real mode <AlmuHS>the BSP continues in protected mode, no problem with this <AlmuHS>I set It later, with idt_init() call <damo22>.word 3*8+7 allocates space for the IDT? <AlmuHS>nope, It is part of gdt descriptor <AlmuHS>I load an empty IDT in line 78 in cpuboot.S <damo22>how much space do you need for an IDT? <AlmuHS>this is not mine, is from gnumach <damo22>and then allocate it again later <AlmuHS>youpi: can you check my latest Hurd patch? I sent It two days ago <youpi>AlmuHS: I assumed you were working on the last_pocessor field detection <AlmuHS>youpi: I sent the patch after you latest email <youpi>"latest" is not precise enough :) <youpi>Date: Tue, 29 Oct 2019 00:05:09 +0100 <youpi> the code seems correct to me, but lacking autoconf check for the field <AlmuHS>oh, I didn't know about I have to do It <AlmuHS>reply about how a to do It (a lightly idea at least), in which file <AlmuHS>damo22: thanks. I didn't found this table before <youpi>I thought we had discussed about it on irc <youpi>add to configure.ac a call to AC_CHECK_MEMBER to check for the struct member <youpi>that'll define a macro you can use in #ifdef/#else/#endif in the code <AlmuHS>damo22: do you understand my smp work? <AlmuHS>if you speak spanish, you can read my final degree thesis, that I linked It before <damo22>unfortunately my spanish is not that good <AlmuHS>then you can read the implementation chapter in README.md <AlmuHS>is a bit outdated, but includes all the basic <damo22>i know about ACPI a little alreadyt <AlmuHS>in my draft I link to ACPI specification <damo22>i wrote acpi translator for hurd <damo22>you can access the tables raw in /servers/acpi/tables <AlmuHS>yes, but I never wrote a translator, and a friend wrote me the acpi_rsdp.c function (I only fixed and improve It) <damo22>yeah sure, you need it in gnumach anyway <AlmuHS>my laptop battery I'm mostly empty now, I have to shutdown in a moments ***deavmi_ is now known as deavmiHurd
***deavmi_ is now known as deavmiHurdLaptop
***Emulatorman_ is now known as Emulatorman
<youpi>AlmuHS: better use AC_CHECK_MEMBERS, which already does the AC_DEFINE on success <AlmuHS>I never used It, I'm learning now at first time <youpi>I believe you still need the #include ? <youpi>(see in config.log for the details of what is happening) <youpi>AlmuHS: see, it doesn't know the structure, the include is indeed missing in the test file <AlmuHS>It's true. what is the syntax to add include in AC_CHECK_MEMBERS ? <AlmuHS>I don't find any example which add include <youpi>you need to read the info manual of autoconf to know that <youpi>that's the proper documentation <youpi>looking for examples on the web has limits <jrtc27>util-linux_2.34-0.1/configure.ac <jrtc27>AC_CHECK_MEMBERS([struct termios.c_line],,, <youpi>yes, but again, looking at the proper doc is usually better to make sure how things are supposed to be <AlmuHS>yes, but I didn't understand the docs <youpi>examples are good, sure, but proper documentation should *also* be used <youpi>sure, I don't mean the documentation is enough <jrtc27>yeah, you really want both together <jrtc27>anyway, codesearch.debian.net is a lifesaver for finding examples of pretty much anything