Index: sys/arch/x68k/dev/fd.c =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/dev/fd.c,v retrieving revision 1.101 diff -u -p -r1.101 fd.c --- sys/arch/x68k/dev/fd.c 15 May 2012 12:17:33 -0000 1.101 +++ sys/arch/x68k/dev/fd.c 14 Oct 2012 01:49:12 -0000 @@ -87,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.101 #include #include #include +#include #include #include @@ -112,6 +113,9 @@ int fddebug = 0; #define FDUNIT(dev) (minor(dev) / 8) #define FDTYPE(dev) (minor(dev) % 8) +/* (mis)use device use flag to identify format operation */ +#define B_FORMAT B_DEVPRIVATE + enum fdc_state { DEVIDLE = 0, MOTORWAIT, @@ -184,19 +188,29 @@ struct fd_type { int size; /* size of disk in sectors */ int step; /* steps per cylinder */ int rate; /* transfer speed code */ + uint8_t fillbyte; /* format fill byte */ + uint8_t interleave; /* interleave factor (formatting) */ const char *name; }; /* The order of entries in the following table is important -- BEWARE! */ struct fd_type fd_types[] = { - { 8,2,16,3,0xff,0xdf,0x35,0x74,77,1232,1,FDC_500KBPS, "1.2MB/[1024bytes/sector]" }, /* 1.2 MB japanese format */ - { 18,2,36,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS,"1.44MB" }, /* 1.44MB diskette */ - { 15,2,30,2,0xff,0xdf,0x1b,0x54,80,2400,1,FDC_500KBPS, "1.2MB" }, /* 1.2 MB AT-diskettes */ - { 9,2,18,2,0xff,0xdf,0x23,0x50,40, 720,2,FDC_300KBPS, "360KB/AT" }, /* 360kB in 1.2MB drive */ - { 9,2,18,2,0xff,0xdf,0x2a,0x50,40, 720,1,FDC_250KBPS, "360KB/PC" }, /* 360kB PC diskettes */ - { 9,2,18,2,0xff,0xdf,0x2a,0x50,80,1440,1,FDC_250KBPS, "720KB" }, /* 3.5" 720kB diskette */ - { 9,2,18,2,0xff,0xdf,0x23,0x50,80,1440,1,FDC_300KBPS, "720KB/x" }, /* 720kB in 1.2MB drive */ - { 9,2,18,2,0xff,0xdf,0x2a,0x50,40, 720,2,FDC_250KBPS, "360KB/x" }, /* 360kB in 720kB drive */ + { 8,2,16,3,0xff,0xdf,0x35,0x74,77,1232,1,FDC_500KBPS, 0xf6, 1, + "1.2MB/[1024bytes/sector]" }, /* 1.2 MB japanese format */ + { 18,2,36,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS, 0xf6, 1, + "1.44MB" }, /* 1.44MB diskette */ + { 15,2,30,2,0xff,0xdf,0x1b,0x54,80,2400,1,FDC_500KBPS, 0xf6, 1, + "1.2MB" }, /* 1.2 MB AT-diskettes */ + { 9,2,18,2,0xff,0xdf,0x23,0x50,40, 720,2,FDC_300KBPS, 0xf6, 1, + "360KB/AT" }, /* 360kB in 1.2MB drive */ + { 9,2,18,2,0xff,0xdf,0x2a,0x50,40, 720,1,FDC_250KBPS, 0xf6, 1, + "360KB/PC" }, /* 360kB PC diskettes */ + { 9,2,18,2,0xff,0xdf,0x2a,0x50,80,1440,1,FDC_250KBPS, 0xf6, 1, + "720KB" }, /* 3.5" 720kB diskette */ + { 9,2,18,2,0xff,0xdf,0x23,0x50,80,1440,1,FDC_300KBPS, 0xf6, 1, + "720KB/x" }, /* 720kB in 1.2MB drive */ + { 9,2,18,2,0xff,0xdf,0x2a,0x50,40, 720,2,FDC_250KBPS, 0xf6, 1, + "360KB/x" }, /* 360kB in 720kB drive */ }; /* software state, per disk (with up to 4 disks per ctlr) */ @@ -283,6 +297,7 @@ void fdcpseudointr(void *); void fdcretry(struct fdc_softc *); void fdfinish(struct fd_softc *, struct buf *); inline struct fd_type *fd_dev_to_type(struct fd_softc *, dev_t); +int fdformat(dev_t, struct ne7_fd_formb *, struct lwp *); static int fdcpoll(struct fdc_softc *); static int fdgetdisklabel(struct fd_softc *, dev_t); static void fd_do_eject(struct fdc_softc *, int); @@ -291,6 +306,7 @@ void fd_mountroot_hook(device_t); /* DMA transfer routines */ inline static void fdc_dmastart(struct fdc_softc *, int, void *, vsize_t); +inline static void fdc_dmaabort(struct fdc_softc *); static int fdcdmaintr(void *); static int fdcdmaerrintr(void *); @@ -333,6 +349,14 @@ fdc_dmastart(struct fdc_softc *fdc, int dmac_start_xfer(fdc->sc_dmachan->ch_softc, fdc->sc_xfer); } +inline static void +fdc_dmaabort(struct fdc_softc *fdc) +{ + + dmac_abort_xfer(fdc->sc_dmachan->ch_softc, fdc->sc_xfer); + bus_dmamap_unload(fdc->sc_dmat, fdc->sc_dmamap); +} + static int fdcdmaintr(void *arg) { @@ -516,6 +540,11 @@ fdprobe(device_t parent, cfdata_t cf, vo type = &fd_types[0]; /* XXX 1.2MB */ + /* toss any interrupt status */ + for (n = 0; n < 4; n++) { + out_fdc(iot, ioh, NE7CMD_SENSEI); + (void)fdcresult(fdc); + } intio_disable_intr(SICILIAN_INTR_FDC); /* select drive and turn on motor */ @@ -645,7 +674,8 @@ fdstrategy(struct buf *bp) } if (bp->b_blkno < 0 || - (bp->b_bcount % FDC_BSIZE) != 0) { + ((bp->b_bcount % FDC_BSIZE) != 0 && + (bp->b_flags & B_FORMAT) == 0)) { DPRINTF(("fdstrategy: unit=%d, blkno=%" PRId64 ", " "bcount=%d\n", unit, bp->b_blkno, bp->b_bcount)); @@ -929,6 +959,9 @@ fdclose(dev_t dev, int flags, int mode, break; } + /* clear flags */ + fd->sc_opts &= ~(FDOPT_NORETRY | FDOPT_SILENT); + if ((fd->sc_flags & FD_OPEN) == 0) { bus_space_write_1(fdc->sc_iot, fdc->sc_ioh, fdout, (1 << unit)); @@ -1045,6 +1078,7 @@ fdcintr(void *arg) int read, head, sec, pos, i, sectrac, nblks; int tmp; struct fd_type *type; + struct ne7_fd_formb *finfo = NULL; loop: fd = TAILQ_FIRST(&fdc->sc_drives); @@ -1074,6 +1108,9 @@ fdcintr(void *arg) goto loop; } + if (bp->b_flags & B_FORMAT) + finfo = (struct ne7_fd_formb *)bp->b_data; + switch (fdc->sc_state) { case DEVIDLE: DPRINTF(("fdcintr: in DEVIDLE\n")); @@ -1140,10 +1177,13 @@ fdcintr(void *arg) doio: DPRINTF(("fdcintr: DOIO: ")); type = fd->sc_type; + if (finfo) + fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) - + (char *)finfo; sectrac = type->sectrac; pos = fd->sc_blkno % (sectrac * (1 << (type->secsize - 2))); sec = pos / (1 << (type->secsize - 2)); - if (type->secsize == 2) { + if (finfo || type->secsize == 2) { fd->sc_part = SEC_P11; nblks = (sectrac - sec) << (type->secsize - 2); nblks = min(nblks, fd->sc_bcount / FDC_BSIZE); @@ -1175,7 +1215,7 @@ fdcintr(void *arg) nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE); DPRINTF((" %d\n", nblks)); fd->sc_nblks = nblks; - fd->sc_nbytes = nblks * FDC_BSIZE; + fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE; head = (fd->sc_blkno % (type->seccyl * (1 << (type->secsize - 2)))) / (type->sectrac * (1 << (type->secsize - 2))); @@ -1206,23 +1246,37 @@ fdcintr(void *arg) DPRINTF(("C H R N: %d %d %d %d\n", fd->sc_cylin, head, sec, type->secsize)); - if (fd->sc_part != SEC_P11) + if (!finfo && fd->sc_part != SEC_P11) goto docopy; fdc_dmastart(fdc, read, (char *)bp->b_data + fd->sc_skip, fd->sc_nbytes); - if (read) - out_fdc(iot, ioh, NE7CMD_READ); /* READ */ - else - out_fdc(iot, ioh, NE7CMD_WRITE); /* WRITE */ - out_fdc(iot, ioh, (head << 2) | fd->sc_drive); - out_fdc(iot, ioh, bp->b_cylinder); /* cylinder */ - out_fdc(iot, ioh, head); - out_fdc(iot, ioh, sec + 1); /* sector +1 */ - out_fdc(iot, ioh, type->secsize); /* sector size */ - out_fdc(iot, ioh, type->sectrac); /* sectors/track */ - out_fdc(iot, ioh, type->gap1); /* gap1 size */ - out_fdc(iot, ioh, type->datalen); /* data length */ + if (finfo) { + /* formatting */ + if (out_fdc(iot, ioh, NE7CMD_FORMAT) < 0) { + fdc->sc_errors = 4; + fdcretry(fdc); + goto loop; + } + out_fdc(iot, ioh, (head << 2) | fd->sc_drive); + out_fdc(iot, ioh, finfo->fd_formb_secshift); + out_fdc(iot, ioh, finfo->fd_formb_nsecs); + out_fdc(iot, ioh, finfo->fd_formb_gaplen); + out_fdc(iot, ioh, finfo->fd_formb_fillbyte); + } else { + if (read) + out_fdc(iot, ioh, NE7CMD_READ); /* READ */ + else + out_fdc(iot, ioh, NE7CMD_WRITE); /* WRITE */ + out_fdc(iot, ioh, (head << 2) | fd->sc_drive); + out_fdc(iot, ioh, bp->b_cylinder); /* cylinder */ + out_fdc(iot, ioh, head); + out_fdc(iot, ioh, sec + 1); /* sector +1 */ + out_fdc(iot, ioh, type->secsize); /* sector size */ + out_fdc(iot, ioh, type->sectrac); /* sectors/track */ + out_fdc(iot, ioh, type->gap1); /* gap1 size */ + out_fdc(iot, ioh, type->datalen); /* data length */ + } fdc->sc_state = IOCOMPLETE; disk_busy(&fd->sc_dk); @@ -1343,6 +1397,8 @@ fdcintr(void *arg) case IOTIMEDOUT: #if 0 isa_dmaabort(fdc->sc_drq); +#else + fdc_dmaabort(fdc); #endif case SEEKTIMEDOUT: case RECALTIMEDOUT: @@ -1356,6 +1412,8 @@ fdcintr(void *arg) if ((tmp = fdcresult(fdc)) != 7 || (st0 & 0xf8) != 0) { #if 0 isa_dmaabort(fdc->sc_drq); +#else + fdc_dmaabort(fdc); #endif fdcstatus(fd->sc_dev, tmp, bp->b_flags & B_READ ? "read failed" : "write failed"); @@ -1379,7 +1437,7 @@ fdcintr(void *arg) fd->sc_skip += fd->sc_nbytes; fd->sc_bcount -= fd->sc_nbytes; DPRINTF(("fd->sc_bcount = %d\n", fd->sc_bcount)); - if (fd->sc_bcount > 0) { + if (!finfo && fd->sc_bcount > 0) { bp->b_cylinder = fd->sc_blkno / (fd->sc_type->seccyl * (1 << (fd->sc_type->secsize - 2))); @@ -1395,6 +1453,8 @@ fdcintr(void *arg) printf("fdcintr: resnum=%d, st0=%x\n", tmp, st0); #if 0 isa_dmaabort(fdc->sc_drq); +#else + fdc_dmaabort(fdc); #endif fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ? "read failed" : "write failed"); @@ -1501,6 +1561,9 @@ fdcretry(struct fdc_softc *fdc) fd = TAILQ_FIRST(&fdc->sc_drives); bp = bufq_peek(fd->sc_q); + if (fd->sc_opts & FDOPT_NORETRY) + goto fail; + switch (fdc->sc_errors) { case 0: /* try again */ @@ -1520,9 +1583,12 @@ fdcretry(struct fdc_softc *fdc) break; default: - diskerr(bp, "fd", "hard error", LOG_PRINTF, - fd->sc_skip, (struct disklabel *)NULL); - fdcpstatus(7, fdc); + fail: + if ((fd->sc_opts & FDOPT_SILENT) == 0) { + diskerr(bp, "fd", "hard error", LOG_PRINTF, + fd->sc_skip, (struct disklabel *)NULL); + fdcpstatus(7, fdc); + } bp->b_error = EIO; fdfinish(fd, bp); @@ -1535,9 +1601,15 @@ fdioctl(dev_t dev, u_long cmd, void *add { struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev)); struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev)); + struct fdformat_parms *form_parms; + struct fdformat_cmd *form_cmd; + struct ne7_fd_formb *fd_formb; int part = DISKPART(dev); struct disklabel buffer; int error; + unsigned int scratch; + int il[FD_MAX_NSEC + 1]; + int i, j; DPRINTF(("fdioctl:")); switch (cmd) { @@ -1587,6 +1659,134 @@ fdioctl(dev_t dev, u_long cmd, void *add error = writedisklabel(dev, fdstrategy, &buffer, NULL); return error; + case FDIOCGETFORMAT: + DPRINTF(("FDIOCGETFORMAT\n")); + form_parms = (struct fdformat_parms *)addr; + form_parms->fdformat_version = FDFORMAT_VERSION; + form_parms->nbps = 128 * (1 << fd->sc_type->secsize); + form_parms->ncyl = fd->sc_type->cyls; + form_parms->nspt = fd->sc_type->sectrac; + form_parms->ntrk = fd->sc_type->heads; + form_parms->stepspercyl = fd->sc_type->step; + form_parms->gaplen = fd->sc_type->gap2; + form_parms->fillbyte = fd->sc_type->fillbyte; + form_parms->interleave = fd->sc_type->interleave; + switch (fd->sc_type->rate) { + case FDC_500KBPS: + form_parms->xfer_rate = 500 * 1024; + break; + case FDC_300KBPS: + form_parms->xfer_rate = 300 * 1024; + break; + case FDC_250KBPS: + form_parms->xfer_rate = 250 * 1024; + break; + default: + return EINVAL; + } + return 0; + + case FDIOCSETFORMAT: + DPRINTF(("FDIOCSETFORMAT\n")); + if((flag & FWRITE) == 0) + return EBADF; /* must be opened for writing */ + form_parms = (struct fdformat_parms *)addr; + if (form_parms->fdformat_version != FDFORMAT_VERSION) + return EINVAL; /* wrong version of formatting prog */ + + scratch = form_parms->nbps >> 7; + if ((form_parms->nbps & 0x7f) || ffs(scratch) == 0 || + scratch & ~(1 << (ffs(scratch) - 1))) + /* not a power-of-two multiple of 128 */ + return EINVAL; + + switch (form_parms->xfer_rate) { + case 500 * 1024: + fd->sc_type->rate = FDC_500KBPS; + break; + case 300 * 1024: + fd->sc_type->rate = FDC_300KBPS; + break; + case 250 * 1024: + fd->sc_type->rate = FDC_250KBPS; + break; + default: + return EINVAL; + } + + if (form_parms->nspt > FD_MAX_NSEC || + form_parms->fillbyte > 0xff || + form_parms->interleave > 0xff) + return EINVAL; + fd->sc_type->sectrac = form_parms->nspt; + if (form_parms->ntrk != 2 && form_parms->ntrk != 1) + return EINVAL; + fd->sc_type->heads = form_parms->ntrk; + fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk; + fd->sc_type->secsize = ffs(scratch)-1; + fd->sc_type->gap2 = form_parms->gaplen; + fd->sc_type->cyls = form_parms->ncyl; + fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl * + form_parms->nbps / DEV_BSIZE; + fd->sc_type->step = form_parms->stepspercyl; + fd->sc_type->fillbyte = form_parms->fillbyte; + fd->sc_type->interleave = form_parms->interleave; + return 0; + + case FDIOCFORMAT_TRACK: + DPRINTF(("FDIOCFORMAT_TRACK\n")); + if ((flag & FWRITE) == 0) + return EBADF; /* must be opened for writing */ + form_cmd = (struct fdformat_cmd *)addr; + if (form_cmd->formatcmd_version != FDFORMAT_VERSION) + return EINVAL; /* wrong version of formatting prog */ + + if (form_cmd->head >= fd->sc_type->heads || + form_cmd->cylinder >= fd->sc_type->cyls) { + return EINVAL; + } + + fd_formb = malloc(sizeof(struct ne7_fd_formb), + M_TEMP, M_NOWAIT); + if (fd_formb == NULL) + return ENOMEM; + + fd_formb->head = form_cmd->head; + fd_formb->cyl = form_cmd->cylinder; + fd_formb->transfer_rate = fd->sc_type->rate; + fd_formb->fd_formb_secshift = fd->sc_type->secsize; + fd_formb->fd_formb_nsecs = fd->sc_type->sectrac; + fd_formb->fd_formb_gaplen = fd->sc_type->gap2; + fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte; + + memset(il, 0, sizeof il); + for (j = 0, i = 1; i <= fd_formb->fd_formb_nsecs; i++) { + while (il[(j % fd_formb->fd_formb_nsecs) + 1]) + j++; + il[(j % fd_formb->fd_formb_nsecs)+ 1] = i; + j += fd->sc_type->interleave; + } + for (i = 0; i < fd_formb->fd_formb_nsecs; i++) { + fd_formb->fd_formb_cylno(i) = form_cmd->cylinder; + fd_formb->fd_formb_headno(i) = form_cmd->head; + fd_formb->fd_formb_secno(i) = il[i + 1]; + fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize; + } + + error = fdformat(dev, fd_formb, l); + free(fd_formb, M_TEMP); + return error; + + case FDIOCGETOPTS: /* get drive options */ + DPRINTF(("FDIOCGETOPTS\n")); + *(int *)addr = fd->sc_opts; + return 0; + + case FDIOCSETOPTS: /* set drive options */ + DPRINTF(("FDIOCSETOPTS\n")); + fd->sc_opts = *(int *)addr; + return 0; + case DIOCLOCK: /* * Nothing to do here, really. @@ -1621,6 +1821,48 @@ fdioctl(dev_t dev, u_long cmd, void *add #endif } +int +fdformat(dev_t dev, struct ne7_fd_formb *finfo, struct lwp *l) +{ + int rv = 0; + struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev)); + struct fd_type *type = fd->sc_type; + struct buf *bp; + + /* set up a buffer header for fdstrategy() */ + bp = getiobuf(NULL, false); + if (bp == NULL) + return ENOBUFS; + + bp->b_cflags = BC_BUSY; + bp->b_flags = B_PHYS | B_FORMAT; + bp->b_proc = l->l_proc; + bp->b_dev = dev; + + /* + * calculate a fake blkno, so fdstrategy() would initiate a + * seek to the requested cylinder + */ + bp->b_blkno = (finfo->cyl * (type->sectrac * type->heads) + + finfo->head * type->sectrac) * (128 << type->secsize) / DEV_BSIZE; + + bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; + bp->b_data = (void *)finfo; + +#ifdef FD_DEBUG + printf("fdformat: blkno %" PRIx64 " count %x\n", + bp->b_blkno, bp->b_bcount); +#endif + + /* now do the format */ + fdstrategy(bp); + + /* ...and wait for it to complete */ + rv = biowait(bp); + putiobuf(bp); + return rv; +} + void fd_do_eject(struct fdc_softc *fdc, int unit) { Index: sys/arch/x68k/dev/fdreg.h =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/dev/fdreg.h,v retrieving revision 1.5 diff -u -p -r1.5 fdreg.h --- sys/arch/x68k/dev/fdreg.h 15 May 2012 12:17:33 -0000 1.5 +++ sys/arch/x68k/dev/fdreg.h 14 Oct 2012 01:49:12 -0000 @@ -60,3 +60,52 @@ #define FDC_INTR 96 /* interrupt vector */ #define FDC_DMA 0 /* DMA ch# */ #define FDC_DMAINTR 100 /* DMA interrupt vector */ + +/* + * fdformat parameters + */ + +#define FD_MAX_NSEC 18 /* highest known number of spt */ + +struct ne7_fd_formb { + int cyl, head; + int transfer_rate; /* fdreg.h: FDC_???KBPS */ + + union { + struct fd_form_data { + /* + * DO NOT CHANGE THE LAYOUT OF THIS STRUCTS + * it is hardware-dependent since it exactly + * matches the byte sequence to write to FDC + * during its `format track' operation + */ + uint8_t secshift; /* 0 -> 128, ...; usually 2 -> 512 */ + uint8_t nsecs; /* must be <= FD_MAX_NSEC */ + uint8_t gaplen; /* GAP 3 length; usually 84 */ + uint8_t fillbyte; /* usually 0xf6 */ + struct fd_idfield_data { + /* + * data to write into id fields; + * for obscure formats, they mustn't match + * the real values (but mostly do) + */ + uint8_t cylno; /* 0 thru 79 (or 39) */ + uint8_t headno; /* 0, or 1 */ + uint8_t secno; /* starting at 1! */ + uint8_t secsize; /* usually 2 */ + } idfields[FD_MAX_NSEC]; /* 0 <= idx < nsecs used */ + } structured; + uint8_t raw[1]; /* to have continuous indexed access */ + } format_info; +}; + +/* make life easier */ +# define fd_formb_secshift format_info.structured.secshift +# define fd_formb_nsecs format_info.structured.nsecs +# define fd_formb_gaplen format_info.structured.gaplen +# define fd_formb_fillbyte format_info.structured.fillbyte +/* these data must be filled in for(i = 0; i < fd_formb_nsecs; i++) */ +# define fd_formb_cylno(i) format_info.structured.idfields[i].cylno +# define fd_formb_headno(i) format_info.structured.idfields[i].headno +# define fd_formb_secno(i) format_info.structured.idfields[i].secno +# define fd_formb_secsize(i) format_info.structured.idfields[i].secsize Index: sys/arch/x68k/dev/intio_dmac.c =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/dev/intio_dmac.c,v retrieving revision 1.33 diff -u -p -r1.33 intio_dmac.c --- sys/arch/x68k/dev/intio_dmac.c 6 Jun 2010 04:50:08 -0000 1.33 +++ sys/arch/x68k/dev/intio_dmac.c 14 Oct 2012 01:49:12 -0000 @@ -552,7 +552,7 @@ dmac_abort_xfer(struct dmac_softc *dmac, struct dmac_channel_stat *chan = xf->dx_channel; bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CCR, - DMAC_CCR_INT | DMAC_CCR_HLT); + DMAC_CCR_INT | DMAC_CCR_SAB); bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR, 0xff); xf->dx_nextoff = xf->dx_nextsize = -1; Index: sys/arch/x68k/stand/installboot/installboot.c =================================================================== RCS file: /cvsroot/src/sys/arch/x68k/stand/installboot/installboot.c,v retrieving revision 1.5 diff -u -p -r1.5 installboot.c --- sys/arch/x68k/stand/installboot/installboot.c 23 Sep 2006 20:10:14 -0000 1.5 +++ sys/arch/x68k/stand/installboot/installboot.c 14 Oct 2012 01:49:12 -0000 @@ -159,7 +159,8 @@ checkparttype(const char *name, int forc lp = (struct disklabel *) &bootblock[LABELBYTEOFFSET]; memcpy(&label, lp, sizeof(struct disklabel)); - if (dkcksum(lp) != 0) + if (lp->d_npartitions > MAXPARTITIONS || + dkcksum(lp) != 0) /* there is no valid label */ memset(&label, 0, sizeof(struct disklabel)); } Index: usr.bin/fdformat/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/fdformat/Makefile,v retrieving revision 1.13 diff -u -p -r1.13 Makefile --- usr.bin/fdformat/Makefile 30 Mar 2010 07:26:23 -0000 1.13 +++ usr.bin/fdformat/Makefile 14 Oct 2012 01:49:37 -0000 @@ -9,6 +9,7 @@ ${MACHINE_CPU} == "powerpc" || \ ${MACHINE_ARCH} == "sparc" || \ ${MACHINE_ARCH} == "sparc64" || \ + ${MACHINE} == "x68k") || \ ${MACHINE_ARCH} == "x86_64") PROG= fdformat .endif Index: distrib/sets/lists/base/md.x68k =================================================================== RCS file: /cvsroot/src/distrib/sets/lists/base/md.x68k,v retrieving revision 1.45 diff -u -p -r1.45 md.x68k --- distrib/sets/lists/base/md.x68k 12 Oct 2012 20:16:30 -0000 1.45 +++ distrib/sets/lists/base/md.x68k 14 Oct 2012 01:49:37 -0000 @@ -2,6 +2,7 @@ ./dev/pow0 base-obsolete obsolete ./dev/pow1 base-obsolete obsolete ./usr/bin/bellctrl base-util-bin +./usr/bin/fdformat base-util-bin ./usr/bin/loadfont base-util-bin ./usr/bin/loadkmap base-util-bin ./usr/bin/palette base-util-bin