rombios: compute checksum for roms bigger than a segment

From: Glauber Costa <glommer@redhat.com>
From: "Sebastian Herbszt" <herbszt@gmx.de>
Ported by: Akio Takebe <takebe_akio@jp.fujitsu.com>
This commit is contained in:
Keir Fraser committed 2009-06-04 10:36:01 +01:00
1 parent 83fd7b933e
commit 39c0fe0403
1 file changed
+28 -6
+28 -6
View File
@@ -10439,22 +10439,44 @@ no_serial:
ret
rom_checksum:
push ax
push bx
push cx
pusha
push ds
xor ax, ax
xor bx, bx
xor cx, cx
xor dx, dx
mov ch, [2]
shl cx, #1
jnc checksum_loop
jz checksum_loop
xchg dx, cx
dec cx
checksum_loop:
add al, [bx]
inc bx
loop checksum_loop
test dx, dx
je checksum_out
add al, [bx]
mov cx, dx
mov dx, ds
add dh, #0x10
mov ds, dx
xor dx, dx
xor bx, bx
jmp checksum_loop
checksum_out:
and al, #0xff
pop cx
pop bx
pop ax
pop ds
popa
ret
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.