summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-18 02:56:26 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-18 02:56:26 (GMT)
commit57c693d2d06451540db9fe688262db8fe1e01de7 (patch)
tree142d54cb2c4491fffaff56a8b9152c77b78c12c3
parent4758eea6b68f4ce2bbaa2668154babc051d80295 (diff)
downloadvirtio9p-57c693d2d06451540db9fe688262db8fe1e01de7.zip
virtio9p-57c693d2d06451540db9fe688262db8fe1e01de7.tar.gz
virtio9p-57c693d2d06451540db9fe688262db8fe1e01de7.tar.bz2
virtio9p-57c693d2d06451540db9fe688262db8fe1e01de7.tar.xz
readdir: return volume label
When searching for a volume label, return the mount tag.
-rw-r--r--readdir.asm27
1 files changed, 27 insertions, 0 deletions
diff --git a/readdir.asm b/readdir.asm
index 735e66b..b3a5794 100644
--- a/readdir.asm
+++ b/readdir.asm
@@ -35,9 +35,36 @@
* ------------------------------------------------------------------------- */
GPROC(fxn_findfirst)
+ lfsw dos_sdafcb,%si
+ movw dos_sdafn,%bx
+ addw $SDN_SEARCHDATA,%bx
+ movb drive_letter,%ah
+ orb $0xc0,%ah
+ movb %fs:SDF_ATTRIB(%si),%al /* File search attributes */
+ /* Save drive letter and search attributes */
+ movw %ax,%fs:(%bx)
+ testb $0x08,%al
+ jnz label
movl $0x08030002,%eax /* File not found */
clc
retw
+label:
+ /* Should check that we are in the root directory here */
+ leaw (SDN_DIRENT-SDN_SEARCHDATA)(%bx),%di
+ pushw %es
+ pushw %fs
+ popw %es
+ movw $11,%cx
+ movw $volume_label,%si
+ rep movsb
+ stosb /* Attribute: directory entry */
+ xorw %ax,%ax
+ movw $((32-12)/2),%cx
+ rep stosb
+ movb $21,(16-32)(%di) /* 1980-01-01 */
+ popw %es
+ xorw %ax,%ax
+ retw
END(fxn_findfirst)
/* ------------------------------------------------------------------------- *