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;
case p_pc98:
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;
case p_sparc64:
case p_alpha:
@ -286,7 +298,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
if (platform == p_sparc64) {
offset = Prev_Cyl_Aligned(d, offset);
size = Next_Cyl_Aligned(d, size);
} else if (platform == p_i386) {
} else if (platform == p_i386 || platform == p_pc98) {
if (type != freebsd)
break;
if (!(flags & CHUNK_ALIGN))

View File

@ -266,7 +266,10 @@ Debug_Disk(struct disk *d)
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);
#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",
d->boot1, d->boot2, d->bootmgr);
#elif defined(__alpha__)
@ -361,8 +364,14 @@ Disk_Names()
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
Set_Boot_Mgr(struct disk *d, const u_char *b, const size_t s)
#endif
{
#if !defined(__ia64__)
#ifdef PC98
@ -440,12 +449,35 @@ Set_Boot_Blocks(struct disk *d, const u_char *b1, const u_char *b2)
return 0;
}
#ifdef PC98
const char *
slice_type_name( int type, int subtype )
{
switch (type) {
case 0: return "whole";
case 1: switch (subtype) {
case 0:
return "whole";
case 2:
return "fat";
case 3:
switch (subtype) {
case 0xc494: return "freebsd";
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";
@ -478,14 +510,21 @@ slice_type_name( int type, int subtype )
case 239: return "EFI Sys. Part.";
default: return "unknown";
}
case 2: return "fat";
case 3: switch (subtype) {
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";
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
Rule_002(const struct disk *d, const struct chunk *c, char *msg)
{
#ifndef PC98
int i;
struct chunk *c1;
@ -171,7 +170,6 @@ Rule_002(const struct disk *d, const struct chunk *c, char *msg)
sprintf(msg + strlen(msg),
"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
Rule_003(const struct disk *d, const struct chunk *c, char *msg)
{
#ifndef PC98
int i;
struct chunk *c1;
@ -196,7 +193,6 @@ Rule_003(const struct disk *d, const struct chunk *c, char *msg)
sprintf(msg + strlen(msg),
"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)
{
if (platform == p_i386) {
switch (platform) {
case p_i386:
Rule_000(d, c, msg);
Rule_001(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);
if (c->next)
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;
}
}