Closed GoogleCodeExporter closed 8 years ago
This seems to be a FAT v. VFAT issue.
Byte 12 in the directory entry has bit 4 = lowercase extension, bit 3=lowercase
base filename.
The main thing is that when specifying filenames or folder names as a kernel
parameter - e.g. scan-iso/filename=/fred or from=/fred/doris.iso or
from=/FRED/DORIS.ISO are linux distros case sensitive?
e.g. CentOS displays filenames in the same way that Win7 does (i.e. as
determined by byte 12).
fsys_fat.c has code:
short_name:
/* XXX convert to 8.3 filename format here */
{
int i, j, c;
for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i]))
&& /*!isspace (c)*/ c != ' '; i++);
filename[i++] = '.';
for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j]))
&& /*!isspace (c)*/ c != ' '; j++);
if (j == 0)
i--;
filename[i + j] = 0;
}
This should look at byte 12 bits 3 & 4 to determine whether to use uppercase or
lowercase, not just convert all to lowercase.
Maybe a switch in grub4dos could control what mode it is in FAT or VFAT ???
Original comment by Steve6375
on 25 Feb 2014 at 10:26
This (very bad!) code seems to work
short_name:
/* XXX convert to 8.3 filename format here */
{
int i, j, c;
if ( (dir_buf[12] & 8) == 8)
{
for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i]))
&& /*!isspace (c)*/ c != ' '; i++);
}
if ( (dir_buf[12] & 8) == 0)
{
for (i = 0; i < 8 && (c = filename[i] = (dir_buf[i]))
&& /*!isspace (c)*/ c != ' '; i++);
}
filename[i++] = '.';
if ( (dir_buf[12] & 16) == 16)
{
for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j]))
&& /*!isspace (c)*/ c != ' '; j++);
}
if ( (dir_buf[12] & 16) == 0)
{
for (j = 0; j < 3 && (c = filename[i + j] = (dir_buf[8 + j]))
&& /*!isspace (c)*/ c != ' '; j++);
}
if (j == 0)
i--;
filename[i + j] = 0;
}
valid_filename:
Original comment by Steve6375
on 25 Feb 2014 at 11:12
#define LCASE_BASE 0x08 // filename base in lower case
#define LCASE_EXT 0x10 // filename extension in lower case
This is used to define the bits.
Original comment by Steve6375
on 25 Feb 2014 at 1:32
Try and see if this could work:
short_name:
/* XXX convert to 8.3 filename format here */
{
unsigned int i, j, c, y;
#define TOLOWER(c,y) (((y) && ((unsigned)((c) - 'A') < 26)) ? ((c)|0x20) : (c))
y = (dir_buf[12] & 0x08); // filename base in lower case
for (i = 0; i < 8 && (c = filename[i] = TOLOWER (dir_buf[i], y))
&& /*!isspace (c)*/ c != ' '; i++);
filename[i++] = '.';
y = (dir_buf[12] & 0x10); // filename extension in lower case
for (j = 0; j < 3 && (c = filename[i+j] = TOLOWER (dir_buf[8+j], y))
&& /*!isspace (c)*/ c != ' '; j++);
if (j == 0)
i--;
filename[i + j] = 0;
}
Original comment by tinyb...@gmail.com
on 26 Feb 2014 at 5:11
Attachments:
Yes - works fine :-)
Original comment by Steve6375
on 26 Feb 2014 at 5:31
P.S. Are tolower and TOLOWER identical in function?
Original comment by Steve6375
on 26 Feb 2014 at 5:42
no, not identical.
TOLOWER is a "conditional tolower", it turns char to lower case if and only if
y is True or Yes.
Original comment by tinyb...@gmail.com
on 27 Feb 2014 at 12:15
Sure, but what I mean is
tolower equivalent to (((y) && ((unsigned)((c) - 'A') < 26)) ? ((c)|0x20) :
(c))
Original comment by Steve6375
on 27 Feb 2014 at 12:17
as explained above, in the case of y == True,
tolower(c) is equivalent to (((y) && ((unsigned)((c) - 'A') < 26)) ?
((c)|0x20) : (c))
Original comment by tinyb...@gmail.com
on 27 Feb 2014 at 7:48
OK thanks - will there be a new 0.4.5c version soon please? I want to release a
new version of Easy2Boot with the new version of grldr. Thanks :-)
Original comment by Steve6375
on 27 Feb 2014 at 9:58
I think you may compile your own "new" version. And I think it will be
equivalent to the upcoming release by grub4dos team.
Original comment by tinyb...@gmail.com
on 27 Feb 2014 at 10:36
Adoption in GRUB4DOS 0.4.6a .
Original comment by yaya2007_7777@126.com
on 28 Feb 2014 at 12:15
[deleted comment]
If both long file names, another short file names, grub4dos content output by
long file names.
If only short file names, grub4dos uppercase to lowercase.
After modification, GRUB4DOS will be 12 bytes, 3,4-bit control.
Original comment by yaya2007_7777@126.com
on 4 Mar 2014 at 2:16
This issue was updated by revision r374.
Original comment by chenall.cn
on 21 Jun 2014 at 1:16
Original issue reported on code.google.com by
Steve6375
on 23 Feb 2014 at 7:21Attachments: