summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-06 10:55:26 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-06 10:55:26 (GMT)
commit215925973b36eda85a3fd7978825004881c664c4 (patch)
tree32861d644a3e242716fbe040bfb4ef07a4cdc5c9
parent420fd29eaf077bc657dcecfc754ad6d71af3e352 (diff)
downloadvirtio9p-215925973b36eda85a3fd7978825004881c664c4.zip
virtio9p-215925973b36eda85a3fd7978825004881c664c4.tar.gz
virtio9p-215925973b36eda85a3fd7978825004881c664c4.tar.bz2
virtio9p-215925973b36eda85a3fd7978825004881c664c4.tar.xz
int2f: fix dispatch
We don't need to chain after final dispatch, add debug messages, fix limit check, correct dispatch table for disk size.
-rw-r--r--int2f.asm33
1 files changed, 26 insertions, 7 deletions
diff --git a/int2f.asm b/int2f.asm
index ee373e8..f4acd22 100644
--- a/int2f.asm
+++ b/int2f.asm
@@ -46,11 +46,11 @@ int2f_chain:
END(int2f)
LPROC(int2f_11) /* it is a redirector call */
- cmpb $MAX_FUNCTION,%ah
+ cmpb $MAX_FUNCTION,%al
ja not_us
btsw $0,%cs:stack_lock
jc not_us
-
+
pushal
pushw %ds
pushw %es
@@ -63,7 +63,14 @@ LPROC(int2f_11) /* it is a redirector call */
movw %sp,prev_stack
movw %cx,%ss
movw int2f_sp,%sp
+ movw %cx,%es
+#ifdef DEBUG
+ pushw %ax
+ call debug_printhex4
+ debugmsg ":"
+#endif
+
/* Now we are on our own stack. Get down to doing real work. */
cbw /* %ax <- %al */
@@ -93,20 +100,32 @@ LPROC(int2f_11) /* it is a redirector call */
* This call must preserve %bp, %ds, and %gs.
*/
callw *(dispatch_table+2)(%bx)
- jc quit
- movb $3,%cl /* Error locus = network */
+#ifdef DEBUG
+ pushl %eax
+ call debug_printhex8
+ call debug_crlf
+#endif
+
andw %ax,%ax /* If this is zero, no error */
- setnz F_FLAGS /* Return with CF=1 only on error */
jnz 1f
xorw %cx,%cx /* No error locus */
- xorl %eax,%eax /* No extended error */
+ cwtl /* No extended error */
+ andb $~1,F_FLAGS /* Clear CF on stack and in reg */
+ jmp 2f
1:
+ movb $3,%cl /* Error locus = network */
+ movw %ax,F_AX /* Return error code in AX */
+ orb $1,F_FLAGS /* Set CF on stack, clear CF in reg */
+2:
lesw dos_sda,%bx
movb %cl,%es:3(%bx) /* Error locus */
movl %eax,%es:4(%bx) /* Error action:class:code */
+ jmp 3f
quit:
+ debugmsg "quit\r\n"
+3:
lssw prev_stack,%sp
movb $0,stack_lock
@@ -141,7 +160,7 @@ dispatch_table:
.word acc_file, fxn_lockfile
.word acc_file, fxn_unlockfile
- .word acc_cds, fxn_diskspace /* 0x0c */
+ .word acc_cds_esdi, fxn_diskspace /* 0x0c */
.word acc_never, fxn_unknown
.word acc_cds, fxn_setattr
.word acc_cds, fxn_getattr