Hi Luca, On 20/6/23 05:40, l...@orpolo.org wrote: > and at this stage the lapic pointer is not yet initialized: > > (gdb) p lapic > $4 = (volatile ApicLocalUnit *) 0x0 > (gdb) x &lapic > 0xc109bc6c <lapic>: 0x00000000 > > I guess so far this worked because the address 0 was mapped, and now it > isn't. > > I'm not sure what would be the proper way to solve this. I tried > anticipating the call to machine_init() to be before vm_mem_bootstrap() > (to have lapic initialized) but this triggers another assert.
Another way to solve this is to use MSRs to set the base address of the local apic, and then always assume it is at this fixed address instead of dereferencing a pointer. (By default it should be located at physical address 0xFEE00000) https://wiki.osdev.org/APIC#Local_APIC_configuration Damien