Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package limine for openSUSE:Factory checked in at 2026-03-12 22:21:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/limine (Old) and /work/SRC/openSUSE:Factory/.limine.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "limine" Thu Mar 12 22:21:38 2026 rev:36 rq:1338403 version:10.8.5 Changes: -------- --- /work/SRC/openSUSE:Factory/limine/limine.changes 2026-03-04 21:09:43.607628566 +0100 +++ /work/SRC/openSUSE:Factory/.limine.new.8177/limine.changes 2026-03-12 22:26:08.315778858 +0100 @@ -1,0 +2,16 @@ +Thu Mar 12 00:24:42 UTC 2026 - Marvin Friedrich <[email protected]> + +- Update to 10.8.5: + * Update the Flanterm library to 3.0.2 to fix a regression introduced + in Flanterm 3.0.1 that would also cause misrenderings of the boot + menu's text colour for selected entries. + +------------------------------------------------------------------- +Wed Mar 11 19:35:02 UTC 2026 - Marvin Friedrich <[email protected]> + +- Update to 10.8.4: + * Update the Flanterm library to 3.0.1 to fix a regression that would + cause misrenderings of the boot menu's text colour for selected + entries. + +------------------------------------------------------------------- Old: ---- limine-10.8.2.tar.gz New: ---- limine-10.8.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ limine.spec ++++++ --- /var/tmp/diff_new_pack.uVMq2Z/_old 2026-03-12 22:26:08.843800993 +0100 +++ /var/tmp/diff_new_pack.uVMq2Z/_new 2026-03-12 22:26:08.843800993 +0100 @@ -1,8 +1,8 @@ # # spec file for package limine # -# Copyright (c) 2025 SUSE LLC -# Copyright (c) 2025 Marvin Friedrich +# Copyright (c) 2026 SUSE LLC +# Copyright (c) 2026 Marvin Friedrich # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,7 +15,7 @@ # Name: limine -Version: 10.8.2 +Version: 10.8.5 Release: 0 Summary: Modern, advanced, portable, multiprotocol bootloader and boot manager License: BSD-2-Clause ++++++ limine-10.8.2.tar.gz -> limine-10.8.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/ChangeLog new/limine-10.8.5/ChangeLog --- old/limine-10.8.2/ChangeLog 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/ChangeLog 2026-03-12 00:35:18.000000000 +0100 @@ -1,3 +1,47 @@ +2026-03-12 Mintsuki <[email protected]> + + *** Release 10.8.5 *** + + Noteworthy changes compared to the previous release, 10.8.4: + + Bug fixes: + - Update the Flanterm library to 3.0.2 to fix a regression introduced + in Flanterm 3.0.1 that would also cause misrenderings of the boot + menu's text colour for selected entries. + +2026-03-11 Mintsuki <[email protected]> + + *** Release 10.8.4 *** + + Noteworthy changes compared to the previous release, 10.8.3: + + Bug fixes: + - Update the Flanterm library to 3.0.1 to fix a regression that would + cause misrenderings of the boot menu's text colour for selected + entries. + +2026-03-07 Mintsuki <[email protected]> + + *** Release 10.8.3 *** + + Noteworthy changes compared to the previous release, 10.8.2: + + Bug fixes: + - Preserve LAPIC register state across x2APIC-to-xAPIC transition. + - SMP: Widen bsp_lapic_id to uint32_t to avoid x2APIC ID truncation. + - Linux boot protocol: Validate RISC-V kernel header before trusting + image_size for allocation. + - Host tool: Replace GCC/Clang __builtin overflow checks with portable + C99 helpers. + - Host tool: Fix ENDSWAP width mismatch in GPT-to-MBR partition entry + conversion on big-endian hosts. + - BIOS HDD Stage 1: Fix 64-bit LBA calculation and carry propagation in + disk read loop. + - BIOS HDD Stage 1: Fix stack imbalance on int 13h/AH=48h failure. + - Add NULL terminator check in config_get_entry header line scan. + - Guard editor window_size decrement to prevent underflow on long line + wrapping. + 2026-02-26 Mintsuki <[email protected]> *** Release 10.8.2 *** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/bootstrap new/limine-10.8.5/bootstrap --- old/limine-10.8.2/bootstrap 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/bootstrap 2026-03-12 00:35:18.000000000 +0100 @@ -85,7 +85,7 @@ clone_repo_commit \ https://codeberg.org/Limine/limine-protocol.git \ limine-protocol \ - fd3197997ec608484a2eb4e3d2a8591378087e7d + e42d010a761e4e9ac6bad1b578110ba72c61e1d9 clone_repo_commit \ https://codeberg.org/PicoEFI/PicoEFI.git \ @@ -104,7 +104,7 @@ clone_repo_commit \ https://codeberg.org/Mintsuki/Flanterm.git \ flanterm \ - 281b72a74d0c09f4a5ba40f65b41e642acadca17 + 5d93c648bee81ce7d19f7a6671ec2bc3aaa834f2 download_by_hash \ https://github.com/nothings/stb/raw/5c205738c191bcb0abc65c4febfa9bd25ff35234/stb_image.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/lib/config.c new/limine-10.8.5/common/lib/config.c --- old/limine-10.8.2/common/lib/config.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/lib/config.c 2026-03-12 00:35:18.000000000 +0100 @@ -642,7 +642,7 @@ do { p++; - } while (*p != '\n'); + } while (*p != '\n' && *p != '\0'); ret = p; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/lib/getchar.c new/limine-10.8.5/common/lib/getchar.c --- old/limine-10.8.2/common/lib/getchar.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/lib/getchar.c 2026-03-12 00:35:18.000000000 +0100 @@ -294,6 +294,7 @@ gBS->WaitForEvent(2, events, &which); if (which == 1) { + gBS->CloseEvent(events[1]); return 0; } @@ -313,6 +314,7 @@ } if (serial == true && kd.Key.ScanCode == 0x08) { + gBS->CloseEvent(events[1]); return '\b'; } @@ -357,6 +359,7 @@ goto again; } + gBS->CloseEvent(events[1]); return ret; } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/lib/gterm.c new/limine-10.8.5/common/lib/gterm.c --- old/limine-10.8.2/common/lib/gterm.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/lib/gterm.c 2026-03-12 00:35:18.000000000 +0100 @@ -703,7 +703,10 @@ char *menu_font_size = config_get_value(config, 0, "TERM_FONT_SIZE"); if (menu_font_size != NULL) { - parse_resolution(&tmp_font_width, &tmp_font_height, NULL, menu_font_size); + if (!parse_resolution(&tmp_font_width, &tmp_font_height, NULL, menu_font_size)) { + print("Could not parse TERM_FONT_SIZE. Using default font.\n"); + goto no_load_font; + } if (tmp_font_width != 8) { print("Font width must be 8, got %u. Using default font.\n", tmp_font_width); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/menu.c new/limine-10.8.5/common/menu.c --- old/limine-10.8.2/common/menu.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/menu.c 2026-03-12 00:35:18.000000000 +0100 @@ -345,7 +345,9 @@ print(serial ? "<" : "←"); } } - window_size--; + if (window_size > 0) { + window_size--; + } } if (i == cursor_offset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/protos/linux_risc.c new/limine-10.8.5/common/protos/linux_risc.c --- old/limine-10.8.2/common/protos/linux_risc.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/protos/linux_risc.c 2026-03-12 00:35:18.000000000 +0100 @@ -95,9 +95,7 @@ #define LINUX_HEADER_MAGIC2 0x818223cd #endif -static const char *verify_kernel(struct boot_param *p) { - struct linux_header *header = p->kernel_base; - +static const char *verify_kernel(struct linux_header *header) { if (header->magic2 != LINUX_HEADER_MAGIC2) { return "kernel header magic does not match"; } @@ -436,15 +434,24 @@ } p.kernel_size = kernel_file->size; + + if (p.kernel_size < sizeof(struct linux_header)) { + panic(true, "linux: kernel too small to contain a valid header"); + } + + struct linux_header tmp_hdr; + fread(kernel_file, &tmp_hdr, 0, sizeof(tmp_hdr)); + + const char *reason = verify_kernel(&tmp_hdr); + if (reason) + panic(true, "linux: invalid kernel image: %s", reason); + + // Use image_size from kernel header for total memory including BSS size_t kernel_alloc_size = p.kernel_size; - // Read image_size from kernel header for total memory including BSS - if (p.kernel_size >= sizeof(struct linux_header)) { - struct linux_header tmp_hdr; - fread(kernel_file, &tmp_hdr, 0, sizeof(tmp_hdr)); - if (tmp_hdr.image_size > kernel_alloc_size) { - kernel_alloc_size = tmp_hdr.image_size; - } + if (tmp_hdr.image_size > kernel_alloc_size) { + kernel_alloc_size = tmp_hdr.image_size; } + p.kernel_base = ext_mem_alloc_type_aligned( ALIGN_UP(kernel_alloc_size, 4096), MEMMAP_KERNEL_AND_MODULES, 2 * 1024 * 1024); @@ -452,10 +459,6 @@ fclose(kernel_file); printv("linux: loaded kernel `%s` at %p, size %U\n", kernel_path, p.kernel_base, (uint64_t)p.kernel_size); - const char *reason = verify_kernel(&p); - if (reason) - panic(true, "linux: invalid kernel image: %s", reason); - load_module(&p, config); prepare_device_tree_blob(&p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/protos/multiboot1.c new/limine-10.8.5/common/protos/multiboot1.c --- old/limine-10.8.2/common/protos/multiboot1.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/protos/multiboot1.c 2026-03-12 00:35:18.000000000 +0100 @@ -120,6 +120,8 @@ size_t load_size; if (header.load_end_addr) { + if (header.load_end_addr < header.load_addr) + panic(true, "multiboot1: Load end address less than load address"); load_size = header.load_end_addr - header.load_addr; } else { if (load_src > kernel_file_size) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/sys/lapic.c new/limine-10.8.5/common/sys/lapic.c --- old/limine-10.8.2/common/sys/lapic.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/sys/lapic.c 2026-03-12 00:35:18.000000000 +0100 @@ -358,6 +358,18 @@ } } + // Save LAPIC state; clearing EN resets all registers except APIC ID. + uint32_t max_lvt = (x2apic_read(LAPIC_REG_VERSION) >> 16) & 0xff; + uint32_t saved_svr = x2apic_read(LAPIC_REG_SVR); + uint32_t saved_tpr = x2apic_read(LAPIC_REG_TPR); + uint32_t saved_timer = x2apic_read(LAPIC_REG_LVT_TIMER); + uint32_t saved_lint0 = x2apic_read(LAPIC_REG_LVT_LINT0); + uint32_t saved_lint1 = x2apic_read(LAPIC_REG_LVT_LINT1); + uint32_t saved_error = x2apic_read(LAPIC_REG_LVT_ERROR); + uint32_t saved_pmc = max_lvt >= 4 ? x2apic_read(LAPIC_REG_LVT_PMC) : 0; + uint32_t saved_thermal = max_lvt >= 5 ? x2apic_read(LAPIC_REG_LVT_THERMAL) : 0; + uint32_t saved_cmci = max_lvt >= 6 ? x2apic_read(LAPIC_REG_LVT_CMCI) : 0; + // Transition x2APIC -> disabled -> xAPIC. // Direct x2APIC -> xAPIC is an invalid transition (#GP). msr &= ~((1ULL << 11) | (1ULL << 10)); @@ -367,6 +379,18 @@ wrmsr(0x1b, msr); x2apic_mode = false; + + // Restore LAPIC state. SVR is restored last to re-enable the APIC. + lapic_write(LAPIC_REG_TPR, saved_tpr); + lapic_write(LAPIC_REG_LVT_TIMER, saved_timer); + lapic_write(LAPIC_REG_LVT_LINT0, saved_lint0); + lapic_write(LAPIC_REG_LVT_LINT1, saved_lint1); + lapic_write(LAPIC_REG_LVT_ERROR, saved_error); + if (max_lvt >= 4) lapic_write(LAPIC_REG_LVT_PMC, saved_pmc); + if (max_lvt >= 5) lapic_write(LAPIC_REG_LVT_THERMAL, saved_thermal); + if (max_lvt >= 6) lapic_write(LAPIC_REG_LVT_CMCI, saved_cmci); + lapic_write(LAPIC_REG_SVR, saved_svr); + return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/common/sys/smp.c new/limine-10.8.5/common/sys/smp.c --- old/limine-10.8.2/common/sys/smp.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/common/sys/smp.c 2026-03-12 00:35:18.000000000 +0100 @@ -138,8 +138,7 @@ struct gdtr gdtr = gdt; - uint8_t bsp_lapic_id; - uint32_t bsp_x2apic_id; + uint32_t bsp_lapic_id; // If x2APIC already enabled by firmware, try to revert to xAPIC if (rdmsr(0x1b) & (1 << 10)) { @@ -154,14 +153,12 @@ x2apic = x2apic && x2apic_enable(); if (x2apic) { - bsp_x2apic_id = x2apic_read(LAPIC_REG_ID); - bsp_lapic_id = bsp_x2apic_id; + bsp_lapic_id = x2apic_read(LAPIC_REG_ID); } else { bsp_lapic_id = lapic_read(LAPIC_REG_ID) >> 24; - bsp_x2apic_id = bsp_lapic_id; } - *_bsp_lapic_id = bsp_x2apic_id; + *_bsp_lapic_id = bsp_lapic_id; *cpu_count = 0; @@ -288,7 +285,7 @@ info_struct->lapic_id = x2lapic->x2apic_id; // Do not try to restart the BSP - if (x2lapic->x2apic_id == bsp_x2apic_id) { + if (x2lapic->x2apic_id == bsp_lapic_id) { (*cpu_count)++; continue; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/configure new/limine-10.8.5/configure --- old/limine-10.8.2/configure 2026-02-26 01:26:07.000000000 +0100 +++ new/limine-10.8.5/configure 2026-03-12 00:35:22.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for Limine 10.8.2. +# Generated by GNU Autoconf 2.72 for Limine 10.8.5. # # Report bugs to <https://codeberg.org/Limine/Limine/issues>. # @@ -604,8 +604,8 @@ # Identity of this package. PACKAGE_NAME='Limine' PACKAGE_TARNAME='limine' -PACKAGE_VERSION='10.8.2' -PACKAGE_STRING='Limine 10.8.2' +PACKAGE_VERSION='10.8.5' +PACKAGE_STRING='Limine 10.8.5' PACKAGE_BUGREPORT='https://codeberg.org/Limine/Limine/issues' PACKAGE_URL='https://limine-bootloader.org/' @@ -1324,7 +1324,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures Limine 10.8.2 to adapt to many kinds of systems. +'configure' configures Limine 10.8.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1390,7 +1390,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Limine 10.8.2:";; + short | recursive ) echo "Configuration of Limine 10.8.5:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Limine configure 10.8.2 +Limine configure 10.8.5 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -1621,7 +1621,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Limine $as_me 10.8.2, which was +It was created by Limine $as_me 10.8.5, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -6334,7 +6334,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Limine $as_me 10.8.2, which was +This file was extended by Limine $as_me 10.8.5, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6390,7 +6390,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -Limine config.status 10.8.2 +Limine config.status 10.8.5 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/flanterm/README.md new/limine-10.8.5/flanterm/README.md --- old/limine-10.8.2/flanterm/README.md 2026-02-26 01:26:04.000000000 +0100 +++ new/limine-10.8.5/flanterm/README.md 2026-03-12 00:35:19.000000000 +0100 @@ -24,6 +24,7 @@ NULL, NULL, NULL, 0, 0, 1, 0, 0, + 0, 0 ); ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/flanterm/src/flanterm.c new/limine-10.8.5/flanterm/src/flanterm.c --- old/limine-10.8.2/flanterm/src/flanterm.c 2026-02-26 01:26:04.000000000 +0100 +++ new/limine-10.8.5/flanterm/src/flanterm.c 2026-03-12 00:35:19.000000000 +0100 @@ -592,6 +592,54 @@ return true; } +static bool execute_c0(struct flanterm_context *ctx, uint8_t c) { + size_t x, y; + switch (c) { + case '\a': + if (ctx->callback != NULL) { + ctx->callback(ctx, FLANTERM_CB_BELL, 0, 0, 0); + } + return true; + case '\b': + ctx->get_cursor_pos(ctx, &x, &y); + if (x > 0) { + ctx->set_cursor_pos(ctx, x - 1, y); + } + return true; + case '\t': + ctx->get_cursor_pos(ctx, &x, &y); + x = (x / ctx->tab_size + 1) * ctx->tab_size; + if (x >= ctx->cols) { + x = ctx->cols - 1; + } + ctx->set_cursor_pos(ctx, x, y); + return true; + case 0x0b: + case 0x0c: + case '\n': + ctx->get_cursor_pos(ctx, &x, &y); + if (y == ctx->scroll_bottom_margin - 1) { + ctx->scroll(ctx); + ctx->set_cursor_pos(ctx, x, y); + } else { + ctx->set_cursor_pos(ctx, x, y + 1); + } + return true; + case '\r': + ctx->get_cursor_pos(ctx, &x, &y); + ctx->set_cursor_pos(ctx, 0, y); + return true; + case 14: + ctx->current_charset = 1; + return true; + case 15: + ctx->current_charset = 0; + return true; + default: + return false; + } +} + static void control_sequence_parse(struct flanterm_context *ctx, uint8_t c) { if (ctx->escape_offset == 2) { switch (c) { @@ -604,54 +652,8 @@ } } - // C0 control characters are executed immediately within CSI sequences - // (except ESC which is handled later, and CAN/SUB which are handled by the caller) if (c < 0x20 && c != 0x1b) { - size_t x, y; - switch (c) { - case '\a': - if (ctx->callback != NULL) { - ctx->callback(ctx, FLANTERM_CB_BELL, 0, 0, 0); - } - break; - case '\b': - ctx->get_cursor_pos(ctx, &x, &y); - if (x > 0) { - ctx->set_cursor_pos(ctx, x - 1, y); - } - break; - case '\t': - ctx->get_cursor_pos(ctx, &x, &y); - x = (x / ctx->tab_size + 1) * ctx->tab_size; - if (x >= ctx->cols) { - x = ctx->cols - 1; - } - ctx->set_cursor_pos(ctx, x, y); - break; - case 0x0b: - case 0x0c: - case '\n': - ctx->get_cursor_pos(ctx, &x, &y); - if (y == ctx->scroll_bottom_margin - 1) { - ctx->scroll(ctx); - ctx->set_cursor_pos(ctx, x, y); - } else { - ctx->set_cursor_pos(ctx, x, y + 1); - } - break; - case '\r': - ctx->get_cursor_pos(ctx, &x, &y); - ctx->set_cursor_pos(ctx, 0, y); - break; - case 14: - ctx->current_charset = 1; - break; - case 15: - ctx->current_charset = 0; - break; - default: - break; - } + execute_c0(ctx, c); return; } @@ -2020,9 +2022,6 @@ ctx->last_was_graphic = false; } - size_t x, y; - ctx->get_cursor_pos(ctx, &x, &y); - switch (c) { case 0x00: case 0x7f: @@ -2031,49 +2030,15 @@ ctx->escape_offset = 0; ctx->escape = true; return; - case '\t': { - size_t next_tab = (x / ctx->tab_size + 1) * ctx->tab_size; - if (next_tab >= ctx->cols) { - ctx->set_cursor_pos(ctx, ctx->cols - 1, y); - return; - } - ctx->set_cursor_pos(ctx, next_tab, y); - return; - } - case 0x0b: - case 0x0c: - case '\n': - if (y == ctx->scroll_bottom_margin - 1) { - ctx->scroll(ctx); - ctx->set_cursor_pos(ctx, x, y); - } else { - ctx->set_cursor_pos(ctx, x, y + 1); - } - return; - case '\b': - if (x > 0) { - ctx->set_cursor_pos(ctx, x - 1, y); - } - return; - case '\r': - ctx->set_cursor_pos(ctx, 0, y); - return; - case '\a': - // The bell is handled by the kernel - if (ctx->callback != NULL) { - ctx->callback(ctx, FLANTERM_CB_BELL, 0, 0, 0); - } - return; - case 14: - // Move to G1 set - ctx->current_charset = 1; - return; - case 15: - // Move to G0 set - ctx->current_charset = 0; - return; } + if (c < 0x20 && execute_c0(ctx, c)) { + return; + } + + size_t x, y; + ctx->get_cursor_pos(ctx, &x, &y); + if (ctx->insert_mode == true) { for (size_t i = ctx->cols - 1; i > x; i--) { ctx->move_character(ctx, i, y, i - 1, y); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/flanterm/src/flanterm_backends/fb.c new/limine-10.8.5/flanterm/src/flanterm_backends/fb.c --- old/limine-10.8.2/flanterm/src/flanterm_backends/fb.c 2026-02-26 01:26:04.000000000 +0100 +++ new/limine-10.8.5/flanterm/src/flanterm_backends/fb.c 2026-03-12 00:35:19.000000000 +0100 @@ -448,13 +448,13 @@ uint32_t b = colour & 0xff; uint32_t ret = (r << ctx->red_mask_shift) | (g << ctx->green_mask_shift) | (b << ctx->blue_mask_shift); if (ctx->red_mask_size > 8) { - ret |= (r >> (16 - ctx->red_mask_size)) << (ctx->red_mask_shift + 8); + ret |= (r >> (16 - ctx->red_mask_size)) << (ctx->red_mask_shift - ctx->red_mask_size + 8); } if (ctx->green_mask_size > 8) { - ret |= (g >> (16 - ctx->green_mask_size)) << (ctx->green_mask_shift + 8); + ret |= (g >> (16 - ctx->green_mask_size)) << (ctx->green_mask_shift - ctx->green_mask_size + 8); } if (ctx->blue_mask_size > 8) { - ret |= (b >> (16 - ctx->blue_mask_size)) << (ctx->blue_mask_shift + 8); + ret |= (b >> (16 - ctx->blue_mask_size)) << (ctx->blue_mask_shift - ctx->blue_mask_size + 8); } return ret; } @@ -480,12 +480,6 @@ uint32_t tmp = ctx->text_bg; ctx->text_bg = ctx->text_fg; ctx->text_fg = tmp; - if (ctx->text_fg == 0xffffffff) { - ctx->text_fg = ctx->default_bg; - } - if (ctx->text_bg == ctx->default_bg) { - ctx->text_bg = 0xffffffff; - } } static void plot_char_scaled_canvas(struct flanterm_context *_ctx, struct flanterm_fb_char *c, size_t x, size_t y) { @@ -557,7 +551,7 @@ uint32_t default_bg = ctx->default_bg; uint32_t bg = c->bg == 0xffffffff ? default_bg : c->bg; - uint32_t fg = c->fg == 0xffffffff ? ctx->default_fg : c->fg; + uint32_t fg = c->fg == 0xffffffff ? default_bg : c->fg; x = ctx->offset_x + x * ctx->glyph_width; y = ctx->offset_y + y * ctx->glyph_height; @@ -671,7 +665,7 @@ uint32_t default_bg = ctx->default_bg; uint32_t bg = c->bg == 0xffffffff ? default_bg : c->bg; - uint32_t fg = c->fg == 0xffffffff ? ctx->default_fg : c->fg; + uint32_t fg = c->fg == 0xffffffff ? default_bg : c->fg; x = ctx->offset_x + x * ctx->glyph_width; y = ctx->offset_y + y * ctx->glyph_height; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/host/limine.c new/limine-10.8.5/host/limine.c --- old/limine-10.8.2/host/limine.c 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/host/limine.c 2026-03-12 00:35:18.000000000 +0100 @@ -46,6 +46,16 @@ argv[*argc] = NULL; } +static inline bool mul_u64_overflow(uint64_t a, uint64_t b, uint64_t *res) { + *res = a * b; + return a != 0 && b > UINT64_MAX / a; +} + +static inline bool add_u64_overflow(uint64_t a, uint64_t b, uint64_t *res) { + *res = a + b; + return a > UINT64_MAX - b; +} + #ifndef LIMINE_NO_BIOS static bool quiet = false; @@ -807,14 +817,14 @@ size_t part_to_conv_i = 0; uint64_t part_entry_base; - if (__builtin_mul_overflow(ENDSWAP(gpt_header.partition_entry_lba), lb_size, &part_entry_base)) { + if (mul_u64_overflow(ENDSWAP(gpt_header.partition_entry_lba), lb_size, &part_entry_base)) { goto no_mbr_conv; } for (int64_t i = 0; i < (int64_t)ENDSWAP(gpt_header.number_of_partition_entries); i++) { struct gpt_entry gpt_entry; uint64_t entry_offset = (uint64_t)i * ENDSWAP(gpt_header.size_of_partition_entry); - if (__builtin_add_overflow(part_entry_base, entry_offset, &entry_offset)) { + if (add_u64_overflow(part_entry_base, entry_offset, &entry_offset)) { goto no_mbr_conv; } device_read(&gpt_entry, entry_offset, sizeof(struct gpt_entry)); @@ -905,9 +915,9 @@ // Write out the partition entries. for (size_t i = 0; i < part_to_conv_i; i++) { device_write(&part_to_conv[i].type, 0x1be + i * 16 + 0x04, 1); - uint32_t lba_start = ENDSWAP(part_to_conv[i].lba_start); + uint32_t lba_start = ENDSWAP((uint32_t)part_to_conv[i].lba_start); device_write(&lba_start, 0x1be + i * 16 + 0x08, 4); - uint32_t sect_count = ENDSWAP((part_to_conv[i].lba_end - part_to_conv[i].lba_start) + 1); + uint32_t sect_count = ENDSWAP((uint32_t)((part_to_conv[i].lba_end - part_to_conv[i].lba_start) + 1)); device_write(§_count, 0x1be + i * 16 + 0x0c, 4); device_write(part_to_conv[i].chs_start, 0x1be + i * 16 + 1, 3); @@ -1044,7 +1054,7 @@ uint32_t partition_num; uint64_t gpt_part_entry_base; - if (__builtin_mul_overflow(ENDSWAP(gpt_header.partition_entry_lba), lb_size, &gpt_part_entry_base)) { + if (mul_u64_overflow(ENDSWAP(gpt_header.partition_entry_lba), lb_size, &gpt_part_entry_base)) { fprintf(stderr, "error: GPT partition entry LBA overflows.\n"); goto cleanup; } @@ -1061,7 +1071,7 @@ } uint64_t entry_off = (uint64_t)partition_num * ENDSWAP(gpt_header.size_of_partition_entry); - if (__builtin_add_overflow(gpt_part_entry_base, entry_off, &entry_off)) { + if (add_u64_overflow(gpt_part_entry_base, entry_off, &entry_off)) { fprintf(stderr, "error: GPT partition entry offset overflows.\n"); goto cleanup; } @@ -1083,7 +1093,7 @@ // Try to autodetect the BIOS boot partition for (partition_num = 0; partition_num < ENDSWAP(gpt_header.number_of_partition_entries); partition_num++) { uint64_t entry_off = (uint64_t)partition_num * ENDSWAP(gpt_header.size_of_partition_entry); - if (__builtin_add_overflow(gpt_part_entry_base, entry_off, &entry_off)) { + if (add_u64_overflow(gpt_part_entry_base, entry_off, &entry_off)) { fprintf(stderr, "error: GPT partition entry offset overflows.\n"); goto cleanup; } @@ -1102,13 +1112,30 @@ goto cleanup; } -bios_boot_autodetected: - if (((ENDSWAP(gpt_entry.ending_lba) - ENDSWAP(gpt_entry.starting_lba)) + 1) * lb_size < 32768) { +bios_boot_autodetected:; + uint64_t starting_lba = ENDSWAP(gpt_entry.starting_lba); + uint64_t ending_lba = ENDSWAP(gpt_entry.ending_lba); + + if (ending_lba < starting_lba) { + fprintf(stderr, "error: Partition %" PRIu32 " has ending LBA less than starting LBA.\n", partition_num + 1); + goto cleanup; + } + + uint64_t part_size; + if (mul_u64_overflow(ending_lba - starting_lba + 1, lb_size, &part_size)) { + fprintf(stderr, "error: Partition %" PRIu32 " size overflows.\n", partition_num + 1); + goto cleanup; + } + + if (part_size < 32768) { fprintf(stderr, "error: Partition %" PRIu32 " is smaller than 32KiB.\n", partition_num + 1); goto cleanup; } - stage2_loc = ENDSWAP(gpt_entry.starting_lba) * lb_size; + if (mul_u64_overflow(starting_lba, lb_size, &stage2_loc)) { + fprintf(stderr, "error: Partition %" PRIu32 " starting LBA overflows.\n", partition_num + 1); + goto cleanup; + } bool err; bool valid = validate_or_force(stage2_loc, force, &err); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/limine-protocol/PROTOCOL.md new/limine-10.8.5/limine-protocol/PROTOCOL.md --- old/limine-10.8.2/limine-protocol/PROTOCOL.md 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/limine-protocol/PROTOCOL.md 2026-03-12 00:35:18.000000000 +0100 @@ -286,14 +286,14 @@ - [EFI system table](#efi-system-table-feature) address is returned as **virtual** **([HHDM](#hhdm-higher-half-direct-map-feature))** again (physical only in [base revision 3](#base-revision-3) and [base revision 4](#base-revision-4)). -- **x86**: Extra control registers and descriptor table registers have more +- **x86-64**: Extra control registers and descriptor table registers have more strictly defined states. See [x86-64 machine state](#x86-64-1) for details. -- **x86**: I/O APIC redirection table entries with NMI and ExtINT delivery modes +- **x86-64**: I/O APIC redirection table entries with NMI and ExtINT delivery modes are also masked. -- **x86**: Any IOMMUs (Intel VT-d, AMD-Vi) have DMA translation and interrupt - remapping disabled. -- **x86**: The local APIC is initialised to a well-defined state on all processors - (BSP and APs). See [x86 machine state](#x86) for details. +- **x86-64**: All Intel VT-d IOMMUs have DMA translation and interrupt remapping disabled. + All AMD-Vi IOMMUs are disabled. +- **x86-64**: The local APIC is initialised to a well-defined state on all processors + (BSP and APs). See [x86-64 machine state](#x86-64-1) for details. ## Memory Layout at Entry @@ -455,22 +455,20 @@ IF flag, VM flag, and direction flag are cleared on entry. Other flags undefined. -PG is enabled (`cr0`), PE is enabled (`cr0`), PAE is enabled (`cr4`), -WP is enabled (`cr0`), LME is enabled (`EFER`). -NX is enabled (`EFER`) if available. +PE is enabled (`cr0`), ET is enabled (`cr0`), WP is enabled (`cr0`), PG is enabled (`cr0`), +PAE is enabled (`cr4`), LME and LMA are enabled (`EFER`). NX is enabled (`EFER`) +(if it is available). If 5-level paging is requested and available, then 5-level paging is enabled (LA57 bit in `cr4`). For [base revision 5](#base-revision-5) or greater, the following machine state is also guaranteed: -- ET is enabled (`cr0`). All other `cr0`, `cr4`, and `EFER` bits beyond - those specified above are cleared. -- `RFLAGS` is set to `0x2`. -- The task register is loaded with base 0 and limit 0. Executable must load - its own TSS. +- All other `cr0`, `cr4`, and `EFER` bits beyond those specified above are cleared. +- `RFLAGS` is set to `0x00000002`. +- The task register is loaded with base 0 and limit 0. No TSS is present. - The LDTR is loaded with the NULL selector. No LDT is present. -- The IDTR is loaded with base 0 and limit 0. Executable must load its own. +- The IDTR is loaded with base 0 and limit 0. No IDT is present. The A20 gate is opened. @@ -483,8 +481,9 @@ mask flag is left as set by firmware. Entries with other delivery modes are entirely left as set by firmware. -For [base revision 5](#base-revision-5) or greater, any IOMMUs (Intel VT-d, AMD-Vi) -have DMA translation and interrupt remapping disabled. +For [base revision 5](#base-revision-5) or greater, all Intel VT-d IOMMUs have DMA +translation and interrupt remapping disabled, and all AMD-Vi IOMMUs are disabled. +This can be overridden by the [x86-64 "Keep IOMMU" feature](#x86-64-keep-iommu-feature). For [base revision 5](#base-revision-5) or greater, the local APIC on each processor (BSP and APs), if available, is initialised as follows: @@ -1726,11 +1725,13 @@ ``` If this feature is requested, the bootloader will not disable IOMMUs (Intel VT-d, AMD-Vi) -that were enabled by the firmware. This is intended for security-conscious kernels that wish -to preserve DMA protection set up by firmware. +that were left enabled by the firmware at hand-off. This is intended for security-conscious +executables that wish to preserve DMA protection set up by firmware. -If this feature is not requested, the bootloader will disable any active IOMMUs before -handing control to the executable. +If this feature is not requested, the bootloader reserves the right to disable any active +IOMMUs before handing control to the executable. This is especially of note for base revisions +5 and greater, where the bootloader is mandated to disable VT-d and AMD-Vi IOMMUs, unless +this feature is requested. > [!NOTE] > On non-x86 platforms, no response will be provided. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/stage1/hdd/bootsect.asm new/limine-10.8.5/stage1/hdd/bootsect.asm --- old/limine-10.8.2/stage1/hdd/bootsect.asm 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/stage1/hdd/bootsect.asm 2026-03-12 00:35:18.000000000 +0100 @@ -78,6 +78,10 @@ lgdt [gdt] cli + + push dword 0 + mov ebp, 0x10 + mov eax, cr0 bts ax, 0 mov cr0, eax @@ -114,17 +118,14 @@ bits 32 vector: - mov eax, 0x10 - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax + mov ds, ebp + mov es, ebp + mov fs, ebp + mov gs, ebp + mov ss, ebp and edx, 0xff - push 0 - push edx push stage2.size diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/stage1/hdd/disk.asm new/limine-10.8.5/stage1/hdd/disk.asm --- old/limine-10.8.2/stage1/hdd/disk.asm 2026-02-26 01:26:03.000000000 +0100 +++ new/limine-10.8.5/stage1/hdd/disk.asm 2026-03-12 00:35:18.000000000 +0100 @@ -18,8 +18,7 @@ mov si, .da_struct - mov word [si], 16 - mov word [si+2], 1 + mov dword [si], 0x00010010 mov word [si+4], bx mov word [si+6], es @@ -34,11 +33,11 @@ mov si, .drive_params mov word [si], 30 ; buf_size int 0x13 - jc .done + jc .fail movzx ebp, word [si+24] ; bytes_per_sect ; ECX byte count to CX sector count - mov ax, cx + xchg ax, cx shr ecx, 16 mov dx, cx xor cx, cx @@ -52,10 +51,16 @@ pop si - ; EBP:EAX address to EAX LBA sector + ; EDX:EAX byte address to 64-bit LBA sector + push eax + xchg eax, edx + xor edx, edx + div ebp + xchg ebx, eax + pop eax div ebp mov dword [si+8], eax - mov dword [si+12], 0 + mov dword [si+12], ebx pop dx @@ -67,13 +72,16 @@ jc .done add word [si+4], bp - xor ebx, ebx - inc dword [si+8] - seto bl - add dword [si+12], ebx + add dword [si+8], 1 + adc dword [si+12], 0 loop .loop + jmp short .done + + .fail: + add sp, 12 + stc .done: popa ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/timestamps new/limine-10.8.5/timestamps --- old/limine-10.8.2/timestamps 2026-02-26 01:26:04.000000000 +0100 +++ new/limine-10.8.5/timestamps 2026-03-12 00:35:19.000000000 +0100 @@ -1,3 +1,3 @@ -REGEN_DATE="February 2026" -SOURCE_DATE_EPOCH="1772063639" -SOURCE_DATE_EPOCH_TOUCH="202602260053" +REGEN_DATE="March 2026" +SOURCE_DATE_EPOCH="1773271398" +SOURCE_DATE_EPOCH_TOUCH="202603120023" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/limine-10.8.2/version new/limine-10.8.5/version --- old/limine-10.8.2/version 2026-02-26 01:26:07.000000000 +0100 +++ new/limine-10.8.5/version 2026-03-12 00:35:22.000000000 +0100 @@ -1 +1 @@ -10.8.2 +10.8.5
