Il 21/03/23 15:38, Sergey Bugaev ha scritto:
But how does a core know its CPU number?

Currently through the APIC_ID register, see the CPU_NUMBER macro in i386/i386/cpu_number.h.

This would've been easier if we could pass the port name as an env
variable, then we could pick some predefined name (e.g.
DEVICE_MASTER_PORT) and have glibc pick it up early. But I don't think
there is a way to set env in boot scripts, nor is it worth it, really.

Actually on the stack there are both args and envs, it's just that by default gnumach passes an empty env (unless in compatibility mode, but that doesn't seems used anymore). I guess the reason for the argument instead of env is that it can be enabled/disabled at will, but the port name could potentially be passed in both ways, when required.


Luca

Reply via email to