RTEMS | Draft: bsps/shared: Add I/O APIC support for x86 platforms (!1155)
Mohammed Anees (@DonutAnees)
gitlab at rtems.org
Mon Mar 30 07:15:19 UTC 2026
Mohammed Anees commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1155#note_147408
i have build the new changes, it compiles without errors, the following things have been tested by me
### sample tests
#### hello.exe
```
maxphysaddr = 48
APIC: override: SourceIrq=0 GlobalIrq=2 IntiFlags=0x0000
APIC: IRQ override src=0 -> global=2 (ioapic=1504960 pin=2)
APIC: override: SourceIrq=5 GlobalIrq=5 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=5, no remap needed
APIC: override: SourceIrq=9 GlobalIrq=9 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=9, no remap needed
APIC: override: SourceIrq=10 GlobalIrq=10 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=10, no remap needed
APIC: override: SourceIrq=11 GlobalIrq=11 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=11, no remap needed
APIC is at 0xfee00000
APIC ID at *0xfee00020=0x0
APIC spurious vector register *0xfee000f0=0x10f
APIC spurious vector register *0xfee000f0=0x1ff
APIC: registering ioapic[0] ptr=0x16f6c0 gsi_base=0 numintr=24
APIC: ioapic[0] registered successfully
APIC: total I/O APICs registered: 1
*** BEGIN OF TEST HELLO WORLD ***
*** TEST VERSION: 7.0.0.a70c6b23d9f8e94440de2df1030571ec182e03b3
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_DEBUG
*** TEST TOOLS: 15.2.0 20250808 (RTEMS 7, Build 2026.03.04, RSB 00a71896204f95cb583e6271cad4c192b62cce6d-modified, Newlib a7c61498)
Hello World
*** END OF TEST HELLO WORLD ***
[ RTEMS shutdown ]
RTEMS version: 7.0.0.a70c6b23d9f8e94440de2df1030571ec182e03b3
RTEMS tools: 15.2.0 20250808 (RTEMS 7, Build 2026.03.04, RSB 00a71896204f95cb583e6271cad4c192b62cce6d-modified, Newlib a7c61498)
executing thread ID: 0x0a010001
executing thread name: UI1
```
#### ticket.exe
```
maxphysaddr = 48
APIC: override: SourceIrq=0 GlobalIrq=2 IntiFlags=0x0000
APIC: IRQ override src=0 -> global=2 (ioapic=1578400 pin=2)
APIC: override: SourceIrq=5 GlobalIrq=5 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=5, no remap needed
APIC: override: SourceIrq=9 GlobalIrq=9 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=9, no remap needed
APIC: override: SourceIrq=10 GlobalIrq=10 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=10, no remap needed
APIC: override: SourceIrq=11 GlobalIrq=11 IntiFlags=0x000d
APIC: override: SourceIrq==GlobalIrq=11, no remap needed
APIC is at 0xfee00000
APIC ID at *0xfee00020=0x0
APIC spurious vector register *0xfee000f0=0x10f
APIC spurious vector register *0xfee000f0=0x1ff
APIC: registering ioapic[0] ptr=0x1815a0 gsi_base=0 numintr=24
APIC: ioapic[0] registered successfully
APIC: total I/O APICs registered: 1
us_per_tick = 10000
Desired frequency = 100irqs/sec
PIT stopped at 0xe90b
APIC ticks passed in 1/20 of a second: 0x2fb257
CPU frequency: 0x1000271040
APIC ticks/sec: 0x62516940
PIT stopped at 0xe90b
APIC ticks passed in 1/20 of a second: 0x2fafa2
CPU frequency: 0x1000049280
APIC ticks/sec: 0x62503080
PIT stopped at 0xe90b
APIC ticks passed in 1/20 of a second: 0x2faf91
CPU frequency: 0x1000043840
APIC ticks/sec: 0x62502740
PIT stopped at 0xe90b
APIC ticks passed in 1/20 of a second: 0x2fafae
CPU frequency: 0x1000053120
APIC ticks/sec: 0x62503320
PIT stopped at 0xe90b
APIC ticks passed in 1/20 of a second: 0x2faf83
CPU frequency: 0x1000039360
APIC ticks/sec: 0x62502460
*** BEGIN OF TEST CLOCK TICK ***
*** TEST VERSION: 7.0.0.a70c6b23d9f8e94440de2df1030571ec182e03b3
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_DEBUG
*** TEST TOOLS: 15.2.0 20250808 (RTEMS 7, Build 2026.03.04, RSB 00a71896204f95cb583e6271cad4c192b62cce6d-modified, Newlib a7c61498)
TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988
TA3 - rtems_clock_get_tod - 09:00:00 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:05 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988
TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:15 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:20 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:20 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:25 12/31/1988
TA3 - rtems_clock_get_tod - 09:00:30 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:30 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:30 12/31/1988
*** END OF TEST CLOCK TICK ***
[ RTEMS shutdown ]
RTEMS version: 7.0.0.a70c6b23d9f8e94440de2df1030571ec182e03b3
RTEMS tools: 15.2.0 20250808 (RTEMS 7, Build 2026.03.04, RSB 00a71896204f95cb583e6271cad4c192b62cce6d-modified, Newlib a7c61498)
executing thread ID: 0x0a010002
executing thread name: TA1
```
### Running for all the tests
#### Test on upstream
```
Passed: 596
Failed: 27
User Input: 5
Expected Fail: 24
Indeterminate: 0
Benchmark: 3
Timeout: 4
Test too long: 0
Invalid: 0
Wrong Version: 0
Wrong Build: 0
Wrong Tools: 0
Wrong Header: 0
------------------
Total: 659
Failures:
fsfatfsformat01.exe
malloc04.exe
psxclock.exe
psxstat.exe
sp20.exe
spfatal26.exe
spintrcritical08.exe
sptimecounter02.exe
stringto01.exe
tftpfs.exe
ts-validation-one-cpu-0.exe
ttest01.exe
ttest02.exe
cdtest.exe
exit03.exe
iostream.exe
rcxx01.exe
regulator01.exe
sp30.exe
sp31.exe
sp45.exe
sp50.exe
sp68.exe
spclock_err02.exe
spcxx01.exe
sptimerserver01.exe
sptls02.exe
User Input:
capture.exe
fileio.exe
monitor.exe
termios.exe
top.exe
Expected Fail:
fatfs_fsrenameexisting.exe
fatfs_fsrenamemaxlinks.exe
imfs_fsrenameexisting.exe
imfs_fsrenamepermexisting.exe
imfs_fssymlink.exe
jffs2_fsrenameexisting.exe
jffs2_fsrenamemaxlinks.exe
jffs2_fsrenamepermexisting.exe
jffs2_fssymlink.exe
jffs2nand_fsrenameexisting.exe
jffs2nand_fsrenamemaxlinks.exe
jffs2nand_fsrenamepermexisting.exe
jffs2nand_fssymlink.exe
mdosfs_fsrenameexisting.exe
mdosfs_fsrenamemaxlinks.exe
mimfs_fsrenameexisting.exe
mimfs_fsrenamemaxlinks.exe
mimfs_fsrenamepermexisting.exe
mimfs_fssymlink.exe
mrfs_fsrenameexisting.exe
mrfs_fsrenamelongname.exe
mrfs_fsrenamemaxlinks.exe
mrfs_fsrenamepermexisting.exe
mrfs_fssymlink.exe
Benchmark:
dhrystone.exe
linpack.exe
whetstone.exe
Timeouts:
ts-performance-no-clock-0.exe
ts-unit-no-clock-0.exe
ts-validation-intr.exe
ts-validation-no-clock-0.exe
```
#### Test on feature branch
```
Passed: 597
Failed: 26
User Input: 5
Expected Fail: 24
Indeterminate: 0
Benchmark: 3
Timeout: 4
Test too long: 0
Invalid: 0
Wrong Version: 0
Wrong Build: 0
Wrong Tools: 0
Wrong Header: 0
------------------
Total: 659
Failures:
fsfatfsformat01.exe
malloc04.exe
psxclock.exe
psxstat.exe
sp20.exe
spfatal26.exe
spintrcritical08.exe
stringto01.exe
tftpfs.exe
ts-validation-one-cpu-0.exe
ttest01.exe
ttest02.exe
cdtest.exe
exit03.exe
iostream.exe
rcxx01.exe
regulator01.exe
sp30.exe
sp31.exe
sp45.exe
sp50.exe
sp68.exe
spclock_err02.exe
spcxx01.exe
sptimerserver01.exe
sptls02.exe
User Input:
capture.exe
fileio.exe
monitor.exe
termios.exe
top.exe
Expected Fail:
fatfs_fsrenameexisting.exe
fatfs_fsrenamemaxlinks.exe
imfs_fsrenameexisting.exe
imfs_fsrenamepermexisting.exe
imfs_fssymlink.exe
jffs2_fsrenameexisting.exe
jffs2_fsrenamemaxlinks.exe
jffs2_fsrenamepermexisting.exe
jffs2_fssymlink.exe
jffs2nand_fsrenameexisting.exe
jffs2nand_fsrenamemaxlinks.exe
jffs2nand_fsrenamepermexisting.exe
jffs2nand_fssymlink.exe
mdosfs_fsrenameexisting.exe
mdosfs_fsrenamemaxlinks.exe
mimfs_fsrenameexisting.exe
mimfs_fsrenamemaxlinks.exe
mimfs_fsrenamepermexisting.exe
mimfs_fssymlink.exe
mrfs_fsrenameexisting.exe
mrfs_fsrenamelongname.exe
mrfs_fsrenamemaxlinks.exe
mrfs_fsrenamepermexisting.exe
mrfs_fssymlink.exe
Benchmark:
dhrystone.exe
linpack.exe
whetstone.exe
Timeouts:
ts-performance-no-clock-0.exe
ts-unit-no-clock-0.exe
ts-validation-intr.exe
ts-validation-no-clock-0.exe
```
### config used
config.ini
```
[x86_64/amd64]
# Selects the compiler used to build the BSP (allowed values are "gcc" and
# "clang"). Please note that the values of some options depend on the compiler
# selection and changing the compiler may lead to unpredictable behaviour if
# these options are not adjusted as well. Use the --rtems-compiler command line
# option to get the default values for a particular compiler via
# ./waf bspdefaults.
COMPILER = gcc
# Defines the program prefix of tools (compiler, assembler, linker)
# used to build RTEMS. This option may be used to build RTEMS with a
# vendor tool suite. Please note, support issues related to using this
# option with vendor tool suites should be directed to the vendor of
# the tools.
PROGRAM_PREFIX = ${ARCH}-rtems${__RTEMS_MAJOR__}-
# Flags passed to the library archiver
ARFLAGS = crD
# Specifies the C Language version and additional APIs available to
# the program. gnuNN allows GCC extensions and POSIX APIs. Switching
# to stdNN requires the addition of -D_POSIX_C_SOURCE=202405L to
# compit le for POSIX Issue 8 that RTEMS is aligned to.
CC_STD_VERSION_FLAGS = -std=gnu23 -D_BSD_SOURCE -DDEBUG
# Warning flags passed to the C and C++ compiler
WARNING_FLAGS = -Wall -Wextra -Wno-format
# Warning flags passed to the C compiler
CC_WARNING_FLAGS = -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -Wold-style-declaration
# Warning flags passed to the C++ compiler
CXX_WARNING_FLAGS =
# Enable the Ada support
__RTEMS_ADA__ = False
# Defines the build label returned by rtems_get_build_label().
RTEMS_BUILD_LABEL = DEFAULT
# Default size in CAN frames of FIFO queues.
RTEMS_CAN_FIFO_SIZE = 64
# Number of available priorities for CAN priority queues.
RTEMS_CAN_QUEUE_PRIO_NR = 3
# Enable the RTEMS internal debug support
RTEMS_DEBUG = True
# Enable the Driver Manager startup
RTEMS_DRVMGR_STARTUP = False
# Enable the Newlib C library support
RTEMS_NEWLIB = True
# Enable the para-virtualization support
RTEMS_PARAVIRT = False
# Enable support for POSIX signals, sporadic server and lio_listio()
RTEMS_POSIX_API = False
# Enable the SMP lock profiling support
RTEMS_PROFILING = False
# Enable the Symmetric Multiprocessing (SMP) support
RTEMS_SMP = False
# Enable the code and branch coverage support.
RTEMS_GCOV_COVERAGE = False
# Compiler flags recommended for components which should generate
# coverage information.
COVERAGE_COMPILER_FLAGS =
# Linker flags recommended for executables which contain modules which
# generate coverage information.
COVERAGE_LINKER_FLAGS =
# Enable support for JFFS2 Erase Block Summary (EBS)
CONFIG_JFFS2_SUMMARY = False
# Build the test programs
BUILD_TESTS = True
RTEMS_TEST_VERBOSITY = Normal
# Default optimization flags for C and C++ compilers.
OPTIMIZATION_FLAGS = -O2 -g
# ABI flags
ABI_FLAGS = -mno-red-zone -mcmodel=large
# Do the clock tick processing on the boot processor on behalf of all
# other processors.
CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR = False
# Section layout flags required for correct linker garbage collection.
# These flags are separated from OPTIMIZATION_FLAGS so that users may
# override optimization settings without removing the required section
# flags. Users may override these flags through the SECTION_FLAGS
# build option if different section handling behaviour is required.
SECTION_FLAGS = -ffunction-sections -fdata-sections
# Optimization flags passed to C and C++ compilers for the BSP.
BSP_OPTIMIZATION_FLAGS = ${SECTION_FLAGS} ${OPTIMIZATION_FLAGS}
# Section layout flags required for correct linker garbage collection.
# These flags are separated from OPTIMIZATION_FLAGS so that users may
# override optimization settings without removing the required section
# flags. Users may override these flags through the SECTION_FLAGS
# build option if different section handling behaviour is required.
# Optimization flags passed to C and C++ compilers for the CPU kit.
CPUKIT_OPTIMIZATION_FLAGS = ${SECTION_FLAGS} ${OPTIMIZATION_FLAGS}
# Section layout flags required for correct linker garbage collection.
# These flags are separated from OPTIMIZATION_FLAGS so that users may
# override optimization settings without removing the required section
# flags. Users may override these flags through the SECTION_FLAGS
# build option if different section handling behaviour is required.
# Optimization flags passed to C and C++ compiler for tests.
TEST_OPTIMIZATION_FLAGS = ${SECTION_FLAGS} ${OPTIMIZATION_FLAGS}
# If defined to a non-zero value, prints the some information in case
# of a fatal error.
BSP_VERBOSE_FATAL_EXTENSION = 1
# Flags passed to the linker.
LINKFLAGS =
# Flags passed to the linker at the end of the link command.
LDFLAGS = -Wl,--gc-sections
# Install the legacy application Makefile framework.
INSTALL_LEGACY_MAKEFILES = True
# If defined to a non-zero value, prints the exception context when an
# unexpected exception occurs.
BSP_PRINT_EXCEPTION_CONTEXT = 1
# If defined to a non-zero value, reset the board when the application
# exits.
BSP_RESET_BOARD_AT_EXIT = 1
# If defined to a non-zero value, print a message and wait until
# pressed before resetting board when application exits.
BSP_PRESS_KEY_FOR_RESET = 0
```
tester.ini
```
[amd64_qemu]
amd64_ovmf_path = /home/anees/edk2/Build/OvmfX64/DEBUG_GCC/FV/OVMF.fd
amd64_freebsd_boot_image_path = /home/anees/quick-start/src/rtems/FreeBSDBoot.img
```
rtems-test
```
rtems-test --rtems-bsp=amd64_qemu --log=no-smp-main.log --user-config=tester.ini build/x86_64/amd64/testsuites/
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1155#note_147408
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260330/53d370d4/attachment-0001.htm>
More information about the bugs
mailing list