@@ -100,9 +100,9 @@ global_asm!(
100100 "rm_disk_read_ext:" ,
101101 " mov ah, 0x42" ,
102102 " int 0x13" ,
103- " mov al, ah" , // move status into AL for caller
103+ " mov al, ah" , // move status into AL for caller
104104 " xor ah, ah" ,
105- " .byte 0xC3" , // 16-bit near ret — see module header
105+ " .byte 0xC3" , // 16-bit near ret — see module header
106106 // =======================================================================
107107 // rm_e820_next
108108 //
@@ -123,10 +123,10 @@ global_asm!(
123123 ".global rm_e820_next" ,
124124 "rm_e820_next:" ,
125125 " mov eax, 0xE820" ,
126- " mov edx, 0x534D4150" , // 'SMAP'
126+ " mov edx, 0x534D4150" , // 'SMAP'
127127 " mov ecx, 24" ,
128128 " int 0x15" ,
129- " .byte 0xC3" , // 16-bit near ret — see module header
129+ " .byte 0xC3" , // 16-bit near ret — see module header
130130 // =======================================================================
131131 // rm_vbe_info
132132 //
@@ -145,7 +145,7 @@ global_asm!(
145145 "rm_vbe_info:" ,
146146 " mov ax, 0x4F00" ,
147147 " int 0x10" ,
148- " .byte 0xC3" , // 16-bit near ret — see module header
148+ " .byte 0xC3" , // 16-bit near ret — see module header
149149 // =======================================================================
150150 // rm_vbe_mode_info
151151 //
@@ -162,7 +162,7 @@ global_asm!(
162162 "rm_vbe_mode_info:" ,
163163 " mov ax, 0x4F01" ,
164164 " int 0x10" ,
165- " .byte 0xC3" , // 16-bit near ret — see module header
165+ " .byte 0xC3" , // 16-bit near ret — see module header
166166 // =======================================================================
167167 // rm_vbe_set_mode
168168 //
@@ -180,7 +180,7 @@ global_asm!(
180180 "rm_vbe_set_mode:" ,
181181 " mov ax, 0x4F02" ,
182182 " int 0x10" ,
183- " .byte 0xC3" , // 16-bit near ret — see module header
183+ " .byte 0xC3" , // 16-bit near ret — see module header
184184 // =======================================================================
185185 // rm_outb_com1
186186 //
@@ -198,7 +198,7 @@ global_asm!(
198198 "rm_outb_com1:" ,
199199 " mov dx, 0x3F8" ,
200200 " out dx, al" ,
201- " .byte 0xC3" , // 16-bit near ret — see module header
201+ " .byte 0xC3" , // 16-bit near ret — see module header
202202 // =======================================================================
203203 // rm_unreal_enter
204204 //
@@ -223,11 +223,11 @@ global_asm!(
223223 " lgdt [gdt_descriptor]" ,
224224 " mov eax, cr0" ,
225225 " or eax, 1" ,
226- " mov cr0, eax" , // PE on
226+ " mov cr0, eax" , // PE on
227227 " mov bx, 0x10" ,
228- " mov fs, bx" , // FS cache ← flat 32-bit data descriptor
228+ " mov fs, bx" , // FS cache ← flat 32-bit data descriptor
229229 " and eax, 0xFFFFFFFE" ,
230- " mov cr0, eax" , // PE off (FS cache persists)
230+ " mov cr0, eax" , // PE off (FS cache persists)
231231 " sti" ,
232232 " .byte 0xC3" ,
233233 // =======================================================================
@@ -259,18 +259,18 @@ global_asm!(
259259 " cli" ,
260260 " mov eax, cr0" ,
261261 " or eax, 1" ,
262- " mov cr0, eax" , // PE on — required to populate ES cache
262+ " mov cr0, eax" , // PE on — required to populate ES cache
263263 " mov bx, 0x10" ,
264- " mov es, bx" , // ES cache ← flat 32-bit data
264+ " mov es, bx" , // ES cache ← flat 32-bit data
265265 " and eax, 0xFFFFFFFE" ,
266- " mov cr0, eax" , // PE off (ES cache persists)
266+ " mov cr0, eax" , // PE off (ES cache persists)
267267 " cld" ,
268268 // `addr32 rep movsb` = 0x67 0xF3 0xA4. Forces 32-bit address size
269269 // so the CPU uses ESI / EDI / ECX instead of SI / DI / CX. GAS's
270270 // Intel-syntax `addr32` prefix may not parse here, so emit raw.
271271 " .byte 0x67, 0xF3, 0xA4" ,
272- " pop es" , // restore caller's real-mode ES value +
273- // 64-KiB limit cache (via real-mode seg load)
272+ " pop es" , // restore caller's real-mode ES value +
273+ // 64-KiB limit cache (via real-mode seg load)
274274 " sti" ,
275275 " .byte 0xC3" ,
276276 // =======================================================================
@@ -331,7 +331,7 @@ global_asm!(
331331 " mov ds, ax" ,
332332 " mov es, ax" ,
333333 " mov di, 0x1000" ,
334- " mov cx, 0x1E00" , // 7680 bytes covers the bundle
334+ " mov cx, 0x1E00" , // 7680 bytes covers the bundle
335335 " xor al, al" ,
336336 " rep stosb" ,
337337 // Enter unreal mode so FS has a flat cache (rm_memcpy_to_high
@@ -382,18 +382,18 @@ global_asm!(
382382 " mov es, ax" ,
383383 " mov di, 0x0700" ,
384384 " mov ax, 0x0010" ,
385- " stosw" , // size + reserved
385+ " stosw" , // size + reserved
386386 " mov ax, 1" ,
387- " stosw" , // count
387+ " stosw" , // count
388388 " mov ax, 0x0500" ,
389- " stosw" , // offset = 0x0500
389+ " stosw" , // offset = 0x0500
390390 " mov ax, 0" ,
391- " stosw" , // segment = 0 → phys 0x0500
391+ " stosw" , // segment = 0 → phys 0x0500
392392 " xor ax, ax" ,
393- " stosw" , // LBA[0..1] = 0 (MBR)
394- " stosw" , // LBA[2..3]
395- " stosw" , // LBA[4..5]
396- " stosw" , // LBA[6..7]
393+ " stosw" , // LBA[0..1] = 0 (MBR)
394+ " stosw" , // LBA[2..3]
395+ " stosw" , // LBA[4..5]
396+ " stosw" , // LBA[6..7]
397397 " mov dl, [0x0401]" ,
398398 " mov si, 0x0700" ,
399399 " mov ah, 0x42" ,
@@ -406,7 +406,7 @@ global_asm!(
406406 " mov bx, 0x06BE" ,
407407 " mov cx, 4" ,
408408 ".Lpb_part_scan:" ,
409- " mov al, [bx + 4]" , // partition type byte
409+ " mov al, [bx + 4]" , // partition type byte
410410 " cmp al, 0x0B" ,
411411 " je .Lpb_part_found" ,
412412 " cmp al, 0x0C" ,
@@ -415,12 +415,12 @@ global_asm!(
415415 " je .Lpb_part_found" ,
416416 " add bx, 16" ,
417417 " loop .Lpb_part_scan" ,
418- " jmp .Lpb_fail" , // no FAT32/Linux partition
418+ " jmp .Lpb_fail" , // no FAT32/Linux partition
419419 ".Lpb_part_found:" ,
420- " mov eax, [bx + 8]" , // partition LBA (u32, offset 8 in entry)
421- " mov dword ptr [0x1C0C], eax" , // bundle.partition_lba
420+ " mov eax, [bx + 8]" , // partition LBA (u32, offset 8 in entry)
421+ " mov dword ptr [0x1C0C], eax" , // bundle.partition_lba
422422 " mov al, [bx + 4]" ,
423- " mov byte ptr [0x1C10], al" , // bundle.partition_type
423+ " mov byte ptr [0x1C10], al" , // bundle.partition_type
424424 // ---- Bulk-load partition into phys 0x0200_0000 (32 MiB), cap 8 MiB ----
425425 " mov al, 'L'" ,
426426 ".byte 0xE8" ,
@@ -444,51 +444,51 @@ global_asm!(
444444 " mov dl, [0x0401]" ,
445445 " mov ebx, [0x0424]" ,
446446 " mov edi, [0x0428]" ,
447- " push eax" , // stash chunk count across rm_load_chunk
447+ " push eax" , // stash chunk count across rm_load_chunk
448448 ".byte 0xE8" ,
449449 ".word rm_load_chunk - . - 2" ,
450- " pop ebx" , // chunk sectors (reuse ebx)
450+ " pop ebx" , // chunk sectors (reuse ebx)
451451 " test al, al" ,
452452 " jnz .Lpb_fail" ,
453453 " mov ecx, ebx" ,
454- " shl ecx, 9" , // chunk bytes
455- " add [0x0428], ecx" , // dest += bytes
456- " add [0x0424], ebx" , // LBA += chunk
457- " sub [0x0420], ebx" , // remaining -= chunk
454+ " shl ecx, 9" , // chunk bytes
455+ " add [0x0428], ecx" , // dest += bytes
456+ " add [0x0424], ebx" , // LBA += chunk
457+ " sub [0x0420], ebx" , // remaining -= chunk
458458 " jmp .Lpb_load_loop" ,
459459 ".Lpb_load_done:" ,
460460 " mov al, 'l'" ,
461461 ".byte 0xE8" ,
462462 ".word rm_outb_com1 - . - 2" ,
463- " mov dword ptr [0x1C14], 0x02000000" , // partition_image_phys low
464- " mov dword ptr [0x1C18], 0" , // partition_image_phys high
465- " mov dword ptr [0x1C1C], 0x00800000" , // partition_image_len low (8 MiB)
466- " mov dword ptr [0x1C20], 0" , // partition_image_len high
463+ " mov dword ptr [0x1C14], 0x02000000" , // partition_image_phys low
464+ " mov dword ptr [0x1C18], 0" , // partition_image_phys high
465+ " mov dword ptr [0x1C1C], 0x00800000" , // partition_image_len low (8 MiB)
466+ " mov dword ptr [0x1C20], 0" , // partition_image_len high
467467 // ---- RSDP scan 0xE0000..0xFFFF0 for \"RSD PTR \" ----
468468 " mov al, 'R'" ,
469469 ".byte 0xE8" ,
470470 ".word rm_outb_com1 - . - 2" ,
471471 " mov ebx, 0xE0000" ,
472472 ".Lpb_rsdp_loop:" ,
473- " cmp dword ptr [ebx + 0], 0x20445352" , // \"RSD \" LE
473+ " cmp dword ptr [ebx + 0], 0x20445352" , // \"RSD \" LE
474474 " jne .Lpb_rsdp_next" ,
475- " cmp dword ptr [ebx + 4], 0x20525450" , // \"PTR \" LE
475+ " cmp dword ptr [ebx + 4], 0x20525450" , // \"PTR \" LE
476476 " jne .Lpb_rsdp_next" ,
477- " mov dword ptr [0x2D28], ebx" , // bundle.rsdp_phys low
478- " mov dword ptr [0x2D2C], 0" , // bundle.rsdp_phys high
477+ " mov dword ptr [0x2D28], ebx" , // bundle.rsdp_phys low
478+ " mov dword ptr [0x2D2C], 0" , // bundle.rsdp_phys high
479479 " jmp .Lpb_rsdp_done" ,
480480 ".Lpb_rsdp_next:" ,
481- " add ebx, 16" , // RSDP is on 16-byte boundary
481+ " add ebx, 16" , // RSDP is on 16-byte boundary
482482 " cmp ebx, 0xFFFF0" ,
483483 " jb .Lpb_rsdp_loop" ,
484484 ".Lpb_rsdp_done:" ,
485485 // ---- SMBIOS / VBE: skipped in MVP; bundle fields stay 0. ----
486486 // ---- Stamp ZBDL_MAGIC last so kmain can detect partial init ----
487- " mov dword ptr [0x1000], 0x4C44425A" , // ZBDL_MAGIC
487+ " mov dword ptr [0x1000], 0x4C44425A" , // ZBDL_MAGIC
488488 " mov al, 'k'" ,
489489 ".byte 0xE8" ,
490490 ".word rm_outb_com1 - . - 2" ,
491- " .byte 0xC3" , // 16-bit near ret
491+ " .byte 0xC3" , // 16-bit near ret
492492 ".Lpb_fail:" ,
493493 // Emit the AL we're panicking on as two hex digits so bring-up
494494 // logs distinguish BIOS error code from parse-time 0xFF.
@@ -529,12 +529,12 @@ global_asm!(
529529 " mov bp, sp" ,
530530 // Stash inputs at DAP / near-scratch so the BIOS call clobbering
531531 // general registers doesn't lose them.
532- " mov word ptr [0x0700], 0x0010" , // DAP size + reserved
533- " mov word ptr [0x0702], ax" , // count
534- " mov word ptr [0x0704], 0x5000" , // buffer offset (bounce)
535- " mov word ptr [0x0706], 0x0000" , // buffer segment
536- " mov dword ptr [0x0708], ebx" , // LBA low32
537- " mov dword ptr [0x070C], 0" , // LBA high32
532+ " mov word ptr [0x0700], 0x0010" , // DAP size + reserved
533+ " mov word ptr [0x0702], ax" , // count
534+ " mov word ptr [0x0704], 0x5000" , // buffer offset (bounce)
535+ " mov word ptr [0x0706], 0x0000" , // buffer segment
536+ " mov dword ptr [0x0708], ebx" , // LBA low32
537+ " mov dword ptr [0x070C], 0" , // LBA high32
538538 // Save the chunk byte count (AX × 512) in the scratch dword at
539539 // 0x0710 so we can recover it after the BIOS call blows away AX.
540540 " movzx ecx, ax" ,
0 commit comments