Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/amiga Support for a ... somewhat strange meth...
details: https://anonhg.NetBSD.org/src/rev/1801d76cd588
branches: trunk
changeset: 473358:1801d76cd588
user: is <is%NetBSD.org@localhost>
date: Sun May 30 21:21:36 1999 +0000
description:
Support for a ... somewhat strange method of doing >512 byte/block
ADOSFS partitions. By Matthias Scheler via PR 2559. A diagnostic
check was updated by myself.
diffstat:
sys/arch/amiga/amiga/disksubr.c | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)
diffs (61 lines):
diff -r 72e569eee022 -r 1801d76cd588 sys/arch/amiga/amiga/disksubr.c
--- a/sys/arch/amiga/amiga/disksubr.c Sun May 30 21:13:04 1999 +0000
+++ b/sys/arch/amiga/amiga/disksubr.c Sun May 30 21:21:36 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.29 1999/04/28 22:35:27 is Exp $ */
+/* $NetBSD: disksubr.c,v 1.30 1999/05/30 21:21:36 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -313,7 +313,8 @@
lp->d_npartitions = (pp - lp->d_partitions) + 1;
#ifdef DIAGNOSTIC
- if (lp->d_secpercyl != (pbp->e.secpertrk * pbp->e.numheads)) {
+ if (lp->d_secpercyl * lp->d_secsize !=
+ (pbp->e.secpertrk * pbp->e.numheads * pbp->e.sizeblock<<2)) {
if (pbp->partname[0] < sizeof(pbp->partname))
pbp->partname[pbp->partname[0] + 1] = 0;
else
@@ -360,19 +361,35 @@
}
pp->p_size = (pbp->e.highcyl - pbp->e.lowcyl + 1)
- * pbp->e.secpertrk * pbp->e.numheads;
+ * pbp->e.secpertrk * pbp->e.numheads
+ * (pbp->e.sizeblock >> 7);
pp->p_offset = pbp->e.lowcyl * pbp->e.secpertrk
- * pbp->e.numheads;
+ * pbp->e.numheads
+ * (pbp->e.sizeblock >> 7);
pp->p_fstype = adt.fstype;
if (adt.archtype == ADT_AMIGADOS) {
/*
* Save reserved blocks at begin in cpg and
* adjust size by reserved blocks at end
*/
- pp->p_fsize = 512;
- pp->p_frag = pbp->e.secperblk;
- pp->p_cpg = pbp->e.resvblocks;
- pp->p_size -= pbp->e.prefac;
+ int bsize,secperblk;
+
+ bsize = pbp->e.sizeblock << 2;
+ secperblk = pbp->e.secperblk;
+ while (bsize > 512) {
+ bsize >>= 1;
+ secperblk <<= 1;
+ }
+ if (bsize == 512) {
+ pp->p_fsize = bsize;
+ pp->p_frag = secperblk;
+ pp->p_cpg = pbp->e.resvblocks;
+ pp->p_size -= pbp->e.prefac
+ * (pbp->e.sizeblock >> 7);
+ } else {
+ adt.archtype = ADT_UNKNOWN;
+ adt.fstype = FS_UNUSED;
+ }
} else if (pbp->e.tabsize > 22 && ISFSARCH_NETBSD(adt)) {
pp->p_fsize = pbp->e.fsize;
pp->p_frag = pbp->e.frag;
Home |
Main Index |
Thread Index |
Old Index