summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-03 06:46:22 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-03 06:46:22 (GMT)
commit7b098cc334a384fcb4fa339d9f728882b6251380 (patch)
treec27a53a4147d4e6e5b573e9ee6a356986cbf322e
parent64f42340d32553ef769ded706cd25927982790ab (diff)
downloadvirtio9p-7b098cc334a384fcb4fa339d9f728882b6251380.zip
virtio9p-7b098cc334a384fcb4fa339d9f728882b6251380.tar.gz
virtio9p-7b098cc334a384fcb4fa339d9f728882b6251380.tar.bz2
virtio9p-7b098cc334a384fcb4fa339d9f728882b6251380.tar.xz
v9fs: add symbolic names for various DOS field offsets
-rw-r--r--v9fs.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/v9fs.h b/v9fs.h
index e9f3bfd..fcb0785 100644
--- a/v9fs.h
+++ b/v9fs.h
@@ -242,6 +242,52 @@
#define L_ERFKILL 132 /* Operation not possible due to RF-kill */
#define L_EHWPOISON 133 /* Memory page has hardware error */
+/*
+ * Fields in the DOS Swappable Data Area (SDA)
+ *
+ * The SDA is different in DOS 3 and DOS 4+, but the areas we care about
+ * are either at the common head of the SDA (SDA_) or they are at a
+ * fixed address relative to the filename buffers (SDF_)
+ */
+#define SDA_ERRLOCUS 0x003 /* Extended error locus */
+#define SDA_ERREXT 0x004 /* Extended error code */
+#define SDA_ERRACTION 0x006 /* Extended error suggested action */
+#define SDA_ERRCLASS 0x007 /* Extended error class */
+#define SDA_ERRPTR 0x008 /* Extended error pointer */
+#define SDA_DTAPTR 0x00C /* Pointer to current DTA */
+
+#define SDF_FN1 0x000 /* First filename */
+#define SDF_FN2 0x080 /* Second filename */
+#define SDF_SEARCHDATA 0x100 /* Find first/find next data block */
+#define SDF_DIRENT 0x115 /* FAT-style directory entry for found file */
+#define SDF_CDS 0x135 /* Copy of CDS for current file */
+
+/*
+ * Fields in the DOS Current Directory Structure (CDS)
+ *
+ * Each drive letter has one CDS, but that includes SUBST, JOIN etc.
+ */
+#define CDS_PATH 0x00 /* Path to current directory */
+#define CDS_FLAGS 0x43 /* Drive attribute flags */
+#define CDS_DPBPTR 0x45 /* Drive Parameter Block pointer */
+#define CDS_REDIRPTR 0x49 /* Pointer to redirector */
+#define CDS_USERVAL 0x4d /* Network redirector "userval" */
+#define CDS_ROOTOFFSET 0x4f /* Characters to skip in path */
+
+/*
+ * Fields in the DOS System File Table (SFT) entries
+ */
+#define SFT_HANDLES 0x00 /* Count of file handles */
+#define SFT_MODE 0x02 /* File open mode per INT 21h, AH=3Dh */
+#define SFT_ATTRIB 0x04 /* File attribute */
+#define SFT_DEVINFO 0x05 /* Device info word */
+#define SFT_DPBPTR 0x07 /* Drive Parameter Block pointer */
+#define SFT_CLUSTER 0x0b /* Starting cluster */
+#define SFT_DATETIME 0x0d /* date:time */
+#define SFT_SIZE 0x11 /* Size of file in bytes */
+#define SFT_OFFSET 0x15 /* File pointer */
+#define SFT_OWNER 0x31 /* PSP of process owning file */
+
/* FID numbers we use */
#define FID_ROOT 2