Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Refactor: Improve UEFI GOP Mode Selection Logic and Configuration

Abierto
#534 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
rust

Línea de trabajo

Comienza en uefi/src/main.rs, en init_logger, y sigue el filtrado actual de modos GOP y las entradas de configuración. Aclara el preset, la relación de aspecto, el mínimo, el máximo y el comportamiento de EDID deseados antes de cambiar la estrategia de selección; el trabajo estará terminado cuando incluya el comportamiento best-fit acordado y la cobertura de los casos de fallback especificados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Current Behavior

In the current implementation within uefi/src/main.rs -> init_logger, the GOP (Graphics Output Protocol) mode selection relies on a simple filter-and-last strategy:

modes.filter(|m| resolution_meets_minimum).last()

This approach leads to inconsistent experiences across different environments:

  1. Default/Fallback Issue: When no minimum requirements are set, QEMU defaults to a reasonable 1280x800, but my real hardware often falls back to a legacy 800x600 (SVGA), which is insufficient for modern logging.
  2. "Last Fit" Bias: When minimum requirements are specified (e.g., 1080p), the code picks the last mode in the list. On high-end displays, this often results in the maximum supported resolution (e.g., 2560x1600 or 3840x2160), which might not be the intended "best" resolution for a bootloader or kernel log.
Proposed Improvement 

I suggest introducing a more robust selection mechanism that supports Preferred Resolutions and Aspect Ratio Filtering. 

  1. Predefined Presets: Instead of raw pixel values, allow users to specify common targets like 720p, 1080p, or 2K.
  2. Aspect Ratio Awareness: Support filtering by ratios such as 16:9, 16:10, or 4:3.
  3. Optimal Selection Strategy:Find the Closest Match to a target resolution.If no exact match exists, fallback to the highest resolution within a specific aspect ratio.Implement a "Best Fit" instead of "Last Fit" (e.g., preference for (1920\times 1080) over (2560\times 1600) if the user targets FHD).
  4. Add Maximum Constraint: With only minimum constraints, sometimes it will lead to maximum values. Add maximum constraint to avoid that.
  5. EDID: I'm not familiar with UEFI EDID. I know this just form some simple lookup. this might be helpful.
Summary

I think adding maximum constraints and using min_by_key abs_diff or thing else to replace last strategy are easy to implement and solve this problem.

Suggested Labels: enhancement, area/uefi

Lenguaje dominante
Rust
Estrellas
1.7k
Forks
240
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rust-osdev/bootloader

Todos los issues de rust-osdev/bootloader

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.