Bugzilla – Attachment 61350 Details for
Bug 140119
gfxboot could be more big-endian-friendly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
make gfxboot detect byte-swapped cpio archives
gfxboot-cpio-swab.diff (text/plain), 1.72 KB, created by
Colin Watson
on 2005-12-19 11:01:01 UTC
(
hide
)
Description:
make gfxboot detect byte-swapped cpio archives
Filename:
MIME Type:
Creator:
Colin Watson
Created:
2005-12-19 11:01:01 UTC
Size:
1.72 KB
patch
obsolete
>diff -Nur gfxboot-3.2.5/bincode.asm gfxboot-3.2.5.new/bincode.asm >--- gfxboot-3.2.5/bincode.asm 2005-12-05 14:58:10.000000000 +0000 >+++ gfxboot-3.2.5.new/bincode.asm 2005-12-16 10:22:59.208000000 +0000 >@@ -441,6 +441,8 @@ > single_step db 0 > show_debug_info db 0 > >+fms_cpio_swab db 0 >+ > hello db 10, 'Initializing gfx code...', 10, 0 > msg_10 db '|ip %4x: %8x.%x |', 10, 0 > msg_11 db '|%2x: %8x.%2x', 0 >@@ -2698,10 +2700,17 @@ > jae fms_file_80 > > lin2segofs ebp,es,bx >+ mov byte [fms_cpio_swab],0 > cmp word [es:bx],71c7h >- jnz fms_file_80 >- >- movzx ecx,word [es:bx+20] ; file name size >+ jz fms_file_20 ; normal cpio record >+ cmp word [es:bx],0c771h ; maybe byte-swapped? >+ jnz fms_file_80 ; no cpio record >+ mov byte [fms_cpio_swab],1 >+ >+fms_file_20: >+ mov ax,[es:bx+20] ; file name size >+ call cpio_swab >+ movzx ecx,ax > inc cx > and cx,~1 ; align > >@@ -2710,8 +2719,13 @@ > cmp eax,ecx > jb fms_file_80 ; within header area > >- mov edx,[es:bx+22] ; data size >- rol edx,16 ; strange word order >+ mov ax,[es:bx+22] ; data size, MSW >+ call cpio_swab >+ mov dx,ax >+ shl edx,16 >+ mov ax,[es:bx+24] ; data size, LSW >+ call cpio_swab >+ mov dx,ax > > mov ebp,edx > inc ebp >@@ -2735,6 +2749,24 @@ > > ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > ; >+; byte-swap cpio data if appropriate >+; >+; ax: word to swap >+; >+; return: >+; ax: swapped if [fms_cpio_swab], otherwise same as input >+; >+cpio_swab: >+ cmp byte [fms_cpio_swab],0 >+ jz cpio_swab_90 >+ xchg ah,al >+ >+cpio_swab_90: >+ ret >+ >+ >+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >+; > ; Load segment with 4GB selector. > ; > ; byte [pm_seg_mask] segment bit mask (bit 1-3: es, fs, gs)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 140119
:
61349
| 61350 |
61351