Travis Geiselbrecht b7d69d8804 [arch][x86] handle the local apic of the boot cpu not being 0
I have a bulldozer machine here that curiously starts the APIC IDs for
the cpus at 16 and counts up.

This is a problem since the current code assumes that the boot cpu is 0,
and would try to start itself (apic id 16) later because it thought it
was the first secondary. Fix this by re-reading the APIC id on the boot
cpu and patching the percpu structure a bit into boot. Kinda a hack but
avoids having to detect the APIC, find the type of ID to read, etc.

Also means that practically speaking the system is using the full 32bit
APIC IDs if that feature is present, since now the local apic id is
entirely read from the local apic as it should be (if present).

Fixes #475
2025-09-22 20:57:30 -07:00
2025-08-31 12:44:36 -07:00
2025-05-04 20:58:02 +03:00
2025-07-28 12:48:11 -07:00
2015-01-29 20:38:19 -08:00

The Little Kernel Embedded Operating System

The LK kernel is an SMP-aware kernel designed for small systems ported to a variety of platforms and cpu architectures.

It is used in a variety of open source and closed source projects, notably the bootloader for a lot of Android phones of various make.

See https://github.com/littlekernel/lk for the latest version.

For comprehensive documentation, see Index.

High Level Features

  • Fully-reentrant multi-threaded preemptive kernel
  • Portable to many 32 and 64 bit architectures
  • Support for wide variety of embedded and larger platforms
  • Powerful modular build system
  • Large number of utility components selectable at build time

Supported architectures

  • ARM32
    • Cortex-M class cores (armv6m - armv8m)
    • ARMv7+ Cortex-A class cores
  • ARM64
    • ARMv8 and ARMv9 cores
  • RISC-V 32 and 64bit bit in machine and supervisor mode
  • x86-32 and x86-64
  • Motorola 68000
  • Microblaze
  • MIPS
  • OpenRISC 1000
  • VAX (experimental)
Description
No description provided
Readme MIT 39 MiB
Languages
C 80.6%
C++ 10.8%
Assembly 3.6%
Makefile 3.4%
Python 1%
Other 0.6%