summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-18 01:58:11 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-18 01:58:11 (GMT)
commit26325096ac0a86dcb637a41046a637eb13d72d73 (patch)
tree673e6fa7c8f8291344a93b753cf8efd5e4d4b839
parent1b4d277bd509b53ec506558e0eab82d7504bde6f (diff)
downloadvirtio9p-26325096ac0a86dcb637a41046a637eb13d72d73.zip
virtio9p-26325096ac0a86dcb637a41046a637eb13d72d73.tar.gz
virtio9p-26325096ac0a86dcb637a41046a637eb13d72d73.tar.bz2
virtio9p-26325096ac0a86dcb637a41046a637eb13d72d73.tar.xz
Fix the corner cases in diskspc, it is now functional...
-rw-r--r--fxn.asm20
1 files changed, 12 insertions, 8 deletions
diff --git a/fxn.asm b/fxn.asm
index acfc7d8..5b40108 100644
--- a/fxn.asm
+++ b/fxn.asm
@@ -145,7 +145,7 @@ GPROC(fxn_diskspace)
2:
addb $32,%cl
3:
- cmpb $38,%cl
+ cmpb $37,%cl
ja 10f
subb $15,%cl
jnb 31f
@@ -182,12 +182,21 @@ GPROC(fxn_diskspace)
andl %edx,%edx
jnz 11f
cmpl $0x10000,%eax
- jae 11f
+ jbe 5f
+11:
+ debugmsg "Free space overflow\r\n"
+ movw $0xffff,%ax
5:
movw %ax,F_DX /* Available clusters */
/* Now, we need to turn %cl into a count */
+#ifdef DEBUG
+ debugmsg "Shift: "
+ pushw %cx
+ call debug_printhex2
+ call debug_crlf
+#endif
movw $1,%ax
movb $15,%ch
pushw %ax
@@ -211,15 +220,10 @@ GPROC(fxn_diskspace)
10: /* Total size overflow */
debugmsg "Size overflow\r\n"
- movb $(38-15),%cl
+ movb $(37-15),%cl
movw $0xffff,%ax
jmp 4b
-11: /* Free space overflow */
- debugmsg "Free space overflow\r\n"
- movw $0xffff,%ax
- jmp 5b
-
12: /* Error, but DOS doesn't like this. Return zero space. */
xorw %ax,%ax
movw $512,F_CX