Skip to content

Commit 989cbb6

Browse files
UnbreakableMJclaude
andcommitted
fix(bios): -D warnings compatibility on nightly rustc
Follow-up to 895c69b: CI's `RUSTFLAGS=-D warnings` promoted four warnings to errors under nightly — all latent in the BIOS path until build-images.sh started compiling zamak-stage1/zamak-bios. - `zamak-stage1/src/mbr.rs`, `zamak-bios/src/entry.rs`: drop the `.intel_syntax noprefix` / `.att_syntax prefix` directives that wrapped each `global_asm!`. Newer rustc emits `-D bad_asm_style` with the message "Intel syntax is the default" — the directives were redundant since `global_asm!` on x86 already defaults to Intel syntax. The inner asm text is unchanged (still Intel). - `zamak-bios/src/fat32.rs`: `#[allow(unused_imports)]` on `Vec` (used transitively via `vec!`). - `zamak-bios/src/main.rs`: `#[allow(unused_imports)]` on `fat32::Fat32`, `#[allow(dead_code)]` on the VGA-text `println` helper kept around for future debug instrumentation. Verified locally: `RUSTFLAGS='-D warnings' ./zamak-test/build-images.sh` compiles clean, and both `boot-smoke` (uefi) and `asm-verification` suites still `[PASS]`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 895c69b commit 989cbb6

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

zamak-bios/src/entry.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ use core::arch::global_asm;
3030
// sections share labels and data and must be linked as a single contiguous unit.
3131
// The call_bios_int function alone requires ~40 instructions because it performs
3232
// a full 32→16→real→16→32 mode round-trip to invoke BIOS interrupts.
33+
// NOTE: `global_asm!`'s default on x86 is Intel syntax — no
34+
// `.intel_syntax`/`.att_syntax` directives here (they became
35+
// `-D bad_asm_style` on modern rustc and CI runs with
36+
// `-D warnings`).
3337
global_asm!(
34-
".intel_syntax noprefix",
3538
// =========================================================================
3639
// 16-bit Real Mode Entry
3740
// =========================================================================
@@ -210,5 +213,4 @@ global_asm!(
210213
".align 4",
211214
"esp_save_ptr:",
212215
" .long 0",
213-
".att_syntax prefix",
214216
);

zamak-bios/src/fat32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use alloc::string::String;
55
use alloc::vec;
6+
#[allow(unused_imports)]
67
use alloc::vec::Vec;
78
use zamak_core::fs::{BlockDevice, Error, FileEntry, FileSystem, FileType};
89

zamak-bios/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub mod vbe;
3030

3131
use core::panic::PanicInfo;
3232
use disk::Disk;
33+
#[allow(unused_imports)]
3334
use fat32::Fat32;
3435
use mmap::get_memory_map;
3536

@@ -461,6 +462,7 @@ pub extern "C" fn kmain(drive_id: u8) -> ! {
461462
loop {}
462463
}
463464

465+
#[allow(dead_code)]
464466
fn println(vga: *mut u8, line: isize, msg: &str, color: u8) {
465467
for (i, &byte) in msg.as_bytes().iter().enumerate() {
466468
// SAFETY: vga points to 0xB8000 VGA text buffer (80x25x2 = 4000 bytes);

zamak-stage1/src/mbr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ use core::arch::global_asm;
2828
// must fit in exactly 512 bytes as a single contiguous block. The boot signature
2929
// at offset 510 and patchable fields at fixed offsets require .org directives
3030
// that only work within one assembly section.
31+
// NOTE: rustc's `global_asm!` default is Intel syntax on x86 targets, so
32+
// no `.intel_syntax noprefix` / `.att_syntax prefix` directives are
33+
// emitted around this block — newer nightlies warn about redundant
34+
// switches and our CI runs with `-D warnings`.
3135
global_asm!(
32-
".intel_syntax noprefix",
3336
".pushsection .mbr, \"ax\"",
3437
".code16",
3538
".global mbr_start",
@@ -123,5 +126,4 @@ global_asm!(
123126
// Boot signature at offset 510.
124127
".word 0xAA55",
125128
".popsection",
126-
".att_syntax prefix",
127129
);

0 commit comments

Comments
 (0)