summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-06 10:54:55 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-06 10:54:55 (GMT)
commit420fd29eaf077bc657dcecfc754ad6d71af3e352 (patch)
tree919f474ba1b12631106673f23d040e590daac4b6
parent08071cd4c1a9f9f7cd0c4e882fdaa64358ae2073 (diff)
downloadvirtio9p-420fd29eaf077bc657dcecfc754ad6d71af3e352.zip
virtio9p-420fd29eaf077bc657dcecfc754ad6d71af3e352.tar.gz
virtio9p-420fd29eaf077bc657dcecfc754ad6d71af3e352.tar.bz2
virtio9p-420fd29eaf077bc657dcecfc754ad6d71af3e352.tar.xz
Fix CDS-based accept handling
-rw-r--r--acc.asm22
-rw-r--r--start.asm7
2 files changed, 25 insertions, 4 deletions
diff --git a/acc.asm b/acc.asm
index b36ded7..dfaee91 100644
--- a/acc.asm
+++ b/acc.asm
@@ -56,13 +56,12 @@ END(acc_file)
/*
* Available for multiple users of a modified drive number
- * at %fs:(%si) - specifically a zero-based drive number where
+ * at %fs:(%si) - specifically a one-based drive number where
* bit 6 is expected to be set for a conforming redirector.
*/
LPROC(acc_drive_common)
movb %fs:(%si),%al /* Device info word (low half) */
andb $0x5f,%al /* Drive number + conforming bit (6) */
- incw %ax
cmpb drive_letter,%al
jne acc_fail
/* CF = 0 if equal */
@@ -103,8 +102,11 @@ fxn_unknown = acc_never
* ------------------------------------------------------------------------- */
GPROC(acc_cds)
- lfsw dos_sdafn,%si
- addw $SDN_CDS,%si
+ lfsw dos_cdsptr,%si
+ lfsw %fs:(%si),%si
+ /* Fall through */
+END(acc_cds)
+LPROC(acc_cds_common)
cmpw $CDS_MAGIC,%fs:CDS_DPBPTR(%si) /* Our magic? */
jne acc_fail
movb drive_letter,%al
@@ -118,6 +120,18 @@ GPROC(acc_cds)
END(acc_cds)
/* ------------------------------------------------------------------------- *
+ * acc_cds_esdi
+ *
+ * ES:DI contains a pointer to the CDS
+ * ------------------------------------------------------------------------- */
+
+GPROC(acc_cds_esdi)
+ movw F_DI,%si
+ movw F_ES,%fs
+ jmp acc_cds_common
+END(acc_cds_esdi)
+
+/* ------------------------------------------------------------------------- *
* acc_qualify
* ------------------------------------------------------------------------- */
diff --git a/start.asm b/start.asm
index 8ce964a..4317e11 100644
--- a/start.asm
+++ b/start.asm
@@ -212,6 +212,7 @@ tag_too_long:
grblong dos_sda /* Pointer to Swappable Data Area */
grblong dos_sdafn /* Pointer to first filename in SDA */
grblong dos_sdafcb /* Pointer to the FCB entries in SDA */
+ grblong dos_cdsptr /* Pointer to the CDS pointer in SDA */
liblong dos_lol /* Pointer to List of Lists */
liblong dos_cds /* Pointer to Current Directory Structures */
liblong our_cds /* Pointer to our own CDS */
@@ -234,10 +235,12 @@ get_dos_bits:
movw %ds,%cs:dos_sda+2
addw $0x92,%si /* DOS 3.x: searchdata @ 0x92 */
movw $(0x218-0x92),%ax /* Further offset for the FCB entries */
+ movw $(0x26c-0x218),%cx /* Further offset for the CDS pointer */
popfw /* DOS 4+? */
jb 2f
addw $(0x9e-0x92),%si
movw $(0x22b-0x9e),%ax
+ movw $(0x282-0x22b),%cx
2:
movw %si,%cs:dos_sdafn
movw %ds,%cs:dos_sdafn+2
@@ -245,6 +248,10 @@ get_dos_bits:
addw %ax,%si
movw %si,%cs:dos_sdafcb
movw %ds,%cs:dos_sdafcb+2
+
+ addw %cx,%si
+ movw %si,%cs:dos_cdsptr
+ movw %ds,%cs:dos_cdsptr+2
popw %ds