Index: arch/i386/i386/machdep.c =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/i386/machdep.c,v retrieving revision 1.1.1.40 retrieving revision 1.102 diff -c -r1.1.1.40 -r1.102 *** machdep.c 1996/05/19 20:54:45 1.1.1.40 --- machdep.c 1996/09/08 02:40:16 1.102 *************** *** 556,561 **** --- 579,585 ---- frame.sf_code = code; frame.sf_scp = &fp->sf_sc; frame.sf_handler = catcher; + frame.sf_sc.sc_cr2 = rcr2(); /* cast? */ /* * Build the signal context to be used by sigreturn. *************** *** 566,576 **** frame.sf_sc.sc_mask = mask; #ifdef VM86 if (tf->tf_eflags & PSL_VM) { frame.sf_sc.sc_gs = tf->tf_vm86_gs; frame.sf_sc.sc_fs = tf->tf_vm86_fs; frame.sf_sc.sc_es = tf->tf_vm86_es; frame.sf_sc.sc_ds = tf->tf_vm86_ds; ! frame.sf_sc.sc_eflags = get_vflags(p); } else #endif { --- 590,607 ---- frame.sf_sc.sc_mask = mask; #ifdef VM86 if (tf->tf_eflags & PSL_VM) { + struct pcb *pcb = &p->p_addr->u_pcb; frame.sf_sc.sc_gs = tf->tf_vm86_gs; frame.sf_sc.sc_fs = tf->tf_vm86_fs; frame.sf_sc.sc_es = tf->tf_vm86_es; frame.sf_sc.sc_ds = tf->tf_vm86_ds; ! if (pcb->vm86_biosseg) { ! frame.sf_sc.sc_eflags = tf->tf_eflags; ! SETFLAGS(frame.sf_sc.sc_eflags, pcb->vm86_eflags, ! pcb->vm86_flagmask|PSL_VIF); ! frame.sf_sc.sc_eflags &= ~PSL_VIP; /* XXX? */ ! } else ! frame.sf_sc.sc_eflags = get_vflags(p); } else #endif { *************** *** 653,663 **** */ #ifdef VM86 if (context.sc_eflags & PSL_VM) { tf->tf_vm86_gs = context.sc_gs; tf->tf_vm86_fs = context.sc_fs; tf->tf_vm86_es = context.sc_es; tf->tf_vm86_ds = context.sc_ds; ! set_vflags(p, context.sc_eflags); } else #endif { --- 684,702 ---- */ #ifdef VM86 if (context.sc_eflags & PSL_VM) { + struct pcb *pcb = &p->p_addr->u_pcb; + tf->tf_vm86_gs = context.sc_gs; tf->tf_vm86_fs = context.sc_fs; tf->tf_vm86_es = context.sc_es; tf->tf_vm86_ds = context.sc_ds; ! if (pcb->vm86_biosseg) { ! SETFLAGS(pcb->vm86_eflags, context.sc_eflags, ! pcb->vm86_flagmask|PSL_VIF); ! SETFLAGS(tf->tf_eflags, context.sc_eflags, ! ~PSL_USERSTATIC); ! } else ! set_vflags(p, context.sc_eflags); } else #endif { Index: arch/i386/i386/vm86.c =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/i386/vm86.c,v retrieving revision 1.1.1.7 retrieving revision 1.3 diff -c -r1.1.1.7 -r1.3 *** vm86.c 1996/05/08 23:31:04 1.1.1.7 --- vm86.c 1996/07/23 13:20:17 1.3 *************** *** 169,174 **** --- 169,175 ---- int intrno; { struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; /* * handle certain interrupts directly by pushing the interrupt * frame and resetting registers, but only if user said that's ok *************** *** 190,196 **** * If user requested special handling, return to user space with * indication of which INT was requested. */ ! if (is_bitset(intrno, &u_vm86p->int_byuser[0])) goto vector; /* --- 191,198 ---- * If user requested special handling, return to user space with * indication of which INT was requested. */ ! if ((pcb->vm86_biosseg && CS(tf) == pcb->vm86_biosseg) || ! is_bitset(intrno, &u_vm86p->int_byuser[0])) goto vector; /* *************** *** 208,213 **** --- 210,218 ---- if (copyin((caddr_t)(intrno * sizeof(ihand)), &ihand, sizeof(ihand))) goto bad; + if (pcb->vm86_biosseg && ihand.cs == pcb->vm86_biosseg) + goto vector; + /* * Otherwise, push flags, cs, eip, and jump to handler to * simulate direct INT call. *************** *** 223,228 **** --- 228,238 ---- IP(tf) = ihand.ip; CS(tf) = ihand.cs; + if (pcb->vm86_biosseg) { + /* disable further "hardware" interrupts, turn off any tracing. */ + pcb->vm86_eflags &= ~PSL_VIF; + tf->tf_eflags &= ~(PSL_VIF|PSL_T); + } return; vector: *************** *** 278,283 **** --- 288,294 ---- int type; { struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; /* * we want to fetch some stuff from the current user virtual * address space for checking. remember that the frame's *************** *** 442,448 **** /* Going into vm86 mode jumps off the signal stack. */ p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; ! set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM); return (EJUSTRETURN); } --- 453,489 ---- /* Going into vm86 mode jumps off the signal stack. */ p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; ! /* Linux only puts into VEFLAGS what the user sends in for eflags, ! * and only modifies it with PSL_VIF and the flagmask. ! * Linux doesn't leak the other bits from VEFLAGS. ! * It leaves PSL_ID, PSL_AC, PSL_NT, PSL_RF as found in tf->tf_eflags. ! * ! * NetBSD puts PSL_USERSTATIC into VEFLAGS and the user-safe bits ! * into tf->tf_eflags. Some of the user-safe bits overlap what linux ! * puts in VEFLAGS and may cause emulation problems. ! * (PSL_ID, PSL_AC, PSL_NT) ! * ! */ ! ! if (vm86s.dosemu_bios_seg) { ! pcb->vm86_biosseg = vm86s.dosemu_bios_seg; ! #if 1 ! SETFLAGS(pcb->vm86_eflags, vm86s.regs.vmsc.sc_eflags, ! (pcb->vm86_flagmask ^ (PSL_ID|PSL_AC|PSL_NT|PSL_IOPL))|PSL_VIF); ! SETFLAGS(tf->tf_eflags, vm86s.regs.vmsc.sc_eflags | PSL_VM, ! VM86_REALFLAGS); ! #endif ! #if 0 ! if (vm86s.regs.vmsc.sc_eflags & PSL_VIF) ! set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_I|PSL_VM|PSL_VIF); ! else ! set_vflags(p, (vm86s.regs.vmsc.sc_eflags & ~(PSL_I|PSL_VIF)) | PSL_VM); ! set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM); ! #endif ! } else { ! pcb->vm86_biosseg = 0; ! set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM); ! } return (EJUSTRETURN); } Index: arch/i386/include/pcb.h =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/include/pcb.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** pcb.h 1996/03/29 02:06:30 1.1.1.1 --- pcb.h 1996/07/14 20:41:57 1.2 *************** *** 77,82 **** --- 77,83 ---- caddr_t pcb_onfault; /* copyin/out fault recovery */ int vm86_eflags; /* virtual eflags for vm86 mode */ int vm86_flagmask; /* flag mask for vm86 mode */ + int vm86_biosseg; /* BIOS segment for special handling */ void *vm86_userp; /* XXX performance hack */ u_long pcb_iomap[NIOPORTS/32]; /* I/O bitmap */ }; Index: arch/i386/include/signal.h =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/include/signal.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** signal.h 1996/03/29 04:01:21 1.1.1.1 --- signal.h 1996/03/07 05:23:02 1.2 *************** *** 77,82 **** --- 77,83 ---- int sc_trapno; /* XXX should be above */ int sc_err; + int sc_cr2; }; #define sc_sp sc_esp Index: arch/i386/include/vm86.h =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/include/vm86.h,v retrieving revision 1.1.1.6 retrieving revision 1.3 diff -c -r1.1.1.6 -r1.3 *** vm86.h 1996/05/08 23:31:22 1.1.1.6 --- vm86.h 1996/07/15 03:49:55 1.3 *************** *** 58,63 **** --- 58,64 ---- struct vm86_kern { /* kernel uses this stuff */ struct vm86_regs regs; unsigned long ss_cpu_type; + int dosemu_bios_seg; /* XXX hack */ }; #define cpu_type substr.ss_cpu_type *************** *** 109,121 **** { struct pcb *pcb = &p->p_addr->u_pcb; #ifndef VM86_USE_VIF ! pcb->vm86_eflags |= PSL_I; ! if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) #else ! pcb->vm86_eflags |= PSL_VIF; ! if ((pcb->vm86_eflags & (PSL_VIF|PSL_VIP)) == (PSL_VIF|PSL_VIP)) #endif vm86_return(p, VM86_STI); } --- 110,124 ---- { struct pcb *pcb = &p->p_addr->u_pcb; + if (pcb->vm86_biosseg) + pcb->vm86_eflags |= PSL_VIF; + else #ifndef VM86_USE_VIF ! pcb->vm86_eflags |= PSL_I; #else ! pcb->vm86_eflags |= PSL_VIF; #endif + if (pcb->vm86_eflags & PSL_VIP) vm86_return(p, VM86_STI); } *************** *** 130,135 **** --- 133,140 ---- flags &= ~pcb->vm86_flagmask; SETFLAGS(pcb->vm86_eflags, flags, VM86_VIRTFLAGS); SETFLAGS(tf->tf_eflags, flags, VM86_REALFLAGS); + if ((flags & PSL_I) && pcb->vm86_biosseg) + pcb->vm86_eflags |= PSL_VIF; #ifndef VM86_USE_VIF if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) #else *************** *** 148,153 **** --- 153,164 ---- SETFLAGS(flags, pcb->vm86_eflags, VM86_VIRTFLAGS); SETFLAGS(flags, tf->tf_eflags, VM86_REALFLAGS); + if (pcb->vm86_biosseg) { + if (flags & PSL_VIF) + flags |= PSL_I; + else + flags &= ~PSL_I; + } return (flags); } *************** *** 162,167 **** --- 173,180 ---- flags &= ~pcb->vm86_flagmask; SETFLAGS(pcb->vm86_eflags, flags, VM86_VIRTFLAGS & 0xffff); SETFLAGS(tf->tf_eflags, flags, VM86_REALFLAGS & 0xffff); + if ((flags & PSL_I) && pcb->vm86_biosseg) + pcb->vm86_eflags |= PSL_VIF; #ifndef VM86_USE_VIF if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) vm86_return(p, VM86_STI); *************** *** 178,183 **** --- 191,202 ---- SETFLAGS(flags, pcb->vm86_eflags, VM86_VIRTFLAGS & 0xffff); SETFLAGS(flags, tf->tf_eflags, VM86_REALFLAGS & 0xffff); + if (pcb->vm86_biosseg) { + if (pcb->vm86_eflags & PSL_VIF) + flags |= PSL_I; + else + flags &= ~PSL_I; + } return (flags); } #else Index: arch/i386/isa/fd.c =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/isa/fd.c,v retrieving revision 1.1.1.6 retrieving revision 1.22 diff -c -r1.1.1.6 -r1.22 *** fd.c 1996/09/02 16:20:41 1.1.1.6 --- fd.c 1996/09/02 17:06:28 1.22 *************** *** 9,14 **** --- 9,20 ---- * This code is derived from software contributed to Berkeley by * Don Ahn. * + * Portions Copyright (c) 1993, 1994 by + * jc@irbs.UUCP (John Capo) + * vak@zebub.msk.su (Serge Vakulenko) + * ache@astral.msk.su (Andrew A. Chernov) + * joerg_wunsch@uriah.sax.de (Joerg Wunsch) + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: *************** *** 50,55 **** --- 56,62 ---- #include #include #include + #include #include #include #include *************** *** 59,64 **** --- 66,73 ---- #include #include + #include + #include #include #include *************** *** 69,74 **** --- 78,86 ---- #define FDUNIT(dev) (minor(dev) / 8) #define FDTYPE(dev) (minor(dev) % 8) + /* XXX misuse a flag to identify format operation */ + #define B_FORMAT B_XXX + #define b_cylin b_resid enum fdc_state { *************** *** 124,149 **** NULL, "fdc", DV_DULL }; ! /* ! * Floppies come in various flavors, e.g., 1.2MB vs 1.44MB; here is how ! * we tell them apart. ! */ ! struct fd_type { ! int sectrac; /* sectors per track */ ! int heads; /* number of heads */ ! int seccyl; /* sectors per cylinder */ ! int secsize; /* size code for sectors */ ! int datalen; /* data len when secsize = 0 */ ! int steprate; /* step rate and head unload time */ ! int gap1; /* gap len between sectors */ ! int gap2; /* formatting gap */ ! int tracks; /* total num of tracks */ ! int size; /* size of disk in sectors */ ! int step; /* steps per cylinder */ ! int rate; /* transfer speed code */ ! char *name; ! }; ! /* The order of entries in the following table is important -- BEWARE! */ struct fd_type fd_types[] = { { 18,2,36,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS,"1.44MB" }, /* 1.44MB diskette */ --- 136,142 ---- NULL, "fdc", DV_DULL }; ! /* fd_type struct now in ioctl_fd.h */ /* The order of entries in the following table is important -- BEWARE! */ struct fd_type fd_types[] = { { 18,2,36,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS,"1.44MB" }, /* 1.44MB diskette */ *************** *** 165,170 **** --- 158,164 ---- daddr_t sc_blkno; /* starting block number */ int sc_bcount; /* byte count left */ + int sc_opts; /* user-set options */ int sc_skip; /* bytes already transferred */ int sc_nblks; /* number of blocks currently tranferring */ int sc_nbytes; /* number of bytes currently tranferring */ *************** *** 216,221 **** --- 210,216 ---- void fdcretry __P((struct fdc_softc *fdc)); void fdfinish __P((struct fd_softc *fd, struct buf *bp)); __inline struct fd_type *fd_dev_to_type __P((struct fd_softc *, dev_t)); + int fdformat __P((dev_t, struct fd_formb *, struct proc *)); int fdcprobe(parent, match, aux) *************** *** 518,524 **** /* Valid unit, controller, and request? */ if (bp->b_blkno < 0 || ! (bp->b_bcount % FDC_BSIZE) != 0) { bp->b_error = EINVAL; goto bad; } --- 513,520 ---- /* Valid unit, controller, and request? */ if (bp->b_blkno < 0 || ! ((bp->b_bcount % FDC_BSIZE) != 0 && ! (bp->b_flags & B_FORMAT) == 0)) { bp->b_error = EINVAL; goto bad; } *************** *** 780,785 **** --- 776,782 ---- struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; fd->sc_flags &= ~FD_OPEN; + fd->sc_opts &= ~FDOPT_NORETRY; return 0; } *************** *** 848,853 **** --- 845,853 ---- int s; s = splbio(); + #ifdef DEBUG + log(LOG_ERR,"fdctimeout: state %d\n", fdc->sc_state); + #endif fdcstatus(&fd->sc_dev, 0, "timeout"); if (fd->sc_q.b_actf) *************** *** 884,889 **** --- 884,890 ---- bus_io_handle_t ioh = fdc->sc_ioh; int read, head, sec, i, nblks; struct fd_type *type; + struct fd_formb *finfo = NULL; loop: /* Is there a drive for the controller to do a transfer with? */ *************** *** 902,907 **** --- 903,911 ---- goto loop; } + if (bp->b_flags & B_FORMAT) + finfo = (struct fd_formb *)bp->b_data; + switch (fdc->sc_state) { case DEVIDLE: fdc->sc_errors = 0; *************** *** 956,967 **** case DOIO: doio: type = fd->sc_type; sec = fd->sc_blkno % type->seccyl; nblks = type->seccyl - sec; nblks = min(nblks, fd->sc_bcount / FDC_BSIZE); nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE); fd->sc_nblks = nblks; ! fd->sc_nbytes = nblks * FDC_BSIZE; head = sec / type->sectrac; sec -= head * type->sectrac; #ifdef DIAGNOSTIC --- 960,974 ---- case DOIO: doio: type = fd->sc_type; + if (finfo) + fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) - + (char *)finfo; sec = fd->sc_blkno % type->seccyl; nblks = type->seccyl - sec; nblks = min(nblks, fd->sc_bcount / FDC_BSIZE); nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE); fd->sc_nblks = nblks; ! fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE; head = sec / type->sectrac; sec -= head * type->sectrac; #ifdef DIAGNOSTIC *************** *** 988,993 **** --- 995,1013 ---- read ? "read" : "write", fd->sc_drive, fd->sc_cylin, head, sec, nblks); #endif + if (finfo) { + /* formatting */ + if (out_fdc(bc, ioh, NE7CMD_FORMAT) < 0) { + fdc->sc_errors = 4; + fdcretry(fdc); + goto loop; + } + out_fdc(bc, ioh, (head << 2) | fd->sc_drive); + out_fdc(bc, ioh, finfo->fd_formb_secshift); + out_fdc(bc, ioh, finfo->fd_formb_nsecs); + out_fdc(bc, ioh, finfo->fd_formb_gaplen); + out_fdc(bc, ioh, finfo->fd_formb_fillbyte); + } else { if (read) out_fdc(bc, ioh, NE7CMD_READ); /* READ */ else *************** *** 1000,1005 **** --- 1020,1026 ---- out_fdc(bc, ioh, type->sectrac); /* sectors/track */ out_fdc(bc, ioh, type->gap1); /* gap1 size */ out_fdc(bc, ioh, type->datalen); /* data length */ + } fdc->sc_state = IOCOMPLETE; disk_busy(&fd->sc_dk); *************** *** 1079,1085 **** fd->sc_blkno += fd->sc_nblks; fd->sc_skip += fd->sc_nbytes; fd->sc_bcount -= fd->sc_nbytes; ! if (fd->sc_bcount > 0) { bp->b_cylin = fd->sc_blkno / fd->sc_type->seccyl; goto doseek; } --- 1100,1106 ---- fd->sc_blkno += fd->sc_nblks; fd->sc_skip += fd->sc_nbytes; fd->sc_bcount -= fd->sc_nbytes; ! if (!finfo && fd->sc_bcount > 0) { bp->b_cylin = fd->sc_blkno / fd->sc_type->seccyl; goto doseek; } *************** *** 1156,1161 **** --- 1177,1184 ---- fd = fdc->sc_drives.tqh_first; bp = fd->sc_q.b_actf; + if (fd->sc_opts & FDOPT_NORETRY) + goto fail; switch (fdc->sc_errors) { case 0: /* try again */ *************** *** 1173,1178 **** --- 1196,1202 ---- break; default: + fail: diskerr(bp, "fd", "hard error", LOG_PRINTF, fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL); printf(" (st0 %b st1 %b st2 %b cyl %d head %d sec %d)\n", *************** *** 1252,1257 **** --- 1276,1303 ---- error = writedisklabel(dev, fdstrategy, &buffer, NULL); return error; + case FD_FORM: + if((flag & FWRITE) == 0) + return EBADF; /* must be opened for writing */ + else if(((struct fd_formb *)addr)->format_version != + FD_FORMAT_VERSION) + return EINVAL; /* wrong version of formatting prog */ + else + return fdformat(dev, (struct fd_formb *)addr, p); + break; + + case FD_GTYPE: /* get drive type */ + *(struct fd_type *)addr = *fd->sc_type; + return 0; + + case FD_GOPTS: /* get drive options */ + *(int *)addr = fd->sc_opts; + return 0; + + case FD_SOPTS: /* set drive options */ + fd->sc_opts = *(int *)addr; + return 0; + default: return ENOTTY; } *************** *** 1259,1262 **** --- 1305,1368 ---- #ifdef DIAGNOSTIC panic("fdioctl: impossible"); #endif + } + + int + fdformat(dev, finfo, p) + dev_t dev; + struct fd_formb *finfo; + struct proc *p; + { + int rv = 0, s; + struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; + struct fd_type *type = fd->sc_type; + struct buf *bp; + + /* set up a buffer header for fdstrategy() */ + bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT); + if(bp == 0) + return ENOBUFS; + bzero((void *)bp, sizeof(struct buf)); + bp->b_flags = B_BUSY | B_PHYS | B_FORMAT; + bp->b_proc = p; + 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) * FDC_BSIZE / DEV_BSIZE; + + bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; + bp->b_data = (caddr_t)finfo; + + #ifdef DEBUG + printf("fdformat: blkno %x count %x\n", bp->b_blkno, bp->b_bcount); + #endif + + /* now do the format */ + fdstrategy(bp); + + /* ...and wait for it to complete */ + s = splbio(); + while(!(bp->b_flags & B_DONE)) + { + rv = tsleep((caddr_t)bp, PRIBIO, "fdform", 0); + if(rv == EWOULDBLOCK) + /*break*/; + } + splx(s); + + if(rv == EWOULDBLOCK) { + /* timed out */ + rv = EIO; + /* XXX what to do to the buf? it will eventually fall + out as finished, but ... ?*/ + /*biodone(bp);*/ + } + if(bp->b_flags & B_ERROR) + rv = bp->b_error; + free(bp, M_TEMP); + return rv; } Index: arch/i386/isa/pcvt/pcvt_kbd.c =================================================================== RCS file: /u3/cvsroot/src/sys/arch/i386/isa/pcvt/pcvt_kbd.c,v retrieving revision 1.1.1.3 retrieving revision 1.5 diff -c -r1.1.1.3 -r1.5 *** pcvt_kbd.c 1996/05/15 00:16:16 1.1.1.3 --- pcvt_kbd.c 1996/07/14 01:14:49 1.5 *************** *** 365,371 **** cmd |= COMMAND_PCSCAN; /* yes, setup command */ kbc_8042cmd(CONTR_WRITE); ! kbc_cmd(cmd); #endif /* PCVT_SCANSET > 1 */ --- 365,371 ---- cmd |= COMMAND_PCSCAN; /* yes, setup command */ kbc_8042cmd(CONTR_WRITE); ! kbd_cmd(cmd); #endif /* PCVT_SCANSET > 1 */ *************** *** 1026,1031 **** --- 1026,1037 ---- if (vsp->kbd_state == K_RAW) { keybuf[0] = dt; + #ifdef KOLVIR + if (dt == 0x54) { /* SysRq -> no more raw */ + printf("SysRq: no more raw kbd\n"); + vsp->kbd_state = K_XLATE; + } + #endif #if PCVT_EMU_MOUSE /* Index: sys/arch/i386/include/ioctl_fd.h *** /dev/null Wed Oct 9 19:55:04 1996 --- ioctl_fd.h Wed Jun 28 23:49:32 1995 *************** *** 0 **** --- 1,128 ---- + /* $Id: ioctl_fd.h,v 1.4 1995/06/29 03:49:32 jtk Exp $ */ + + /* + * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * From: Id: ioctl_fd.h,v 1.7 1994/10/30 19:17:39 joerg Exp + */ + + #ifndef _I386_IOCTL_FD_H_ + #define _I386_IOCTL_FD_H_ + + #define FD_FORMAT_VERSION 110 /* used to validate before formatting */ + #define FD_MAX_NSEC 36 /* highest known number of spt - allow for */ + /* 2.88 MB drives */ + + struct fd_formb { + int format_version; /* == FD_FORMAT_VERSION */ + 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-dependant since it exactly + * matches the byte sequence to write to FDC + * during its `format track' operation + */ + u_char secshift; /* 0 -> 128, ...; usually 2 -> 512 */ + u_char nsecs; /* must be <= FD_MAX_NSEC */ + u_char gaplen; /* GAP 3 length; usually 84 */ + u_char 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) + */ + u_char cylno; /* 0 thru 79 (or 39) */ + u_char headno; /* 0, or 1 */ + u_char secno; /* starting at 1! */ + u_char secsize; /* usually 2 */ + } idfields[FD_MAX_NSEC]; /* 0 <= idx < nsecs used */ + } structured; + u_char 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 + + /* + * Floppies come in various flavors, e.g., 1.2MB vs 1.44MB; here is how + * we tell them apart. + */ + struct fd_type { + int sectrac; /* sectors per track */ + int heads; /* number of heads */ + int seccyl; /* sectors per cylinder */ + int secsize; /* size code for sectors */ + int datalen; /* data len when secsize = 0 */ + int steprate; /* step rate and head unload time */ + int gap1; /* gap len between sectors */ + int gap2; /* formatting gap */ + int tracks; /* total num of tracks */ + int size; /* size of disk in sectors */ + int step; /* steps per cylinder */ + int rate; /* transfer speed code */ + char *name; + }; + + + #define FD_FORM _IOW('F', 61, struct fd_formb) /* format a track */ + #define FD_GTYPE _IOR('F', 62, struct fd_type) /* get drive type */ + #define FD_STYPE _IOW('F', 63, struct fd_type) /* set drive type */ + + #define FD_GOPTS _IOR('F', 64, int) /* drive options, see below */ + #define FD_SOPTS _IOW('F', 65, int) + + #define FDOPT_NORETRY 0x0001 /* no retries on failure (cleared on close) */ + + /* + * The following definitions duplicate those in sys/i386/isa/fdreg.h + * They are here since their values are to be used in the above + * structure when formatting a floppy. For very obvious reasons, both + * definitions must match ;-) + */ + #ifndef FDC_500KBPS + #define FDC_500KBPS 0x00 /* 500KBPS MFM drive transfer rate */ + #define FDC_300KBPS 0x01 /* 300KBPS MFM drive transfer rate */ + #define FDC_250KBPS 0x02 /* 250KBPS MFM drive transfer rate */ + #define FDC_125KBPS 0x03 /* 125KBPS FM drive transfer rate */ + /* for some controllers 1MPBS instead */ + #endif /* FDC_500KBPS */ + + + #endif /* !_I386_IOCTL_FD_H__ */ Index: sys/arch/i386/conf/PATTERN *** /dev/null Wed Oct 9 19:55:04 1996 --- PATTERN Sun Oct 6 20:52:17 1996 *************** *** 0 **** --- 1,136 ---- + # $NetBSD: GENERIC,v 1.6 1994/11/04 07:36:45 mycroft Exp $ + # + # GENERIC -- everything that's currently supported + # + + machine i386 # architecture, used by config; REQUIRED + + options KOLVIR # used to be ident, but hey... + options PATTERN # used to be ident, but hey... + options INSECURE + options I586_CPU + options PCIVERBOSE + + #options DUMMY_NOPS # speed hack; recommended + options XSERVER,UCONSOLE + options MACHINE_NONCONTIG + + #options COMCONSOLE=1 + + maxusers 32 # estimated number of users + options TIMEZONE=0 # time zone to adjust RTC time by + options DST=0 # daylight savings time used by RTC + + options SWAPPAGER # paging; REQUIRED + options VNODEPAGER # mmap() of files + options DEVPAGER # mmap() of devices + + options DDB # in-kernel debugger + options DIAGNOSTIC # internally consistency checks + options AUDIO_DEBUG # audio subsystem debug code + options KTRACE # system call tracing, a la ktrace(1) + + options SYSVMSG # System V-like message queues + options SYSVSEM # System V-like semaphores + options SYSVSHM # System V-like memory sharing + #options SHMMAXPGS=1024 # 1024 pages is the default + + options COMPAT_NOMID # compatibility with 386BSD, BSDI, NetBSD 0.8, + #options COMPAT_09 # NetBSD 0.9, + #options COMPAT_10 # NetBSD 1.0, + options COMPAT_11 # NetBSD 1.1, + options COMPAT_12 # NetBSD 1.2, + options COMPAT_43 # and 4.3BSD + #options TCP_COMPAT_42 # TCP bug compatibility with 4.2BSD + + options COMPAT_SVR4 # binary compatibility with SVR4 + options COMPAT_IBCS2 # binary compatibility with SCO and ISC + options COMPAT_LINUX # and Linux :) + + options EXEC_SCRIPT # #! scripts + options EXEC_AOUT # a.out executables (native, BSD/OS, Linux, FreeBSD) + options EXEC_ELF32 # 32-bit ELF executables (SVR4, Linux) + + options VM86 # VM86 mode enabled + options USER_LDT # user-settable LDT; used by WINE + options LKM # loadable kernel modules + + options FFS # UFS (no quotas) + #options LFS # log-structured file system + options MFS # memory file system + + options NFSCLIENT # Network File System client + options NFSSERVER # Network File System server + options HAS_VOPLEASE # XXX + + #options SCSI_DELAY = 4 # 10 seconds--extra time? + #options SCSIDEBUG + #options DEBUGTARGET=2 + options CDDA # CD DA frames over SCSI + options CD9660 # ISO 9660 + Rock Ridge file system + options MSDOSFS # MS-DOS file system + #options FDESC # /dev/fd + options FIFO # FIFOs; RECOMMENDED + #options KERNFS # /kern + options NULLFS # loopback file system + #options PORTAL # ? + options PROCFS # /proc + #options UMAPFS # NULLFS + uid and gid remapping + options UNION # union file system + options PCVT_CTRL_ALT_DEL + options COLOR_KERNEL_FG=FG_GREEN + options COLOR_KERNEL_BG=BG_BLACK + + #options GATEWAY # packet forwarding + options INET # IP + ICMP + TCP + UDP + options APM_NO_POWEROFF + + config netbsd swap generic + options GENERIC + + mainbus0 at root + isa0 at mainbus0 + pci0 at mainbus0 bus 0 + + apm0 at mainbus0 + + npx0 at isa? port 0xf0 irq 13 # math coprocessor + + vt0 at isa? port 0x60 irq 1 + + com0 at isa? port 0x3f8 irq 4 # standard PC serial ports + com1 at isa? port 0x2f8 irq 3 + ast0 at isa? port 0x2a0 irq 2 # AST 4-port serial cards + com* at ast? slave ? flags 1 + + lpt0 at isa? port 0x378 irq 7 # standard PC parallel ports + + ncr* at pci? dev ? function ? # NCR 538XX SCSI controllers + scsibus* at ncr? + sd* at scsibus? target ? lun ? # SCSI disk drives + st* at scsibus? target ? lun ? # SCSI tape drives + cd* at scsibus? target ? lun ? # SCSI CD-ROM drives + #ch* at scsibus? target ? lun ? # SCSI autochangers + + fdc0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy controllers + fd0 at fdc0 drive 0 + + #wdc0 at isa? port 0x1f0 irq 14 # ST506, ESDI, and IDE controllers + #wd* at wdc? drive ? + + de0 at pci? dev ? function ? # DECchip 21040/21140 (tulip) ethernet + + gus0 at isa? port 0x220 irq 11 drq 6 flags 7 # GUS: flags is record drq + #gus0 at isa? port 0x220 irq 11 drq 1 flags 3 + + pms0 at pckbd? irq 12 # PS/2 auxiliary port + spkr0 at pckbd? port 0x61 + + pseudo-device loop 1 # network loopback + pseudo-device bpfilter 8 # packet filter + pseudo-device sl 2 # CSLIP + pseudo-device ppp 2 # PPP + pseudo-device tun 2 # network tunneling over tty + + pseudo-device pty 64 # pseudo-terminals + pseudo-device vnd 4 # paging to files