projects
/
profile
/
ivi
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
056069a
)
Shave a byte off the MBR code.
author
H. Peter Anvin
<hpa@zytor.com>
Wed, 11 Jul 2007 22:04:31 +0000
(15:04 -0700)
committer
H. Peter Anvin
<hpa@zytor.com>
Wed, 11 Jul 2007 22:04:31 +0000
(15:04 -0700)
mbr/mbr.S
patch
|
blob
|
history
diff --git
a/mbr/mbr.S
b/mbr/mbr.S
index
1e6842b
..
ea74a86
100644
(file)
--- a/
mbr/mbr.S
+++ b/
mbr/mbr.S
@@
-32,7
+32,7
@@
stack = 0x7c00
driveno = (stack-6)
sectors = (stack-8)
stack = 0x7c00
driveno = (stack-6)
sectors = (stack-8)
-secpercyl = (stack-1
0
)
+secpercyl = (stack-1
2
)
BIOS_page = 0x462
BIOS_page = 0x462
@@
-92,6
+92,7
@@
next:
andw $0x3f, %cx /* Sector count */
pushw %cx /* Save sectors on the stack */
xorw %ax, %ax
andw $0x3f, %cx /* Sector count */
pushw %cx /* Save sectors on the stack */
xorw %ax, %ax
+ pushw %ax /* High word of sectors/cylinder */
movb %dh, %al /* dh = number of heads */
incw %ax /* From 0-based to count */
mulw %cx /* Heads*sectors -> sectors per cylinder */
movb %dh, %al /* dh = number of heads */
incw %ax /* From 0-based to count */
mulw %cx /* Heads*sectors -> sectors per cylinder */
@@
-111,9
+112,8
@@
next:
*/
read_sector:
read_sector_cbios:
*/
read_sector:
read_sector_cbios:
- movl %eax, %edx
- shrl $16, %edx
- divw (secpercyl)
+ xorl %edx, %edx
+ divl (secpercyl)
rorb %ah
rorb %ah
movb %ah, %cl
rorb %ah
rorb %ah
movb %ah, %cl