View | Details | Raw Unified | Return to bug 140119
Collapse All | Expand All

(-)gfxboot-3.2.5/bincode.asm (-5 / +37 lines)
Lines 441-446 Link Here
441
single_step		db 0
441
single_step		db 0
442
show_debug_info		db 0
442
show_debug_info		db 0
443
443
444
fms_cpio_swab		db 0
445
444
hello			db 10, 'Initializing gfx code...', 10, 0
446
hello			db 10, 'Initializing gfx code...', 10, 0
445
msg_10			db '|ip %4x:  %8x.%x           |', 10, 0
447
msg_10			db '|ip %4x:  %8x.%x           |', 10, 0
446
msg_11			db '|%2x: %8x.%2x', 0
448
msg_11			db '|%2x: %8x.%2x', 0
Lines 2698-2707 Link Here
2698
		jae fms_file_80
2700
		jae fms_file_80
2699
2701
2700
		lin2segofs ebp,es,bx
2702
		lin2segofs ebp,es,bx
2703
		mov byte [fms_cpio_swab],0
2701
		cmp word [es:bx],71c7h
2704
		cmp word [es:bx],71c7h
2702
		jnz fms_file_80
2705
		jz fms_file_20			; normal cpio record
2703
2706
		cmp word [es:bx],0c771h		; maybe byte-swapped?
2704
		movzx ecx,word [es:bx+20]	; file name size
2707
		jnz fms_file_80			; no cpio record
2708
		mov byte [fms_cpio_swab],1
2709
2710
fms_file_20:
2711
		mov ax,[es:bx+20]		; file name size
2712
		call cpio_swab
2713
		movzx ecx,ax
2705
		inc cx
2714
		inc cx
2706
		and cx,~1			; align
2715
		and cx,~1			; align
2707
2716
Lines 2710-2717 Link Here
2710
		cmp eax,ecx
2719
		cmp eax,ecx
2711
		jb fms_file_80			; within header area
2720
		jb fms_file_80			; within header area
2712
2721
2713
		mov edx,[es:bx+22]		; data size
2722
		mov ax,[es:bx+22]		; data size, MSW
2714
		rol edx,16			; strange word order
2723
		call cpio_swab
2724
		mov dx,ax
2725
		shl edx,16
2726
		mov ax,[es:bx+24]		; data size, LSW
2727
		call cpio_swab
2728
		mov dx,ax
2715
2729
2716
		mov ebp,edx
2730
		mov ebp,edx
2717
		inc ebp
2731
		inc ebp
Lines 2735-2740 Link Here
2735
2749
2736
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2750
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2737
;
2751
;
2752
; byte-swap cpio data if appropriate
2753
;
2754
;  ax:		word to swap
2755
;
2756
; return:
2757
;  ax:		swapped if [fms_cpio_swab], otherwise same as input
2758
;
2759
cpio_swab:
2760
		cmp byte [fms_cpio_swab],0
2761
		jz cpio_swab_90
2762
		xchg ah,al
2763
2764
cpio_swab_90:
2765
		ret
2766
2767
2768
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2769
;
2738
; Load segment with 4GB selector.
2770
; Load segment with 4GB selector.
2739
;
2771
;
2740
;  byte [pm_seg_mask]	segment bit mask (bit 1-3: es, fs, gs)
2772
;  byte [pm_seg_mask]	segment bit mask (bit 1-3: es, fs, gs)

Return to bug 140119