summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-05 06:06:54 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-05 06:06:54 (GMT)
commit62a1fb70c1347fce39f227e5a3990a569c23f432 (patch)
tree249bf0904c5d005f73145215bb499115193c6834
parent7c5a8b6e05696763e2d1c66c272491fe746f3c75 (diff)
downloadvirtio9p-62a1fb70c1347fce39f227e5a3990a569c23f432.zip
virtio9p-62a1fb70c1347fce39f227e5a3990a569c23f432.tar.gz
virtio9p-62a1fb70c1347fce39f227e5a3990a569c23f432.tar.bz2
virtio9p-62a1fb70c1347fce39f227e5a3990a569c23f432.tar.xz
start: save mount tag in codepage to use as volume label
Save the first 11 bytes of the volume label in codepage format to use as volume label.
-rw-r--r--start.S18
1 files changed, 16 insertions, 2 deletions
diff --git a/start.S b/start.S
index 4431994..e0148e0 100644
--- a/start.S
+++ b/start.S
@@ -122,6 +122,9 @@ ok_version:
/* Mount tag in UTF-8 + length - we can spill over with a few bytes */
gibuf mount_tag, MOUNT_TAG_MAX+4+2
+ /* Mount tag in codepage, up to 11 bytes - volume label */
+ grbuf volume_label, 11
+
parse_cmdline:
call utf_init_plain
@@ -164,8 +167,14 @@ parse_cmdline:
jbe 2b /* Skip spaces */
movw $mount_tag+2,%di /* 2 bytes reserved for length */
-
+ movw $volume_label,%bx
+
3:
+ cmpw $volume_label+11,%bx
+ jae 5f /* The volume label is simply truncated */
+ movb %al,(%bx) /* Save to volume label */
+ incw %bx
+5:
call cptoutf
cmpw $mount_tag+2+MOUNT_TAG_MAX,%di
jae tag_too_long
@@ -179,7 +188,12 @@ parse_cmdline:
subw $mount_tag+2,%di
movw %di,mount_tag /* 2 first bytes for length */
- jmp get_dos_bits
+6:
+ cmpw $volume_label+11,%bx
+ jae get_dos_bits
+ movb $0x20,(%bx) /* Space pad */
+ incw %bx
+ jmp 6b
usage_error:
printmsg "Usage: v9fs drive: mount_tag\r\n"