Skip to content

feat: Bochs VBE linear framebuffer support#2523

Open
GloriousAlpaca wants to merge 3 commits into
hermit-os:mainfrom
GloriousAlpaca:pr-bga-clean
Open

feat: Bochs VBE linear framebuffer support#2523
GloriousAlpaca wants to merge 3 commits into
hermit-os:mainfrom
GloriousAlpaca:pr-bga-clean

Conversation

@GloriousAlpaca

Copy link
Copy Markdown

I'm currently working on porting Doom to Hermit and needed a feature to directly write pixel data into the Bochs Graphics Adaptor as Hermit currently only has support for VGA in textmode.

The feature currently adds standard BGA preparation (Link to OSDev) with a hardcoded resolution (640x400), bpp (32) and a systemcall (sys_get_framebuffer) to receive the address of the framebuffer.
The systemcall falls back to 0 if there was a failure in initializing the framebuffer (e.g. if pci is missing, or the bga feature is not enabled).

I have currently only tested this feature with c programs on a mac using Qemu. The feature is also only available on the x86_64 architecture.

@mkroening mkroening self-assigned this Jul 3, 2026
@mkroening mkroening self-requested a review July 3, 2026 15:40

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 2792b90 Previous: 8b752b3 Performance Ratio
startup_benchmark Build Time 81.84 s 80.58 s 1.02
startup_benchmark File Size 0.80 MB 0.80 MB 1.00
Startup Time - 1 core 0.77 s (±0.03 s) 0.75 s (±0.02 s) 1.02
Startup Time - 2 cores 0.76 s (±0.02 s) 0.75 s (±0.02 s) 1.01
Startup Time - 4 cores 0.77 s (±0.02 s) 0.76 s (±0.03 s) 1.01
multithreaded_benchmark Build Time 84.29 s 83.77 s 1.01
multithreaded_benchmark File Size 0.89 MB 0.90 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 89.96 % (±8.10 %) 88.91 % (±5.63 %) 1.01
Multithreaded Pi Efficiency - 4 Threads 44.70 % (±3.19 %) 43.58 % (±2.56 %) 1.03
Multithreaded Pi Efficiency - 8 Threads 25.99 % (±1.59 %) 25.21 % (±1.38 %) 1.03
micro_benchmarks Build Time 82.15 s 83.23 s 0.99
micro_benchmarks File Size 0.90 MB 0.90 MB 1.00
Scheduling time - 1 thread 67.27 ticks (±2.57 ticks) 66.41 ticks (±2.49 ticks) 1.01
Scheduling time - 2 threads 37.33 ticks (±4.37 ticks) 36.98 ticks (±4.38 ticks) 1.01
Micro - Time for syscall (getpid) 4.45 ticks (±0.64 ticks) 4.38 ticks (±0.61 ticks) 1.02
Memcpy speed - (built_in) block size 4096 82928.47 MByte/s (±57338.23 MByte/s) 80964.12 MByte/s (±56065.00 MByte/s) 1.02
Memcpy speed - (built_in) block size 1048576 30245.58 MByte/s (±24466.65 MByte/s) 30488.32 MByte/s (±24607.18 MByte/s) 0.99
Memcpy speed - (built_in) block size 16777216 26416.82 MByte/s (±21804.46 MByte/s) 26922.99 MByte/s (±22163.33 MByte/s) 0.98
Memset speed - (built_in) block size 4096 83366.97 MByte/s (±57623.13 MByte/s) 81292.09 MByte/s (±56295.77 MByte/s) 1.03
Memset speed - (built_in) block size 1048576 31006.80 MByte/s (±24904.24 MByte/s) 31212.89 MByte/s (±25032.24 MByte/s) 0.99
Memset speed - (built_in) block size 16777216 27160.92 MByte/s (±22269.44 MByte/s) 27704.28 MByte/s (±22658.95 MByte/s) 0.98
Memcpy speed - (rust) block size 4096 74141.85 MByte/s (±51714.37 MByte/s) 73359.02 MByte/s (±51215.91 MByte/s) 1.01
Memcpy speed - (rust) block size 1048576 30182.37 MByte/s (±24459.40 MByte/s) 30393.47 MByte/s (±24606.70 MByte/s) 0.99
Memcpy speed - (rust) block size 16777216 27171.49 MByte/s (±22455.29 MByte/s) 27849.43 MByte/s (±22986.75 MByte/s) 0.98
Memset speed - (rust) block size 4096 74363.14 MByte/s (±51844.32 MByte/s) 73359.02 MByte/s (±51215.91 MByte/s) 1.01
Memset speed - (rust) block size 1048576 30933.08 MByte/s (±24900.34 MByte/s) 31145.98 MByte/s (±25044.39 MByte/s) 0.99
Memset speed - (rust) block size 16777216 27931.67 MByte/s (±22920.89 MByte/s) 28625.01 MByte/s (±23459.41 MByte/s) 0.98
alloc_benchmarks Build Time 75.95 s 77.14 s 0.98
alloc_benchmarks File Size 0.88 MB 0.88 MB 1.00
Allocations - Allocation success 91.31 % 91.31 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.44 % 61.44 % 1
Allocations - Average Allocation time 4788.00 Ticks (±82.26 Ticks) 5021.61 Ticks (±76.52 Ticks) 0.95
Allocations - Average Allocation time (no fail) 5539.85 Ticks (±93.26 Ticks) 5797.34 Ticks (±78.21 Ticks) 0.96
Allocations - Average Deallocation time 1074.62 Ticks (±153.76 Ticks) 1468.37 Ticks (±182.04 Ticks) 0.73
mutex_benchmark Build Time 77.11 s 76.50 s 1.01
mutex_benchmark File Size 0.90 MB 0.90 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.28 ns (±0.45 ns) 12.08 ns (±0.27 ns) 1.02
Mutex Stress Test Average Time per Iteration - 2 Threads 40.98 ns (±2.31 ns) 41.70 ns (±1.99 ns) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants