Restore to pc98 support.

This commit is contained in:
Yoshihiro Takahashi 2002-10-31 05:51:25 +00:00
parent fecafa765a
commit fe1f2a9a84
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106238
3 changed files with 108 additions and 50 deletions

View File

@ -255,7 +255,19 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
} }
break; break;
case p_pc98: case p_pc98:
subtype = 0xc494; switch (type) {
case freebsd:
subtype = 0xc494;
/* FALLTHROUGH */
case fat:
c1 = Find_Mother_Chunk(d->chunks, offset, end, whole);
break;
case part:
c1 = Find_Mother_Chunk(d->chunks, offset, end, freebsd);
break;
default:
return(-1);
}
break; break;
case p_sparc64: case p_sparc64:
case p_alpha: case p_alpha:
@ -286,7 +298,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
if (platform == p_sparc64) { if (platform == p_sparc64) {
offset = Prev_Cyl_Aligned(d, offset); offset = Prev_Cyl_Aligned(d, offset);
size = Next_Cyl_Aligned(d, size); size = Next_Cyl_Aligned(d, size);
} else if (platform == p_i386) { } else if (platform == p_i386 || platform == p_pc98) {
if (type != freebsd) if (type != freebsd)
break; break;
if (!(flags & CHUNK_ALIGN)) if (!(flags & CHUNK_ALIGN))

View File

@ -266,7 +266,10 @@ Debug_Disk(struct disk *d)
printf(" bios_geom=%lu/%lu/%lu = %lu\n", printf(" bios_geom=%lu/%lu/%lu = %lu\n",
d->bios_cyl, d->bios_hd, d->bios_sect, d->bios_cyl, d->bios_hd, d->bios_sect,
d->bios_cyl * d->bios_hd * d->bios_sect); d->bios_cyl * d->bios_hd * d->bios_sect);
#if defined(__i386__) #if defined(PC98)
printf(" boot1=%p, boot2=%p, bootipl=%p, bootmenu=%p\n",
d->boot1, d->boot2, d->bootipl, d->bootmenu);
#elif defined(__i386__)
printf(" boot1=%p, boot2=%p, bootmgr=%p\n", printf(" boot1=%p, boot2=%p, bootmgr=%p\n",
d->boot1, d->boot2, d->bootmgr); d->boot1, d->boot2, d->bootmgr);
#elif defined(__alpha__) #elif defined(__alpha__)
@ -361,8 +364,14 @@ Disk_Names()
return disks; return disks;
} }
#ifdef PC98
void
Set_Boot_Mgr(struct disk *d, const u_char *bootipl, const size_t bootipl_size,
const u_char *bootmenu, const size_t bootmenu_size)
#else
void void
Set_Boot_Mgr(struct disk *d, const u_char *b, const size_t s) Set_Boot_Mgr(struct disk *d, const u_char *b, const size_t s)
#endif
{ {
#if !defined(__ia64__) #if !defined(__ia64__)
#ifdef PC98 #ifdef PC98
@ -440,52 +449,82 @@ Set_Boot_Blocks(struct disk *d, const u_char *b1, const u_char *b2)
return 0; return 0;
} }
#ifdef PC98
const char * const char *
slice_type_name( int type, int subtype ) slice_type_name( int type, int subtype )
{ {
switch (type) { switch (type) {
case 0: return "whole"; case 0:
case 1: switch (subtype) { return "whole";
case 1: return "fat (12-bit)"; case 2:
case 2: return "XENIX /"; return "fat";
case 3: return "XENIX /usr"; case 3:
case 4: return "fat (16-bit,<=32Mb)"; switch (subtype) {
case 5: return "extended DOS"; case 0xc494: return "freebsd";
case 6: return "fat (16-bit,>32Mb)";
case 7: return "NTFS/HPFS/QNX";
case 8: return "AIX bootable";
case 9: return "AIX data";
case 10: return "OS/2 bootmgr";
case 11: return "fat (32-bit)";
case 12: return "fat (32-bit,LBA)";
case 14: return "fat (16-bit,>32Mb,LBA)";
case 15: return "extended DOS, LBA";
case 18: return "Compaq Diagnostic";
case 84: return "OnTrack diskmgr";
case 100: return "Netware 2.x";
case 101: return "Netware 3.x";
case 115: return "SCO UnixWare";
case 128: return "Minix 1.1";
case 129: return "Minix 1.5";
case 130: return "linux_swap";
case 131: return "ext2fs";
case 166: return "OpenBSD FFS"; /* 0xA6 */
case 169: return "NetBSD FFS"; /* 0xA9 */
case 182: return "OpenBSD"; /* dedicated */
case 183: return "bsd/os";
case 184: return "bsd/os swap";
case 238: return "EFI GPT";
case 239: return "EFI Sys. Part.";
default: return "unknown";
}
case 2: return "fat";
case 3: switch (subtype) {
case 165: return "freebsd";
default: return "unknown";
}
case 4: return "extended";
case 5: return "part";
case 6: return "unused";
default: return "unknown"; default: return "unknown";
}
default:
return "unknown";
} }
} }
#else /* PC98 */
const char *
slice_type_name( int type, int subtype )
{
switch (type) {
case 0:
return "whole";
case 1:
switch (subtype) {
case 1: return "fat (12-bit)";
case 2: return "XENIX /";
case 3: return "XENIX /usr";
case 4: return "fat (16-bit,<=32Mb)";
case 5: return "extended DOS";
case 6: return "fat (16-bit,>32Mb)";
case 7: return "NTFS/HPFS/QNX";
case 8: return "AIX bootable";
case 9: return "AIX data";
case 10: return "OS/2 bootmgr";
case 11: return "fat (32-bit)";
case 12: return "fat (32-bit,LBA)";
case 14: return "fat (16-bit,>32Mb,LBA)";
case 15: return "extended DOS, LBA";
case 18: return "Compaq Diagnostic";
case 84: return "OnTrack diskmgr";
case 100: return "Netware 2.x";
case 101: return "Netware 3.x";
case 115: return "SCO UnixWare";
case 128: return "Minix 1.1";
case 129: return "Minix 1.5";
case 130: return "linux_swap";
case 131: return "ext2fs";
case 166: return "OpenBSD FFS"; /* 0xA6 */
case 169: return "NetBSD FFS"; /* 0xA9 */
case 182: return "OpenBSD"; /* dedicated */
case 183: return "bsd/os";
case 184: return "bsd/os swap";
case 238: return "EFI GPT";
case 239: return "EFI Sys. Part.";
default: return "unknown";
}
case 2:
return "fat";
case 3:
switch (subtype) {
case 165: return "freebsd";
default: return "unknown";
}
case 4:
return "extended";
case 5:
return "part";
case 6:
return "unused";
default:
return "unknown";
}
}
#endif /* PC98 */

View File

@ -156,7 +156,6 @@ Rule_001(const struct disk *d, const struct chunk *c, char *msg)
static void static void
Rule_002(const struct disk *d, const struct chunk *c, char *msg) Rule_002(const struct disk *d, const struct chunk *c, char *msg)
{ {
#ifndef PC98
int i; int i;
struct chunk *c1; struct chunk *c1;
@ -171,7 +170,6 @@ Rule_002(const struct disk *d, const struct chunk *c, char *msg)
sprintf(msg + strlen(msg), sprintf(msg + strlen(msg),
"Max one 'fat' allowed as child of 'whole'\n"); "Max one 'fat' allowed as child of 'whole'\n");
} }
#endif
} }
/* /*
@ -181,7 +179,6 @@ Rule_002(const struct disk *d, const struct chunk *c, char *msg)
static void static void
Rule_003(const struct disk *d, const struct chunk *c, char *msg) Rule_003(const struct disk *d, const struct chunk *c, char *msg)
{ {
#ifndef PC98
int i; int i;
struct chunk *c1; struct chunk *c1;
@ -196,7 +193,6 @@ Rule_003(const struct disk *d, const struct chunk *c, char *msg)
sprintf(msg + strlen(msg), sprintf(msg + strlen(msg),
"Max one 'extended' allowed as child of 'whole'\n"); "Max one 'extended' allowed as child of 'whole'\n");
} }
#endif
} }
/* /*
@ -234,7 +230,8 @@ static void
Check_Chunk(const struct disk *d, const struct chunk *c, char *msg) Check_Chunk(const struct disk *d, const struct chunk *c, char *msg)
{ {
if (platform == p_i386) { switch (platform) {
case p_i386:
Rule_000(d, c, msg); Rule_000(d, c, msg);
Rule_001(d, c, msg); Rule_001(d, c, msg);
Rule_002(d, c, msg); Rule_002(d, c, msg);
@ -244,6 +241,16 @@ Check_Chunk(const struct disk *d, const struct chunk *c, char *msg)
Check_Chunk(d, c->part, msg); Check_Chunk(d, c->part, msg);
if (c->next) if (c->next)
Check_Chunk(d, c->next, msg); Check_Chunk(d, c->next, msg);
break;
case p_pc98:
Rule_000(d, c, msg);
Rule_001(d, c, msg);
Rule_004(d, c, msg);
if (c->part)
Check_Chunk(d, c->part, msg);
if (c->next)
Check_Chunk(d, c->next, msg);
break;
} }
} }