Report the partition type as string. Not the best way yet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2007-10-26 23:09:14 +00:00
parent e99c785f5c
commit 66cda9d0d7
2 changed files with 18 additions and 1 deletions

View File

@ -176,11 +176,22 @@ atari_scan_partition(int fd, partition_data *partition, void *_cookie)
TRACE(("atari: child partition exceeds existing space (%Ld bytes)\n", p->Size()*SECTSZ));
continue;
}
if (!isalnum(p->id[0]))
continue;
if (!isalnum(p->id[1]))
continue;
if (!isalnum(p->id[2]))
continue;
partition_data *child = create_child_partition(partition->id, index, -1);
if (child == NULL) {
TRACE(("atari: Creating child at index %ld failed\n", index - 1));
return B_ERROR;
}
#warning M68K: use a lookup table ?
char type[] = "??? Partition";
memcpy(type, p->id, 3);
child->type = strdup(type);
child->offset = partition->offset + p->Start() * (uint64)SECTSZ;
child->size = p->Size() * (uint64)SECTSZ;
child->block_size = SECTSZ;

View File

@ -14,7 +14,13 @@ struct atari_partition_entry {
#define ATARI_PART_EXISTS 0x01
#define ATARI_PART_BOOTABLE 0x80
uint8 flags;
char id[3]; /* "GEM", ... should use "BFS" ? */
/* some known types */
#define ATARI_PART_TYEP_GEM 'G', 'E', 'M'
#define ATARI_PART_TYEP_LNX 'L', 'N', 'X'
#define ATARI_PART_TYEP_OS9 'O', 'S', '9'
/* the one we'll use */
#define ATARI_PART_TYEP_BFS 'B', 'F', 'S'
char id[3];
uint32 start;
uint32 size;