Chameleon

Chameleon Commit Details

Date:2010-07-20 15:58:49 (9 years 1 month ago)
Author:Tamás Kosárszky
Commit:187
Parents: 186
Message:Added displaying source device and partition number for file read operations.
Changes:
M/trunk/i386/libsaio/msdos.c
M/trunk/i386/libsaio/saio_internal.h
M/trunk/i386/libsaio/sys.c
M/trunk/i386/libsaio/hfs.c

File differences

trunk/i386/libsaio/hfs.c
264264
265265
266266
267
267268
268269
269270
270
271
271272
272273
273274
......
298299
299300
300301
301
302
302
303
304
303305
304306
305307
long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length)
{
char entry[512];
char devStr[12];
long dirID, result, flags;
if (HFSInitPartition(ih) == -1) return -1;
dirID = kHFSRootFolderID;
// Skip a lead '\'. Start in the system folder if there are two.
if (filePath[0] == '/') {
return -1;
}
verbose("Loaded HFS%s file: [%s] %d bytes from %x.\n",
(gIsHFSPlus ? "+" : ""), filePath, (uint32_t)length, ih);
getDeviceStringFromBVR(ih, devStr);
verbose("Loaded HFS%s file: [%s/%s] %d bytes.\n",
(gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length);
return length;
}
trunk/i386/libsaio/sys.c
8787
8888
8989
90
9091
9192
92
93
94
95
93
94
9695
9796
9897
......
10221021
10231022
10241023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
int type;
};
// Device entries must be ordered by bios device numbers.
static struct devsw devsw[] =
{
{ "sd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_SD */
{ "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */
{ "fd", 0x00, kBIOSDevTypeFloppy }, /* DEV_FD */
{ "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */
{ "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */
{ "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */
{ "rd", 0x100, kBIOSDevTypeHardDrive },
{ "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition
{ 0, 0 }
return bvr ? bvr : bvr1;
}
int getDeviceStringFromBVR(const BVRef bvr, char *str)
{
const struct devsw *dp;
if (bvr)
{
*str = '\0';
for (dp = devsw; dp->name && bvr->biosdev >= dp->biosdev; dp++);
dp--;
if (dp->name) sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no);
return true;
}
return false;
}
trunk/i386/libsaio/msdos.c
720720
721721
722722
723
724
723725
724726
725727
......
754756
755757
756758
757
758
759
760
761
762
759763
760764
761765
char *ptr = (char *)base;
struct direntry *dirp;
int i;
char devStr[12];
if (MSDOSInitPartition (ih)<0)
return -1;
if (filePath[0] == '/')
ptr+=msdosclustersize;
toread-=msdosclustersize;
}
verbose("Loaded FAT%d file: [%s] %d bytes from %x.\n",
msdosfatbits, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread, ih);
getDeviceStringFromBVR(ih, devStr);
verbose("Loaded FAT%d file: [%s/%s] %d bytes.\n",
msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread);
free (buf);
if (toread<0)
return wastoread;
trunk/i386/libsaio/saio_internal.h
199199
200200
201201
202
202203
203204
204205
extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose);
extern void setRootVolume(BVRef volume);
extern void setBootGlobals(BVRef chain);
extern int getDeviceStringFromBVR(const BVRef volume, char *str);
extern int gBIOSDev;
extern int gBootFileType;

Archive Download the corresponding diff file

Revision: 187