aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshihiro Takahashi <nyan@FreeBSD.org>2017-01-28 02:22:15 +0000
committerYoshihiro Takahashi <nyan@FreeBSD.org>2017-01-28 02:22:15 +0000
commit2b375b4edd1b98884c3031d6ccd61acb10bd895d (patch)
treef35e4f57ad890ac86d5cb5d3ef760344a41fc0e6
parent34bac11eba2841255bf6319ec78728f0f941c6ac (diff)
downloadsrc-2b375b4edd1b98884c3031d6ccd61acb10bd895d.tar.gz
src-2b375b4edd1b98884c3031d6ccd61acb10bd895d.zip
Remove pc98 support completely.
I thank all developers and contributors for pc98. Relnotes: yes
Notes
Notes: svn path=/head/; revision=312910
-rw-r--r--Makefile5
-rw-r--r--Makefile.inc11
-rw-r--r--ObsoleteFiles.inc11
-rw-r--r--etc/etc.pc98/ttys49
-rwxr-xr-xetc/rc.d/syscons1
-rw-r--r--lib/libsysdecode/Makefile2
-rw-r--r--lib/libsysdecode/mkioctls10
-rw-r--r--libexec/Makefile.pc984
-rw-r--r--release/doc/README2
-rw-r--r--release/doc/en_US.ISO8859-1/hardware/article.xml215
-rw-r--r--release/doc/en_US.ISO8859-1/readme/article.xml3
-rw-r--r--release/doc/share/examples/Makefile.relnotesng2
-rw-r--r--release/doc/share/misc/dev.archlist.txt102
-rw-r--r--release/doc/share/xml/release.ent1
-rw-r--r--release/pc98/mkisoimages.sh45
-rwxr-xr-xrelease/rc.local6
-rw-r--r--rescue/rescue/Makefile4
-rw-r--r--sbin/Makefile.pc985
-rw-r--r--sbin/bsdlabel/bsdlabel.84
-rw-r--r--sbin/bsdlabel/bsdlabel.c3
-rw-r--r--sbin/fdisk_pc98/Makefile13
-rw-r--r--sbin/fdisk_pc98/Makefile.depend17
-rw-r--r--sbin/fdisk_pc98/fdisk.8486
-rw-r--r--sbin/fdisk_pc98/fdisk.c910
-rw-r--r--sbin/geom/class/part/gpart.811
-rw-r--r--share/examples/bootforth/frames.4th63
-rw-r--r--share/man/man4/adv.46
-rw-r--r--share/man/man4/ahc.48
-rw-r--r--share/man/man4/apic.42
-rw-r--r--share/man/man4/ed.449
-rw-r--r--share/man/man4/esp.42
-rw-r--r--share/man/man4/fxp.46
-rw-r--r--share/man/man4/geom.42
-rw-r--r--share/man/man4/man4.i386/Makefile2
-rw-r--r--share/man/man4/man4.i386/aic.44
-rw-r--r--share/man/man4/man4.i386/ct.4162
-rw-r--r--share/man/man4/man4.i386/snc.4142
-rw-r--r--share/man/man4/ncr.49
-rw-r--r--share/man/man4/ncv.42
-rw-r--r--share/man/man4/sym.44
-rw-r--r--share/mk/bsd.stand.mk3
-rw-r--r--share/mk/local.meta.sys.mk3
-rw-r--r--share/syscons/keymaps/INDEX.keymaps14
-rw-r--r--share/syscons/keymaps/Makefile2
-rw-r--r--share/syscons/keymaps/jp.pc98.iso.kbd134
-rw-r--r--share/syscons/keymaps/jp.pc98.kbd134
-rw-r--r--share/vt/keymaps/INDEX.keymaps14
-rw-r--r--share/vt/keymaps/Makefile2
-rw-r--r--share/vt/keymaps/jp.pc98.iso.kbd134
-rw-r--r--share/vt/keymaps/jp.pc98.kbd134
-rw-r--r--sys/Makefile2
-rw-r--r--sys/boot/Makefile.pc983
-rw-r--r--sys/boot/common/Makefile.inc2
-rw-r--r--sys/boot/common/isapnp.h6
-rw-r--r--sys/boot/ficl/loader.c4
-rw-r--r--sys/boot/forth/frames.4th63
-rw-r--r--sys/boot/pc98/Makefile5
-rw-r--r--sys/boot/pc98/Makefile.inc29
-rw-r--r--sys/boot/pc98/boot0.5/Makefile26
-rw-r--r--sys/boot/pc98/boot0.5/boot.s174
-rw-r--r--sys/boot/pc98/boot0.5/boot0.5.s293
-rw-r--r--sys/boot/pc98/boot0.5/disk.s296
-rw-r--r--sys/boot/pc98/boot0.5/ldscript12
-rw-r--r--sys/boot/pc98/boot0.5/putssjis.s137
-rw-r--r--sys/boot/pc98/boot0.5/selector.s450
-rw-r--r--sys/boot/pc98/boot0.5/start.s73
-rw-r--r--sys/boot/pc98/boot0.5/support.s94
-rw-r--r--sys/boot/pc98/boot0.5/syscons.s253
-rw-r--r--sys/boot/pc98/boot0/Makefile19
-rw-r--r--sys/boot/pc98/boot0/boot0.s108
-rw-r--r--sys/boot/pc98/boot2/Makefile116
-rw-r--r--sys/boot/pc98/boot2/boot1.S395
-rw-r--r--sys/boot/pc98/boot2/boot2.c803
-rw-r--r--sys/boot/pc98/btx/Makefile5
-rw-r--r--sys/boot/pc98/btx/Makefile.inc3
-rw-r--r--sys/boot/pc98/btx/btx/Makefile33
-rw-r--r--sys/boot/pc98/btx/btx/btx.S1104
-rw-r--r--sys/boot/pc98/btx/btxldr/Makefile21
-rw-r--r--sys/boot/pc98/btx/btxldr/btxldr.S430
-rw-r--r--sys/boot/pc98/btx/lib/Makefile10
-rw-r--r--sys/boot/pc98/btx/lib/btxcsu.S49
-rw-r--r--sys/boot/pc98/btx/lib/btxsys.s40
-rw-r--r--sys/boot/pc98/btx/lib/btxv86.h67
-rw-r--r--sys/boot/pc98/btx/lib/btxv86.s85
-rw-r--r--sys/boot/pc98/cdboot/Makefile18
-rw-r--r--sys/boot/pc98/cdboot/cdboot.S805
-rw-r--r--sys/boot/pc98/kgzldr/Makefile20
-rw-r--r--sys/boot/pc98/kgzldr/crt.s89
-rw-r--r--sys/boot/pc98/libpc98/Makefile51
-rw-r--r--sys/boot/pc98/libpc98/bioscd.c420
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c1120
-rw-r--r--sys/boot/pc98/libpc98/biosmem.c64
-rw-r--r--sys/boot/pc98/libpc98/biossmap.c38
-rw-r--r--sys/boot/pc98/libpc98/comconsole.c367
-rw-r--r--sys/boot/pc98/libpc98/libpc98.h29
-rw-r--r--sys/boot/pc98/libpc98/pc98_sys.c78
-rw-r--r--sys/boot/pc98/libpc98/time.c98
-rw-r--r--sys/boot/pc98/libpc98/vidconsole.c596
-rw-r--r--sys/boot/pc98/loader/Makefile99
-rw-r--r--sys/boot/pc98/loader/conf.c116
-rw-r--r--sys/boot/pc98/loader/help.pc9838
-rw-r--r--sys/boot/pc98/loader/main.c322
-rw-r--r--sys/boot/pc98/pc98boot/Makefile25
-rw-r--r--sys/cam/cam_xpt.c9
-rw-r--r--sys/conf/Makefile.pc9852
-rw-r--r--sys/conf/NOTES7
-rw-r--r--sys/conf/config.mk1
-rw-r--r--sys/conf/files4
-rw-r--r--sys/conf/files.amd642
-rw-r--r--sys/conf/files.i3862
-rw-r--r--sys/conf/files.pc98279
-rw-r--r--sys/conf/options2
-rw-r--r--sys/conf/options.pc98104
-rw-r--r--sys/crypto/aesni/aesni.h2
-rw-r--r--sys/crypto/via/padlock.c4
-rw-r--r--sys/crypto/via/padlock_hash.c2
-rw-r--r--sys/dev/aic/aic_cbus.c265
-rw-r--r--sys/dev/ata/ata-all.h6
-rw-r--r--sys/dev/ata/ata-cbus.c349
-rw-r--r--sys/dev/ct/bshw_machdep.c743
-rw-r--r--sys/dev/ct/bshwvar.h96
-rw-r--r--sys/dev/ct/ct.c1242
-rw-r--r--sys/dev/ct/ct_isa.c382
-rw-r--r--sys/dev/ct/ct_machdep.h186
-rw-r--r--sys/dev/ct/ctvar.h129
-rw-r--r--sys/dev/ed/if_ed98.h108
-rw-r--r--sys/dev/ed/if_ed_cbus.c1629
-rw-r--r--sys/dev/ep/if_ep_isa.c12
-rw-r--r--sys/dev/exca/excareg.h17
-rw-r--r--sys/dev/fb/fb.c2
-rw-r--r--sys/dev/fb/splash_bmp.c42
-rw-r--r--sys/dev/fdc/fdc.c240
-rw-r--r--sys/dev/fdc/fdc_cbus.c184
-rw-r--r--sys/dev/fdc/fdcvar.h2
-rw-r--r--sys/dev/fe/if_fe.c9
-rw-r--r--sys/dev/fe/if_fe_cbus.c1020
-rw-r--r--sys/dev/fe/if_fereg.h8
-rw-r--r--sys/dev/ic/i8251.h111
-rw-r--r--sys/dev/ic/wd33c93reg.h165
-rw-r--r--sys/dev/kbd/kbd.c12
-rw-r--r--sys/dev/le/am79900.c4
-rw-r--r--sys/dev/le/if_le_cbus.c443
-rw-r--r--sys/dev/mse/mse_cbus.c301
-rw-r--r--sys/dev/mse/msevar.h3
-rw-r--r--sys/dev/pccbb/pccbb_isa.c2
-rw-r--r--sys/dev/pci/vga_pci.c2
-rw-r--r--sys/dev/ppc/ppc.c50
-rw-r--r--sys/dev/ppc/ppcreg.h8
-rw-r--r--sys/dev/sio/sio_pccard.c3
-rw-r--r--sys/dev/sio/sio_pci.c4
-rw-r--r--sys/dev/sio/sio_puc.c4
-rw-r--r--sys/dev/sio/siovar.h30
-rw-r--r--sys/dev/snc/dp83932.c1198
-rw-r--r--sys/dev/snc/dp83932reg.h271
-rw-r--r--sys/dev/snc/dp83932subr.c839
-rw-r--r--sys/dev/snc/dp83932subr.h78
-rw-r--r--sys/dev/snc/dp83932var.h286
-rw-r--r--sys/dev/snc/if_snc.c255
-rw-r--r--sys/dev/snc/if_snc_cbus.c211
-rw-r--r--sys/dev/snc/if_snc_pccard.c164
-rw-r--r--sys/dev/snc/if_sncreg.h140
-rw-r--r--sys/dev/snc/if_sncvar.h47
-rw-r--r--sys/dev/sound/isa/mss.c25
-rw-r--r--sys/dev/sound/isa/mss.h8
-rw-r--r--sys/dev/sound/isa/sbc.c60
-rw-r--r--sys/dev/syscons/daemon/daemon_saver.c10
-rw-r--r--sys/dev/syscons/dragon/dragon_saver.c19
-rw-r--r--sys/dev/syscons/fire/fire_saver.c4
-rw-r--r--sys/dev/syscons/logo/logo_saver.c4
-rw-r--r--sys/dev/syscons/plasma/plasma_saver.c2
-rw-r--r--sys/dev/syscons/rain/rain_saver.c4
-rw-r--r--sys/dev/syscons/scmouse.c2
-rw-r--r--sys/dev/syscons/scvidctl.c26
-rw-r--r--sys/dev/syscons/star/star_saver.c15
-rw-r--r--sys/dev/syscons/syscons.c16
-rw-r--r--sys/dev/syscons/syscons.h8
-rw-r--r--sys/dev/syscons/warp/warp_saver.c4
-rw-r--r--sys/dev/uart/uart.h4
-rw-r--r--sys/dev/uart/uart_bus_isa.c21
-rw-r--r--sys/dev/uart/uart_cpu_pc98.c132
-rw-r--r--sys/geom/geom_bsd.c10
-rw-r--r--sys/geom/geom_pc98.c372
-rw-r--r--sys/geom/geom_pc98_enc.c78
-rw-r--r--sys/geom/part/g_part_pc98.c617
-rw-r--r--sys/i386/bios/apm.c135
-rw-r--r--sys/i386/bios/apm.h5
-rw-r--r--sys/i386/i386/genassym.c7
-rw-r--r--sys/i386/i386/initcpu.c106
-rw-r--r--sys/i386/i386/locore.s43
-rw-r--r--sys/i386/i386/machdep.c291
-rw-r--r--sys/i386/i386/mp_machdep.c10
-rw-r--r--sys/i386/i386/mpboot.s2
-rw-r--r--sys/i386/i386/vm_machdep.c17
-rw-r--r--sys/i386/isa/elink.h4
-rw-r--r--sys/i386/isa/npx.c2
-rw-r--r--sys/i386/pci/pci_pir.c5
-rw-r--r--sys/isa/isareg.h4
-rw-r--r--sys/isa/isavar.h13
-rw-r--r--sys/isa/pnp.c37
-rw-r--r--sys/isa/pnpreg.h5
-rw-r--r--sys/modules/Makefile11
-rw-r--r--sys/modules/Makefile.inc4
-rw-r--r--sys/modules/aic/Makefile8
-rw-r--r--sys/modules/apm/Makefile6
-rw-r--r--sys/modules/ata/Makefile4
-rw-r--r--sys/modules/canbepm/Makefile8
-rw-r--r--sys/modules/canbus/Makefile8
-rw-r--r--sys/modules/ct/Makefile10
-rw-r--r--sys/modules/drm2/Makefile12
-rw-r--r--sys/modules/ed/Makefile4
-rw-r--r--sys/modules/fdc/Makefile4
-rw-r--r--sys/modules/fe/Makefile8
-rw-r--r--sys/modules/geom/geom_part/Makefile1
-rw-r--r--sys/modules/geom/geom_part/geom_part_pc98/Makefile10
-rw-r--r--sys/modules/geom/geom_pc98/Makefile8
-rw-r--r--sys/modules/i2c/controllers/Makefile4
-rw-r--r--sys/modules/le/Makefile6
-rw-r--r--sys/modules/mse/Makefile8
-rw-r--r--sys/modules/pmc/Makefile9
-rw-r--r--sys/modules/ppc/Makefile9
-rw-r--r--sys/modules/sio/Makefile16
-rw-r--r--sys/modules/snc/Makefile9
-rw-r--r--sys/modules/sound/sound/Makefile3
-rw-r--r--sys/pc98/apm/apm_bioscall.S87
-rw-r--r--sys/pc98/cbus/30line.h130
-rw-r--r--sys/pc98/cbus/cbus.h63
-rw-r--r--sys/pc98/cbus/cbus_dma.c534
-rw-r--r--sys/pc98/cbus/cbus_dmareg.h44
-rw-r--r--sys/pc98/cbus/gdc.c1487
-rw-r--r--sys/pc98/cbus/nmi.c69
-rw-r--r--sys/pc98/cbus/olpt.c648
-rw-r--r--sys/pc98/cbus/olptreg.h48
-rw-r--r--sys/pc98/cbus/pckbd.c999
-rw-r--r--sys/pc98/cbus/pckbdtables.h203
-rw-r--r--sys/pc98/cbus/pcrtc.c249
-rw-r--r--sys/pc98/cbus/pmc.c244
-rw-r--r--sys/pc98/cbus/sc_machdep.h52
-rw-r--r--sys/pc98/cbus/scgdcrndr.c208
-rw-r--r--sys/pc98/cbus/scterm-sck.c1229
-rw-r--r--sys/pc98/cbus/sctermvar.h432
-rw-r--r--sys/pc98/cbus/scvtb.c399
-rw-r--r--sys/pc98/cbus/sio.c4387
-rw-r--r--sys/pc98/cbus/sio_cbus.c119
-rw-r--r--sys/pc98/cbus/syscons_cbus.c202
-rw-r--r--sys/pc98/conf/DEFAULTS31
-rw-r--r--sys/pc98/conf/GENERIC262
-rw-r--r--sys/pc98/conf/GENERIC-NODEBUG38
-rw-r--r--sys/pc98/conf/GENERIC.hints294
-rw-r--r--sys/pc98/conf/Makefile5
-rw-r--r--sys/pc98/conf/NOTES628
-rw-r--r--sys/pc98/include/_align.h6
-rw-r--r--sys/pc98/include/_bus.h43
-rw-r--r--sys/pc98/include/_inttypes.h6
-rw-r--r--sys/pc98/include/_limits.h6
-rw-r--r--sys/pc98/include/_stdint.h6
-rw-r--r--sys/pc98/include/_types.h6
-rw-r--r--sys/pc98/include/apm_bios.h55
-rw-r--r--sys/pc98/include/apm_segments.h6
-rw-r--r--sys/pc98/include/asm.h6
-rw-r--r--sys/pc98/include/asmacros.h6
-rw-r--r--sys/pc98/include/atomic.h6
-rw-r--r--sys/pc98/include/bootinfo.h6
-rw-r--r--sys/pc98/include/bus.h648
-rw-r--r--sys/pc98/include/bus_dma.h6
-rw-r--r--sys/pc98/include/clock.h6
-rw-r--r--sys/pc98/include/counter.h6
-rw-r--r--sys/pc98/include/cpu.h6
-rw-r--r--sys/pc98/include/cpufunc.h6
-rw-r--r--sys/pc98/include/cputypes.h6
-rw-r--r--sys/pc98/include/cserial.h6
-rw-r--r--sys/pc98/include/db_machdep.h6
-rw-r--r--sys/pc98/include/dump.h6
-rw-r--r--sys/pc98/include/efi.h14
-rw-r--r--sys/pc98/include/elf.h6
-rw-r--r--sys/pc98/include/endian.h6
-rw-r--r--sys/pc98/include/exec.h6
-rw-r--r--sys/pc98/include/float.h6
-rw-r--r--sys/pc98/include/floatingpoint.h6
-rw-r--r--sys/pc98/include/frame.h6
-rw-r--r--sys/pc98/include/gdb_machdep.h6
-rw-r--r--sys/pc98/include/ieeefp.h6
-rw-r--r--sys/pc98/include/in_cksum.h6
-rw-r--r--sys/pc98/include/intr_machdep.h6
-rw-r--r--sys/pc98/include/ioctl_bt848.h6
-rw-r--r--sys/pc98/include/ioctl_meteor.h6
-rw-r--r--sys/pc98/include/iodev.h6
-rw-r--r--sys/pc98/include/kdb.h6
-rw-r--r--sys/pc98/include/limits.h6
-rw-r--r--sys/pc98/include/md_var.h51
-rw-r--r--sys/pc98/include/memdev.h6
-rw-r--r--sys/pc98/include/metadata.h6
-rw-r--r--sys/pc98/include/minidump.h6
-rw-r--r--sys/pc98/include/mp_watchdog.h6
-rw-r--r--sys/pc98/include/nexusvar.h6
-rw-r--r--sys/pc98/include/npx.h6
-rw-r--r--sys/pc98/include/ofw_machdep.h6
-rw-r--r--sys/pc98/include/param.h33
-rw-r--r--sys/pc98/include/pc/bios.h6
-rw-r--r--sys/pc98/include/pc/display.h39
-rw-r--r--sys/pc98/include/pcaudioio.h6
-rw-r--r--sys/pc98/include/pcb.h6
-rw-r--r--sys/pc98/include/pcb_ext.h6
-rw-r--r--sys/pc98/include/pci_cfgreg.h39
-rw-r--r--sys/pc98/include/pcpu.h6
-rw-r--r--sys/pc98/include/perfmon.h6
-rw-r--r--sys/pc98/include/pmap.h6
-rw-r--r--sys/pc98/include/pmc_mdep.h6
-rw-r--r--sys/pc98/include/ppireg.h48
-rw-r--r--sys/pc98/include/proc.h6
-rw-r--r--sys/pc98/include/profile.h6
-rw-r--r--sys/pc98/include/psl.h6
-rw-r--r--sys/pc98/include/ptrace.h6
-rw-r--r--sys/pc98/include/reg.h6
-rw-r--r--sys/pc98/include/reloc.h6
-rw-r--r--sys/pc98/include/resource.h6
-rw-r--r--sys/pc98/include/runq.h6
-rw-r--r--sys/pc98/include/segments.h6
-rw-r--r--sys/pc98/include/setjmp.h6
-rw-r--r--sys/pc98/include/sf_buf.h6
-rw-r--r--sys/pc98/include/sigframe.h6
-rw-r--r--sys/pc98/include/signal.h6
-rw-r--r--sys/pc98/include/smapi.h6
-rw-r--r--sys/pc98/include/smp.h6
-rw-r--r--sys/pc98/include/speaker.h6
-rw-r--r--sys/pc98/include/specialreg.h6
-rw-r--r--sys/pc98/include/stack.h6
-rw-r--r--sys/pc98/include/stdarg.h6
-rw-r--r--sys/pc98/include/sysarch.h6
-rw-r--r--sys/pc98/include/timerreg.h54
-rw-r--r--sys/pc98/include/trap.h6
-rw-r--r--sys/pc98/include/tss.h6
-rw-r--r--sys/pc98/include/ucontext.h6
-rw-r--r--sys/pc98/include/varargs.h6
-rw-r--r--sys/pc98/include/vdso.h6
-rw-r--r--sys/pc98/include/vm.h6
-rw-r--r--sys/pc98/include/vm86.h6
-rw-r--r--sys/pc98/include/vmparam.h6
-rw-r--r--sys/pc98/linux/linux.h6
-rw-r--r--sys/pc98/linux/linux_ipc64.h6
-rw-r--r--sys/pc98/linux/linux_proto.h6
-rw-r--r--sys/pc98/pc98/busio.s1774
-rw-r--r--sys/pc98/pc98/busiosubr.c331
-rw-r--r--sys/pc98/pc98/canbepm.c137
-rw-r--r--sys/pc98/pc98/canbus.c441
-rw-r--r--sys/pc98/pc98/canbus.h39
-rw-r--r--sys/pc98/pc98/canbus_if.m69
-rw-r--r--sys/pc98/pc98/canbusvars.h110
-rw-r--r--sys/pc98/pc98/genassym.c3
-rw-r--r--sys/pc98/pc98/pc98_machdep.c320
-rw-r--r--sys/pc98/pc98/pc98_machdep.h102
-rw-r--r--sys/sys/consio.h6
-rw-r--r--sys/sys/copyright.h11
-rw-r--r--sys/sys/disk/pc98.h75
-rw-r--r--sys/sys/diskpc98.h47
-rw-r--r--sys/sys/fbio.h8
-rw-r--r--sys/sys/fdcio.h22
-rw-r--r--sys/x86/isa/atpic.c38
-rw-r--r--sys/x86/isa/clock.c99
-rw-r--r--sys/x86/isa/icu.h19
-rw-r--r--sys/x86/isa/isa.c98
-rw-r--r--sys/x86/x86/autoconf.c41
-rw-r--r--sys/x86/x86/cpu_machdep.c12
-rw-r--r--sys/x86/x86/intr_machdep.c4
-rw-r--r--sys/x86/x86/mptable.c11
-rw-r--r--sys/x86/x86/nexus.c36
-rw-r--r--targets/pseudo/userland/Makefile.depend5
-rw-r--r--targets/pseudo/userland/misc/Makefile.depend1
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc2
-rw-r--r--tools/tools/kerninclude/kerninclude.sh10
-rw-r--r--tools/tools/sysdoc/sysdoc.sh2
-rw-r--r--tools/tools/vt/keymaps/KBDFILES.map2
-rwxr-xr-xtools/tools/vt/keymaps/convert-keymap.pl3
-rw-r--r--usr.bin/mkimg/Makefile1
-rw-r--r--usr.bin/mkimg/pc98.c118
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu127
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow2.gz.uu21
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.raw.gz.uu11
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.vhd.gz.uu18
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu14
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.vmdk.gz.uu82
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.qcow.gz.uu127
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu21
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.raw.gz.uu11
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.vhd.gz.uu18
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu14
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.vmdk.gz.uu82
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu126
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.raw.gz.uu12
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.vhd.gz.uu18
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu15
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.vmdk.gz.uu84
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu126
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.qcow2.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.raw.gz.uu12
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.vhd.gz.uu18
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu15
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.vmdk.gz.uu84
-rwxr-xr-xusr.bin/mkimg/tests/mkimg.sh6
-rw-r--r--usr.sbin/Makefile.i38620
-rw-r--r--usr.sbin/boot98cfg/Makefile10
-rw-r--r--usr.sbin/boot98cfg/Makefile.depend17
-rw-r--r--usr.sbin/boot98cfg/boot98cfg.8104
-rw-r--r--usr.sbin/boot98cfg/boot98cfg.c319
-rw-r--r--usr.sbin/bsdinstall/partedit/gpart_ops.c9
-rw-r--r--usr.sbin/bsdinstall/partedit/part_wizard.c2
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_pc98.c83
-rw-r--r--usr.sbin/bsdinstall/partedit/scripted.c2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c4
-rw-r--r--usr.sbin/config/config.57
-rw-r--r--usr.sbin/fdcontrol/Makefile4
-rw-r--r--usr.sbin/fdformat/Makefile4
-rw-r--r--usr.sbin/fdread/Makefile4
-rw-r--r--usr.sbin/fdread/fdutil.c25
-rw-r--r--usr.sbin/kgzip/kgzip.82
-rwxr-xr-xusr.sbin/pc-sysinstall/backend-partmanager/create-part.sh1
-rw-r--r--usr.sbin/pnpinfo/Makefile4
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c12
418 files changed, 215 insertions, 46737 deletions
diff --git a/Makefile b/Makefile
index 7e76ac915fc7..8b02703bda5d 100644
--- a/Makefile
+++ b/Makefile
@@ -236,7 +236,7 @@ _MAKE+= MK_META_MODE=no
# Guess machine architecture from machine type, and vice versa.
.if !defined(TARGET_ARCH) && defined(TARGET)
-_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
+_TARGET_ARCH= ${TARGET:S/arm64/aarch64/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH}
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64(sf)?/riscv/}
@@ -417,13 +417,12 @@ worlds: .PHONY
# existing system is.
#
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
-TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64
+TARGETS?=amd64 arm arm64 i386 mips powerpc sparc64
_UNIVERSE_TARGETS= ${TARGETS}
TARGET_ARCHES_arm?= arm armeb armv6
TARGET_ARCHES_arm64?= aarch64
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
-TARGET_ARCHES_pc98?= i386
.for target in ${TARGETS}
TARGET_ARCHES_${target}?= ${target}
.endfor
diff --git a/Makefile.inc1 b/Makefile.inc1
index 3d505a5ed4e1..e9ed22493df1 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -349,7 +349,6 @@ KNOWN_ARCHES?= aarch64/arm64 \
armeb/arm \
armv6/arm \
i386 \
- i386/pc98 \
mips \
mipsel/mips \
mips64el/mips \
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index e97bb0099470..ef441e97696d 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,17 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20170128: remove pc98 support
+OLD_FILES+=usr/include/dev/ic/i8251.h
+OLD_FILES+=usr/include/dev/ic/wd33c93reg.h
+OLD_FILES+=usr/include/sys/disk/pc98.h
+OLD_FILES+=usr/include/sys/diskpc98.h
+OLD_FILES+=usr/share/man/man4/i386/ct.4.gz
+OLD_FILES+=usr/share/man/man4/i386/snc.4.gz
+OLD_FILES+=usr/share/syscons/keymaps/jp.pc98.iso.kbd
+OLD_FILES+=usr/share/syscons/keymaps/jp.pc98.kbd
+OLD_FILES+=usr/share/vt/keymaps/jp.pc98.iso.kbd
+OLD_FILES+=usr/share/vt/keymaps/jp.pc98.kbd
# 20170110: Four files from ggate tests consolidated into one
OLD_FILES+=usr/tests/sys/geom/class/gate/1_test
OLD_FILES+=usr/tests/sys/geom/class/gate/2_test
diff --git a/etc/etc.pc98/ttys b/etc/etc.pc98/ttys
deleted file mode 100644
index d75cf053ab0d..000000000000
--- a/etc/etc.pc98/ttys
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# $FreeBSD$
-# @(#)ttys 5.1 (Berkeley) 4/17/89
-#
-# This file specifies various information about terminals on the system.
-# It is used by several different programs. Common entries for the
-# various columns include:
-#
-# name The name of the terminal device.
-#
-# getty The program to start running on the terminal. Typically a
-# getty program, as the name implies. Other common entries
-# include none, when no getty is needed, and xdm, to start the
-# X Window System.
-#
-# type The initial terminal type for this port. For hardwired
-# terminal lines, this will contain the type of terminal used.
-# For virtual consoles, the correct type is typically cons25w.
-# Other common values include dialup for incoming modem ports, and
-# unknown when the terminal type cannot be predetermined.
-#
-# status Must be on or off. If on, init will run the getty program on
-# the specified port. If the word "secure" appears, this tty
-# allows root login.
-#
-# name getty type status comments
-#
-# If console is marked "insecure", then init will ask for the root password
-# when going to single-user mode.
-console none unknown off secure
-#
-ttyv0 "/usr/libexec/getty Pc" cons25w on secure
-# Virtual terminals
-ttyv1 "/usr/libexec/getty Pc" cons25w on secure
-ttyv2 "/usr/libexec/getty Pc" cons25w on secure
-ttyv3 "/usr/libexec/getty Pc" cons25w on secure
-ttyv4 "/usr/libexec/getty Pc" cons25w on secure
-ttyv5 "/usr/libexec/getty Pc" cons25w on secure
-ttyv6 "/usr/libexec/getty Pc" cons25w on secure
-ttyv7 "/usr/libexec/getty Pc" cons25w on secure
-ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
-# Serial terminals
-# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
-ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
-ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
-ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
-# Dumb console
-dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/rc.d/syscons b/etc/rc.d/syscons
index 3a6ff18f6ec4..7c0c8035be2e 100755
--- a/etc/rc.d/syscons
+++ b/etc/rc.d/syscons
@@ -112,7 +112,6 @@ icelandic.iso) echo is;;
it.iso) echo it;;
jp.106x) echo jp.capsctrl;;
jp.106) echo jp;;
-#?? jp.pc98.iso) echo jp.pc98;;
kk.pt154.io) echo kz.io;;
kk.pt154.kst) echo kz.kst;;
latinamerican.iso.acc) echo latinamerican.acc;;
diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile
index bde9460fee75..7f4b302d5deb 100644
--- a/lib/libsysdecode/Makefile
+++ b/lib/libsysdecode/Makefile
@@ -120,7 +120,7 @@ tables.h: mktables
ioctl.c: .PHONY
.endif
ioctl.c: mkioctls .META
- env MACHINE=${MACHINE} CPP="${CPP}" \
+ env CPP="${CPP}" \
/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
beforedepend: ioctl.c tables.h
diff --git a/lib/libsysdecode/mkioctls b/lib/libsysdecode/mkioctls
index b99ff19f2486..e5bcee2338e8 100644
--- a/lib/libsysdecode/mkioctls
+++ b/lib/libsysdecode/mkioctls
@@ -24,15 +24,7 @@ ioctl_includes=$(
awk '{printf("#include <%s>\\n", $1)}'
)
-: ${MACHINE=$(uname -m)}
-case "${MACHINE}" in
-*pc98*)
- ioctl_includes="$ioctl_includes#include <sys/diskpc98.h>\\n"
- ;;
-*)
- ioctl_includes="$ioctl_includes#include <sys/diskmbr.h>\\n"
- ;;
-esac
+ioctl_includes="$ioctl_includes#include <sys/diskmbr.h>\\n"
awk -v x="$ioctl_includes" 'BEGIN {print x}' |
$CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - |
diff --git a/libexec/Makefile.pc98 b/libexec/Makefile.pc98
deleted file mode 100644
index a755298888a6..000000000000
--- a/libexec/Makefile.pc98
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-# Because i386 adds extra stuff we don't need or want for PC98 we need
-# an empty file so it doesn't get added.
diff --git a/release/doc/README b/release/doc/README
index a46779d78f1f..b9d06f573119 100644
--- a/release/doc/README
+++ b/release/doc/README
@@ -99,7 +99,7 @@ element will be included. For example:
<para arch="sparc64">SPARC64-specific text</para>
-The currently-supported architectures are amd64, arm, i386, pc98,
+The currently-supported architectures are amd64, arm, i386,
powerpc and sparc64. An element may appear for multiple architectures
by specifying a comma-separated list of architectures
(i.e. arch="sparc64,amd64").
diff --git a/release/doc/en_US.ISO8859-1/hardware/article.xml b/release/doc/en_US.ISO8859-1/hardware/article.xml
index 0168b3630f91..ee5f66cf76e5 100644
--- a/release/doc/en_US.ISO8859-1/hardware/article.xml
+++ b/release/doc/en_US.ISO8859-1/hardware/article.xml
@@ -252,35 +252,6 @@
more information.</para>
</sect2>
- <sect2 xml:id="proc-pc98">
- <title>pc98</title>
-
- <para>NEC PC-9801/9821 series with almost all &i386;-compatible
- processors, including 80486, &pentium;, &pentium; Pro,
- &pentium; II, and variants. All &i386;-compatible processors
- by AMD, Cyrix, IBM, and IDT are also supported.</para>
-
- <para>NEC FC-9801/9821 series, and NEC SV-98 series (both of
- them are compatible with PC-9801/9821 series) should be
- supported.</para>
-
- <para>EPSON PC-386/486/586 series, which are compatible with NEC
- PC-9801 series are supported.</para>
-
- <para>High-resolution mode is not supported. NEC
- PC-98XA/XL/RL/XL^2, and NEC PC-H98 series are supported in
- normal (PC-9801 compatible) mode only.</para>
-
- <para>Although there are some multi-processor systems (such as
- Rs20/B20), SMP-related features of &os; are not supported
- yet.</para>
-
- <para>PC-9801/9821 standard bus (called C-Bus), PC-9801NOTE
- expansion bus (110pin), and PCI bus are supported. New Extend
- Standard Architecture (NESA) bus (used in PC-H98, SV-H98, and
- FC-H98 series) is not supported.</para>
- </sect2>
-
<sect2 xml:id="proc-powerpc">
<title>powerpc</title>
@@ -636,17 +607,9 @@
<sect2 xml:id="disk">
<title>Disk Controllers</title>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;, &arch.sparc64;]
+ <para>[&arch.amd64;, &arch.i386;, &arch.sparc64;]
IDE/ATA controllers (&man.ata.4; driver)</para>
- <para>[&arch.pc98;] IDE/ATA controllers (wdc driver)</para>
-
- <itemizedlist>
- <listitem>
- <para>On-board IDE controller</para>
- </listitem>
- </itemizedlist>
-
&hwlist.aac;
&hwlist.adv;
@@ -673,8 +636,6 @@
&hwlist.ciss;
- &hwlist.ct;
-
&hwlist.dpt;
<note>
@@ -894,8 +855,6 @@
&hwlist.sn;
- &hwlist.snc;
-
&hwlist.ste;
&hwlist.stge;
@@ -904,7 +863,7 @@
&hwlist.tl;
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] SMC 83c17x
+ <para>[&arch.amd64;, &arch.i386;] SMC 83c17x
(EPIC)-based Ethernet NICs (&man.tx.4; driver)</para>
&hwlist.txp;
@@ -934,8 +893,7 @@
<sect2 xml:id="fddi">
<title>FDDI Interfaces</title>
- <para>[&arch.i386;, &arch.pc98;] DEC DEFPA PCI (&man.fpa.4;
- driver)</para>
+ <para>[&arch.i386;] DEC DEFPA PCI (&man.fpa.4; driver)</para>
<para>[&arch.i386;] DEC DEFEA EISA (&man.fpa.4; driver)</para>
</sect2>
@@ -943,28 +901,28 @@
<sect2 xml:id="atm">
<title>ATM Interfaces</title>
- <para>[&arch.i386;, &arch.pc98;] Midway-based ATM interfaces
+ <para>[&arch.i386;] Midway-based ATM interfaces
(&man.en.4; driver)</para>
- <para>[&arch.i386;, &arch.pc98; &arch.sparc64;] FORE Systems,
+ <para>[&arch.i386;, &arch.sparc64;] FORE Systems,
Inc. PCA-200E ATM PCI Adapters (hfa and &man.fatm.4;
drivers)</para>
- <para>[&arch.i386;, &arch.pc98;] IDT NICStAR 77201/211-based ATM
+ <para>[&arch.i386;] IDT NICStAR 77201/211-based ATM
Adapters (&man.idt.4; driver)</para>
- <para>[&arch.i386;, &arch.pc98; &arch.sparc64;] FORE Systems,
+ <para>[&arch.i386;, &arch.sparc64;] FORE Systems,
Inc. HE155 and HE622 ATM interfaces (&man.hatm.4;
driver)</para>
- <para>[&arch.i386;, &arch.pc98;] IDT77252-based ATM cards
+ <para>[&arch.i386;] IDT77252-based ATM cards
(&man.patm.4; driver)</para>
</sect2>
<sect2 xml:id="wlan">
<title>Wireless Network Interfaces</title>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Cisco/Aironet
+ <para>[&arch.amd64;, &arch.i386;] Cisco/Aironet
802.11b wireless adapters (&man.an.4; driver)</para>
&hwlist.ath;
@@ -1016,7 +974,7 @@
&hwlist.urtw;
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent
+ <para>[&arch.amd64;, &arch.i386;] Lucent
Technologies WaveLAN/IEEE 802.11b wireless network adapters
and workalikes using the Lucent Hermes, Intersil PRISM-II,
Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24
@@ -1214,77 +1172,6 @@
&hwlist.rc;
- <para>[&arch.pc98;] Internel serial interfaces (&man.sio.4;
- driver)</para>
-
- <itemizedlist>
- <listitem>
- <para>PC-9801 on-board</para>
- </listitem>
- <listitem>
- <para>PC-9821 2'nd CCU (flags 0x12000000)</para>
- </listitem>
- </itemizedlist>
-
- <para>[&arch.pc98;] NEC PC-9861K, PC-9801-101 and Midori-Denshi
- MDC-926Rs (&man.sio.4; driver)</para>
-
- <itemizedlist>
- <listitem>
- <para>COM2 (flags 0x01000000)</para>
- </listitem>
-
- <listitem>
- <para>COM3 (flags 0x02000000)</para>
- </listitem>
- </itemizedlist>
-
- <para>[&arch.pc98;] NEC PC-9801-120 (&man.sio.4; driver)</para>
-
- <note>
- <para>"flags 0x11000000" is necessary in kernel
- configuration.</para>
- </note>
-
- <para>[&arch.pc98;] Microcore MC-16550, MC-16550II, MC-RS98
- (&man.sio.4; driver)</para>
-
- <note>
- <para>"flags 0x14000?01" is necessary in kernel
- configuration.</para>
- </note>
-
- <para>[&arch.pc98;] Media Intelligent RSB-2000, RSB-3000 and
- AIWA B98-02 (&man.sio.4; driver)</para>
-
- <note>
- <para>"flags 0x15000?01" is necessary in kernel
- configuration.</para>
- </note>
-
- <para>[&arch.pc98;] Media Intelligent RSB-384 (&man.sio.4;
- driver)</para>
-
- <note>
- <para>"flags 0x16000001" is necessary in kernel
- configuration.</para>
- </note>
-
- <para>[&arch.pc98;] I-O DATA RSA-98III (&man.sio.4;
- driver)</para>
-
- <note>
- <para>"flags 0x18000?01" is necessary in kernel
- configuration.</para>
- </note>
-
- <para>[&arch.pc98;] Hayes ESP98 (&man.sio.4; driver)</para>
-
- <note>
- <para>"options COM_ESP" and "flags 0x19000000" are necessary
- in kernel configuration.</para>
- </note>
-
</sect2>
<sect2 xml:id="sound">
@@ -1350,35 +1237,6 @@
&hwlist.snd.vibes;
- <para>[&arch.pc98;] NEC PC-9801-73, 86 and compatibles (nss
- driver)</para>
-
- <itemizedlist>
- <listitem>
- <para>NEC A-MATE internal sound</para>
- </listitem>
-
- <listitem>
- <para>Q-Vision WaveStar, WaveMaster</para>
- </listitem>
- </itemizedlist>
-
- <para>[&arch.pc98;] NEC X-MATE, CanBe, ValueStar internal (mss
- driver)</para>
-
- <para>[&arch.pc98;] Creative Technologies SoundBlaster(98)
- (&man.sb.4; driver)</para>
-
- <para>[&arch.pc98;] I-O DATA CD-BOX (&man.sb.4; driver)</para>
-
- <para>[&arch.pc98;] MPU-401 and compatible interfaces (mpu
- driver)</para>
-
- <itemizedlist>
- <listitem>
- <para>Q-Vision WaveStar</para>
- </listitem>
- </itemizedlist>
</sect2>
<sect2 xml:id="camera">
@@ -1392,7 +1250,7 @@
<sect2 xml:id="usb">
<title>USB Devices</title>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] A
+ <para>[&arch.amd64;, &arch.i386;] A
range of USB peripherals are supported; devices known to work
are listed in this section. Owing to the generic nature of
most USB devices, with some exceptions any device of a given
@@ -1400,14 +1258,14 @@
here.</para>
<note>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
+ <para>[&arch.amd64;, &arch.i386;]
USB Ethernet adapters can be found in the section listing
<link linkend="ethernet">Ethernet
interfaces</link>.</para>
</note>
<note>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
+ <para>[&arch.amd64;, &arch.i386;]
USB Bluetooth adapters can be found in <link linkend="bluetooth">Bluetooth</link> section.</para>
</note>
@@ -1415,18 +1273,15 @@
&hwlist.uhci;
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] USB
+ <para>[&arch.amd64;, &arch.i386;] USB
2.0 controllers using the EHCI interface (&man.ehci.4;
driver)</para>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
- Hubs</para>
+ <para>[&arch.amd64;, &arch.i386;] Hubs</para>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
- Keyboards (&man.ukbd.4; driver)</para>
+ <para>[&arch.amd64;, &arch.i386;] Keyboards (&man.ukbd.4; driver)</para>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
- Miscellaneous</para>
+ <para>[&arch.amd64;, &arch.i386;] Miscellaneous</para>
<itemizedlist>
<listitem>
@@ -1454,8 +1309,7 @@
&hwlist.umodem;
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Mice
- (&man.ums.4; driver)</para>
+ <para>[&arch.amd64;, &arch.i386;] Mice (&man.ums.4; driver)</para>
&hwlist.ulpt;
@@ -1471,7 +1325,7 @@
&hwlist.umass;
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Audio Devices
+ <para>[&arch.amd64;, &arch.i386;] Audio Devices
(&man.uaudio.4; driver)</para>
&hwlist.uvisor;
@@ -1507,8 +1361,7 @@
<sect2 xml:id="misc">
<title>Miscellaneous</title>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
- FAX-Modem/PCCARD</para>
+ <para>[&arch.amd64;, &arch.i386;] FAX-Modem/PCCARD</para>
<itemizedlist>
<listitem>
@@ -1521,7 +1374,7 @@
</listitem>
</itemizedlist>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Floppy drives
+ <para>[&arch.amd64;, &arch.i386;] Floppy drives
(&man.fdc.4; driver)</para>
<para>[&arch.amd64;, &arch.i386;] VGA-compatible video cards
@@ -1533,8 +1386,7 @@
found at <uri xlink:href="http://www.x.org/">http://www.x.org/</uri>.</para>
</note>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
- Keyboards including:</para>
+ <para>[&arch.amd64;, &arch.i386;] Keyboards including:</para>
<itemizedlist>
<listitem>
@@ -1548,21 +1400,17 @@
</listitem>
<listitem>
- <para>[&arch.pc98;] Standard keyboards</para>
- </listitem>
-
- <listitem>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
+ <para>[&arch.amd64;, &arch.i386;]
USB keyboards (&man.ukbd.4; driver)</para>
</listitem>
</itemizedlist>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
+ <para>[&arch.amd64;, &arch.i386;]
Pointing devices including:</para>
<itemizedlist>
<listitem>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Bus mice and
+ <para>[&arch.amd64;, &arch.i386;] Bus mice and
compatible devices (&man.mse.4; driver)</para>
</listitem>
@@ -1577,7 +1425,7 @@
</listitem>
<listitem>
- <para>[&arch.amd64;, &arch.i386;, &arch.pc98;]
+ <para>[&arch.amd64;, &arch.i386;]
USB mice (&man.ums.4; driver)</para>
</listitem>
</itemizedlist>
@@ -1591,17 +1439,10 @@
<para>[&arch.amd64;, &arch.i386;] <quote>PC standard</quote>
parallel ports (&man.ppc.4; driver)</para>
- <para>[&arch.pc98;] <quote>PC-9821 standard</quote> parallel
- ports (&man.ppc.4; driver)</para>
-
<para>[&arch.i386;, &arch.amd64;] PC-compatible joysticks
(&man.joy.4; driver)</para>
- <para>[&arch.pc98;] Joystick port of SoundBlaster(98)
- (&man.joy.4; driver)</para>
-
- <para>[&arch.i386;, &arch.pc98;] PHS Data Communication
- Card/PCCARD</para>
+ <para>[&arch.i386;] PHS Data Communication Card/PCCARD</para>
<itemizedlist>
<listitem>
@@ -1621,8 +1462,6 @@
cards compatible with the HOT1 from <link xlink:href="http://www.vcc.com/">Virtual Computers</link> (xrpu
driver).</para>
- <para>[&arch.pc98;] Power Management Controller of NEC PC-98
- Note (pmc driver)</para>
</sect2>
</sect1>
</article>
diff --git a/release/doc/en_US.ISO8859-1/readme/article.xml b/release/doc/en_US.ISO8859-1/readme/article.xml
index ffebcc32d4c1..cbca329ea50e 100644
--- a/release/doc/en_US.ISO8859-1/readme/article.xml
+++ b/release/doc/en_US.ISO8859-1/readme/article.xml
@@ -69,7 +69,6 @@
<para>&os; is an operating system based on 4.4 BSD Lite for
AMD64 and Intel EM64T based PC hardware (&arch.amd64;),
Intel, AMD, Cyrix or NexGen <quote>x86</quote> based PC hardware (&arch.i386;),
- NEC PC-9801/9821 series PCs and compatibles (&arch.pc98;),
and &ultrasparc; machines (&arch.sparc64;). Versions
for the &arm; (&arch.arm;), &mips; (&arch.mips;), and
&powerpc; (&arch.powerpc;) architectures are currently under
@@ -324,7 +323,7 @@
</para>
<para>On platforms that support &man.bsdinstall.8; (currently
- &arch.amd64;, &arch.i386;, &arch.pc98;, and &arch.sparc64;), these documents are generally available via the
+ &arch.amd64;, &arch.i386;, and &arch.sparc64;), these documents are generally available via the
Documentation menu during installation. Once the system is
installed, you can revisit this menu by re-running the
&man.bsdinstall.8; utility.</para>
diff --git a/release/doc/share/examples/Makefile.relnotesng b/release/doc/share/examples/Makefile.relnotesng
index 9607e283a071..5bbc1a110900 100644
--- a/release/doc/share/examples/Makefile.relnotesng
+++ b/release/doc/share/examples/Makefile.relnotesng
@@ -6,7 +6,7 @@
# the build tree.
#
-ARCHS= amd64 i386 pc98 powerpc sparc64
+ARCHS= amd64 i386 powerpc sparc64
MULTITEXTS=
UNITEXTS= hardware readme relnotes errata
diff --git a/release/doc/share/misc/dev.archlist.txt b/release/doc/share/misc/dev.archlist.txt
index 5f62f48fecb5..7ad81543e989 100644
--- a/release/doc/share/misc/dev.archlist.txt
+++ b/release/doc/share/misc/dev.archlist.txt
@@ -36,43 +36,42 @@
# <Driver name><tab><arch>[,<arch>...]
#
aac i386,amd64
-adv i386,pc98,amd64
-adw i386,pc98,amd64
+adv i386,amd64
+adw i386,amd64
aha i386
ahb i386
ahd i386,sparc64,amd64
-aic i386,pc98,amd64
-amd i386,pc98,amd64
+aic i386,amd64
+amd i386,amd64
arcmsr i386,amd64
asr i386
-ath i386,pc98,amd64,sparc64
-aue i386,pc98,amd64,powerpc
-axe i386,pc98,amd64,powerpc
+ath i386,amd64,sparc64
+aue i386,amd64,powerpc
+axe i386,amd64,powerpc
bce i386,amd64
-bge i386,pc98,sparc64,amd64
-bktr i386,pc98
+bge i386,sparc64,amd64
+bktr i386
bt i386,amd64
bxe i386,amd64
-cdce i386,pc98,amd64,powerpc
+cdce i386,amd64,powerpc
ciss i386,amd64
-ce i386,pc98
+ce i386
cm i386
-cnw i386,pc98,amd64
-cp i386,pc98
-ct pc98
+cnw i386,amd64
+cp i386
ctau i386
-cue i386,pc98,amd64,powerpc
+cue i386,amd64,powerpc
cx i386
cxgb i386,amd64
-de i386,pc98,amd64
+de i386,amd64
dpt i386,amd64
-ed i386,pc98
-ep i386,pc98,amd64
+ed i386
+ep i386,amd64
esp sparc64
ex i386,amd64
-fe i386,pc98,amd64
+fe i386,amd64
fwohci i386,sparc64,amd64,powerpc
-hifn i386,pc98,amd64
+hifn i386,amd64
hpt27xx i386,amd64
hptiop i386,amd64
hptmv i386,amd64
@@ -83,26 +82,26 @@ iir i386,amd64
ips i386,amd64
isci i386,amd64
ixgb i386,amd64
-kue i386,pc98,amd64,powerpc
-lge i386,pc98,amd64
+kue i386,amd64,powerpc
+lge i386,amd64
mfi i386,amd64
mlx i386,amd64
mly i386,amd64
msk i386,amd64
mxge i386,amd64
-my i386,pc98
-ncr i386,pc98,amd64
-ncv i386,pc98
+my i386
+ncr i386,amd64
+ncv i386
nfe i386,amd64
-ng_bt3c i386,pc98,amd64
-ng_ubt i386,pc98,amd64
-nsp i386,pc98
+ng_bt3c i386,amd64
+ng_ubt i386,amd64
+nsp i386
nxge i386,amd64
oce i386,amd64
-ohci i386,pc98,amd64,powerpc
+ohci i386,amd64,powerpc
oltr i386
otus i386,amd64
-pcn i386,pc98,amd64
+pcn i386,amd64
pst i386
qlxgb amd64
qlxgbe amd64
@@ -110,14 +109,13 @@ qlxge amd64
rc i386
ral i386,amd64
rsu i386,amd64
-rue i386,pc98,amd64
+rue i386,amd64
rum i386,amd64
run i386,amd64
-safe i386,pc98,amd64
+safe i386,amd64
sbp i386,sparc64,amd64
sfgxe amd64
sn i386,amd64
-snc pc98
snd_ad1816 i386,amd64
snd_als4000 i386
snd_atiixp i386,amd64
@@ -148,31 +146,31 @@ snd_t4dwave i386,amd64,sparc64
snd_via8233 i386,amd64
snd_via82c686 i386,amd64
snd_vibes i386,amd64
-stg i386,pc98
-ti i386,pc98,amd64,sparc64
-tl i386,pc98,amd64
+stg i386
+ti i386,amd64,sparc64
+tl i386,amd64
trm i386,amd64
twa i386,amd64
twe i386,amd64
tws i386,amd64
-ubsa i386,pc98,amd64
-ubsec i386,pc98,amd64
-ubser i386,pc98,amd64
-ucycom i386,pc98,amd64
-udav i386,pc98,amd64
-uftdi i386,pc98,amd64
-uhci i386,pc98,amd64,powerpc
-ulpt i386,pc98,amd64,powerpc
-umass i386,pc98,amd64,powerpc
-umodem i386,pc98,amd64
-uplcom i386,pc98,amd64
+ubsa i386,amd64
+ubsec i386,amd64
+ubser i386,amd64
+ucycom i386,amd64
+udav i386,amd64
+uftdi i386,amd64
+uhci i386,amd64,powerpc
+ulpt i386,amd64,powerpc
+umass i386,amd64,powerpc
+umodem i386,amd64
+uplcom i386,amd64
ural i386,amd64
-urio i386,pc98,amd64,powerpc
-uvisor i386,pc98,amd64
-uvscom i386,pc98,amd64
+urio i386,amd64,powerpc
+uvisor i386,amd64
+uvscom i386,amd64
vpo i386
-vx i386,pc98,amd64
+vx i386,amd64
vxge i386,amd64
-wb i386,pc98,amd64
+wb i386,amd64
xe i386,amd64
zyd i386,amd64
diff --git a/release/doc/share/xml/release.ent b/release/doc/share/xml/release.ent
index 0ce9177ebc86..cacc43401fba 100644
--- a/release/doc/share/xml/release.ent
+++ b/release/doc/share/xml/release.ent
@@ -73,7 +73,6 @@
<!ENTITY arch.arm64 "aarch64">
<!ENTITY arch.i386 "i386">
<!ENTITY arch.mips "mips">
-<!ENTITY arch.pc98 "pc98">
<!ENTITY arch.powerpc "powerpc">
<!ENTITY arch.powerpc64 "powerpc64">
<!ENTITY arch.sparc64 "sparc64">
diff --git a/release/pc98/mkisoimages.sh b/release/pc98/mkisoimages.sh
deleted file mode 100644
index 5e7a046147aa..000000000000
--- a/release/pc98/mkisoimages.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-#
-# Module: mkisoimages.sh
-# Author: Jordan K Hubbard
-# Date: 22 June 2001
-#
-# $FreeBSD$
-#
-# This script is used by release/Makefile to build the (optional) ISO images
-# for a FreeBSD release. It is considered architecture dependent since each
-# platform has a slightly unique way of making bootable CDs. This script
-# is also allowed to generate any number of images since that is more of
-# publishing decision than anything else.
-#
-# Usage:
-#
-# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
-#
-# Where -b is passed if the ISO image should be made "bootable" by
-# whatever standards this architecture supports (may be unsupported),
-# image-label is the ISO image label, image-name is the filename of the
-# resulting ISO image, base-bits-dir contains the image contents and
-# extra-bits-dir, if provided, contains additional files to be merged
-# into base-bits-dir as part of making the image.
-
-if [ "x$1" = "x-b" ]; then
- # This is highly x86-centric and will be used directly below.
- bootable="-o generic-bootimage=$4/boot/cdboot"
- shift
-else
- bootable=""
-fi
-
-if [ $# -lt 3 ]; then
- echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
- exit 1
-fi
-
-LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
-NAME="$1"; shift
-
-publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
-makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
-rm -f "$1/etc/fstab"
diff --git a/release/rc.local b/release/rc.local
index cb442273c303..8162cd1efff6 100755
--- a/release/rc.local
+++ b/release/rc.local
@@ -16,11 +16,7 @@ mkdir /tmp/bsdinstall_etc
kbdcontrol -d >/dev/null 2>&1
if [ $? -eq 0 ]; then
# Syscons: use xterm, start interesting things on other VTYs
- if [ ${MACHINE} = "pc98" ]; then
- TERM=cons25w
- else
- TERM=xterm
- fi
+ TERM=xterm
# Don't send ESC on function-key 62/63 (left/right command key)
kbdcontrol -f 62 '' > /dev/null 2>&1
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index 70d3a3724a08..12aef08a8a54 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -141,10 +141,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel
#CRUNCH_LIBS+= -lsmb
.endif
-.if ${MACHINE} == "pc98"
-CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
-.endif
-
.if ${MACHINE_CPUARCH} == "sparc64"
CRUNCH_PROGS_sbin+= bsdlabel sunlabel
.endif
diff --git a/sbin/Makefile.pc98 b/sbin/Makefile.pc98
deleted file mode 100644
index 4aab559ad6dd..000000000000
--- a/sbin/Makefile.pc98
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-
-SUBDIR += bsdlabel
-SUBDIR += fdisk_pc98
-SUBDIR += sconfig
diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8
index 994320665cb1..799a623aae18 100644
--- a/sbin/bsdlabel/bsdlabel.8
+++ b/sbin/bsdlabel/bsdlabel.8
@@ -109,9 +109,9 @@ argument forces
.Nm
to use a layout suitable for a different architecture.
Current valid values are
-.Cm i386 , amd64 ,
+.Cm i386
and
-.Cm pc98 .
+.Cm amd64 .
If this option is omitted,
.Nm
will use a layout suitable for the current machine.
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 072c4cfa0884..83df67ae0fe3 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -164,8 +164,7 @@ main(int argc, char *argv[])
break;
case 'm':
if (!strcmp(optarg, "i386") ||
- !strcmp(optarg, "amd64") ||
- !strcmp(optarg, "pc98")) {
+ !strcmp(optarg, "amd64")) {
labelsoffset = 1;
labeloffset = 0;
bbsize = 8192;
diff --git a/sbin/fdisk_pc98/Makefile b/sbin/fdisk_pc98/Makefile
deleted file mode 100644
index 7bfa0632612d..000000000000
--- a/sbin/fdisk_pc98/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-
-PACKAGE=runtime
-PROG= fdisk
-SRCS= fdisk.c geom_pc98_enc.c
-WARNS?= 4
-MAN= fdisk.8
-
-.PATH: ${.CURDIR}/../../sys/geom
-
-LIBADD= geom
-
-.include <bsd.prog.mk>
diff --git a/sbin/fdisk_pc98/Makefile.depend b/sbin/fdisk_pc98/Makefile.depend
deleted file mode 100644
index 2df49d098af1..000000000000
--- a/sbin/fdisk_pc98/Makefile.depend
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/libgcc \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libgeom \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/sbin/fdisk_pc98/fdisk.8 b/sbin/fdisk_pc98/fdisk.8
deleted file mode 100644
index eea55590baa9..000000000000
--- a/sbin/fdisk_pc98/fdisk.8
+++ /dev/null
@@ -1,486 +0,0 @@
-.\" $FreeBSD$
-.\"
-.Dd October 5, 2016
-.Dt FDISK 8
-.Os
-.Sh NAME
-.Nm fdisk
-.Nd NEC PC-98x1 slice table maintenance utility
-.Sh SYNOPSIS
-.Nm
-.Op Fl BIaistuv
-.Op Fl 12345678
-.Op Ar disk
-.Nm
-.Fl f Ar configfile
-.Op Fl itv
-.Op Ar disk
-.Sh PROLOGUE
-In order for the BIOS to boot the kernel,
-certain conventions must be adhered to.
-Sector 0 of the disk must contain boot code,
-a slice table,
-and a magic number.
-BIOS slices can be used to break the disk up into several pieces.
-The BIOS brings in sector 0 and verifies the magic number.
-The sector
-0 boot code then searches the slice table to determine which
-slice is marked
-.Dq active .
-This boot code then brings in the bootstrap from the
-active slice and, if marked bootable, runs it.
-Under
-.Tn DOS ,
-you can have one or more slices with one active.
-The
-.Tn DOS
-.Nm
-utility can be used to divide space on the disk into slices and set one
-active.
-.Sh DESCRIPTION
-The
-.Fx
-utility,
-.Nm ,
-serves a similar purpose to the
-.Tn DOS
-utility.
-The first form is used to
-display slice information or to interactively edit the slice
-table.
-The second is used to write a slice table using a
-.Ar configfile ,
-and is designed to be used by other scripts/programs.
-.Pp
-Options are:
-.Bl -tag -width indent
-.It Fl a
-Change the active slice only.
-Ignored if
-.Fl f
-is given.
-.It Fl B
-Reinitialize the boot code contained in sector 0 of the disk.
-Ignored if
-.Fl f
-is given.
-.It Fl f Ar configfile
-Set slice values using the file
-.Ar configfile .
-The
-.Ar configfile
-always modifies existing slices, unless
-.Fl i
-is also given, in which case all existing slices are deleted (marked
-as
-.Dq unused )
-before the
-.Ar configfile
-is read.
-The
-.Ar configfile
-can be
-.Sq Fl ,
-in which case standard input is read.
-See
-.Sx CONFIGURATION FILE ,
-below, for file syntax.
-.Pp
-.Em WARNING :
-when
-.Fl f
-is used, you are not asked if you really want to write the slices
-table (as you are in the interactive mode).
-Use with caution!
-.It Fl i
-Initialize sector 0 of the disk.
-This implies
-.Fl u ,
-unless
-.Fl f
-is given.
-.It Fl I
-Initialize sector 0 slice table
-for one
-.Fx
-slice covering the entire disk.
-Some space at the start of the disk will reserved for the IPL program
-and the pc98 slice table itself.
-.It Fl s
-Print summary information and exit.
-.It Fl t
-Test mode; do not write slice values.
-Generally used with the
-.Fl f
-option to see what would be written to the slice table.
-Implies
-.Fl v .
-.It Fl u
-Update (edit) the disk's sector 0 slice table.
-Ignored if
-.Fl f
-is given.
-.It Fl v
-Be verbose.
-Slices that are unused are suppressed unless this flag is specified.
-When
-.Fl f
-is used,
-.Nm
-prints out the slice table that is written to the disk.
-.It Fl 12345678
-Operate on a single slice table entry only.
-Ignored if
-.Fl f
-is given.
-.El
-.Pp
-The final disk name can be provided as a
-.Dq bare
-disk name only, e.g.\&
-.Pa da0 ,
-or as a full pathname.
-If omitted,
-.Nm
-tries to figure out the default disk device name from the
-mounted root device.
-.Pp
-When called with no arguments, it prints the sector 0 slice table.
-An example follows:
-.Bd -literal
- ******* Working on device /dev/da0 *******
- parameters extracted from in-core disklabel are:
- cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
-
- parameters to be used for BIOS calculations are:
- cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
-
- Media sector size is 512
- Warning: BIOS sector numbering starts with sector 1
- Information from DOS bootblock is:
- The data for partition 1 is:
- sysmid 148,(FreeBSD/NetBSD/386BSD)
- start 256, size 2490112 (1215 Meg), sid 196
- beg: cyl 1/ sector 0/ head 0;
- end: cyl 9727/ sector 0/ head 0
- system Name FreeBSD(98)
- The data for partition 2 is:
- sysmid 148,(FreeBSD/NetBSD/386BSD)
- start 2490368, size 5505024 (2688 Meg), sid 196
- beg: cyl 9728/ sector 0/ head 0;
- end: cyl 31231/ sector 0/ head 0
- system Name FreeBSD(98)
- The data for partition 3 is:
- <UNUSED>
- The data for partition 4 is:
- <UNUSED>
- The data for partition 5 is:
- <UNUSED>
- The data for partition 6 is:
- <UNUSED>
- The data for partition 7 is:
- <UNUSED>
- The data for partition 8 is:
- <UNUSED>
- The data for partition 9 is:
- <UNUSED>
- The data for partition 10 is:
- <UNUSED>
- The data for partition 11 is:
- <UNUSED>
- The data for partition 12 is:
- <UNUSED>
- The data for partition 13 is:
- <UNUSED>
- The data for partition 14 is:
- <UNUSED>
- The data for partition 15 is:
- <UNUSED>
- The data for partition 16 is:
- <UNUSED>
-.Ed
-.Pp
-The disk is divided into three slices that happen to fill the disk.
-The second slice overlaps the end of the first.
-(Used for debugging purposes.)
-.Bl -tag -width ".Em cyl , sector No and Em head"
-.It Em sysmid
-is used to label the slice.
-.Fx
-reserves the
-magic number 148 decimal (94 in hex).
-.It Xo
-.Em start
-and
-.Em size
-.Xc
-fields provide the start address
-and size of a slice in sectors.
-.It Xo
-.Em cyl , sector
-and
-.Em head
-.Xc
-fields are used to specify the beginning and end addresses of the slice.
-.It Em "system Name"
-is the name of the slice.
-.El
-.Pp
-.Em Note :
-these numbers are calculated using BIOS's understanding of the disk geometry
-and saved in the bootblock.
-.Pp
-The
-.Fl i
-and
-.Fl u
-flags are used to indicate that the slice data is to be updated.
-Unless the
-.Fl f
-option is also given,
-.Nm
-will enter a conversational mode.
-In this mode, no changes will be written to disk unless you explicitly tell
-.Nm
-to.
-.Pp
-The
-.Nm
-utility will display each slice and ask whether you want to edit it.
-If you say yes,
-.Nm
-will step through each field, show you the old value,
-and ask you for a new one.
-When you are done with the slice,
-.Nm
-will display it and ask you whether it is correct.
-It will then proceed to the next entry.
-.Pp
-Getting the
-.Em cyl , sector ,
-and
-.Em head
-fields correct is tricky, so by default,
-they will be calculated for you;
-you can specify them if you choose to though.
-.Pp
-After all the slices are processed,
-you are given the option to change the
-.Dq active
-slice.
-Finally, when all the new data for sector 0 has been accumulated,
-you are asked to confirm whether you really want to rewrite it.
-.Pp
-The difference between the
-.Fl u
-and
-.Fl i
-flags is that
-the
-.Fl u
-flag edits (updates) the existing slice parameters
-while the
-.Fl i
-flag is used to
-.Dq initialize
-them (old values will be ignored);
-it will setup the last BIOS slice to use the whole disk for
-.Fx ;
-and make it active.
-.Sh NOTES
-The automatic calculation of starting cylinder etc.\& uses
-a set of figures that represent what the BIOS thinks the
-geometry of the drive is.
-These figures are taken from the in-core disklabel by default,
-but
-.Nm
-initially gives you an opportunity to change them.
-This allows you to create a bootblock that can work with drives
-that use geometry translation under the BIOS.
-.Pp
-If you hand craft your disk layout,
-please make sure that the
-.Fx
-slice starts on a cylinder boundary.
-.Pp
-Editing an existing slice will most likely result in the loss of
-all data in that slice.
-.Pp
-You should run
-.Nm
-interactively once or twice to see how it works.
-This is completely safe as long as you answer the last question
-in the negative.
-There are subtleties that
-.Nm
-detects that are not fully explained in this manual page.
-.Sh CONFIGURATION FILE
-When the
-.Fl f
-option is given, a disk's slice table can be written using values
-from a
-.Ar configfile .
-The syntax of this file is very simple;
-each line is either a comment or a specification, as follows:
-.Bl -tag -width indent
-.It Ic # Ar comment ...
-Lines beginning with a
-.Ic #
-are comments and are ignored.
-.It Ic g Ar spec1 spec2 spec3
-Set the BIOS geometry used in slice calculations.
-There must be
-three values specified, with a letter preceding each number:
-.Bl -tag -width indent
-.It Cm c Ns Ar num
-Set the number of cylinders to
-.Ar num .
-.It Cm h Ns Ar num
-Set the number of heads to
-.Ar num .
-.It Cm s Ns Ar num
-Set the number of sectors/track to
-.Ar num .
-.El
-.Pp
-These specs can occur in any order, as the leading letter determines
-which value is which; however, all three must be specified.
-.Pp
-This line must occur before any lines that specify slice
-information.
-.Pp
-It is an error if the following is not true:
-.Bd -literal -offset indent
-1 <= number of cylinders
-1 <= number of heads <= 256
-1 <= number of sectors/track < 64
-.Ed
-.Pp
-The number of cylinders should be less than or equal to 1024, but this
-is not enforced, although a warning will be printed.
-Note that bootable
-.Fx
-slices (the
-.Dq Pa /
-file system) must lie completely within the
-first 1024 cylinders; if this is not true, booting may fail.
-Non-bootable slices do not have this restriction.
-.Pp
-Example (all of these are equivalent), for a disk with 1019 cylinders,
-39 heads, and 63 sectors:
-.Bd -literal -offset indent
-g c1019 h39 s63
-g h39 c1019 s63
-g s63 h39 c1019
-.Ed
-.It Ic p Ar slice type start length
-Set the slice given by
-.Ar slice
-(1-8) to type
-.Ar type ,
-starting at sector
-.Ar start
-for
-.Ar length
-sectors.
-.Pp
-Only those slices explicitly mentioned by these lines are modified;
-any slice not referenced by a
-.Ic p
-line will not be modified.
-However, if an invalid slice table is present, or the
-.Fl i
-option is specified, all existing slice entries will be cleared
-(marked as unused), and these
-.Ic p
-lines will have to be used to
-explicitly set slice information.
-If multiple slices need to be
-set, multiple
-.Ic p
-lines must be specified; one for each slice.
-.Pp
-These slice lines must occur after any geometry specification lines,
-if one is present.
-.Pp
-The
-.Ar type
-is 165 for
-.Fx
-slices.
-Specifying a slice type of zero is
-the same as clearing the slice and marking it as unused; however,
-dummy values (such as
-.Dq 0 )
-must still be specified for
-.Ar start
-and
-.Ar length .
-.Pp
-Note: the start offset will be rounded upwards to a head boundary if
-necessary, and the end offset will be rounded downwards to a cylinder
-boundary if necessary.
-.Pp
-Example: to clear slice 4 and mark it as unused:
-.Pp
-.Dl "p 4 0 0 0"
-.Pp
-Example: to set slice 1 to a
-.Fx
-slice, starting at sector 1
-for 2503871 sectors (note: these numbers will be rounded upwards and
-downwards to correspond to head and cylinder boundaries):
-.Pp
-.Dl "p 1 165 1 2503871"
-.It Ic a Ar slice
-Make
-.Ar slice
-the active slice.
-Can occur anywhere in the config file, but only
-one must be present.
-.Pp
-Example: to make slice 1 the active slice:
-.Pp
-.Dl "a 1"
-.El
-.Sh SEE ALSO
-.Xr boot98cfg 8 ,
-.Xr bsdlabel 8 ,
-.Xr gpart 8 ,
-.Xr newfs 8
-.Sh HISTORY
-A version of
-.Nm
-first appeared in the Mach Operating System.
-It was subsequently ported to
-.Bx 386 .
-.Sh AUTHORS
-.An -nosplit
-.Nm
-for Mach Operating System was written by
-.An Robert Baron Aq Mt rvb@cs.cmu.edu .
-It was ported to
-.Bx 386
-by
-.An Julian Elischer Aq Mt julian@tfs.com .
-.Sh BUGS
-The default boot code will not necessarily handle all slice types
-correctly, in particular those introduced since
-.Tn MS-DOS
-6.x.
-.Pp
-The entire utility should be made more user-friendly.
-.Pp
-Most users new to
-.Fx
-do not understand the difference between
-.Dq slice
-and
-.Dq partition ,
-causing difficulty to adjust.
-.Pp
-You cannot use this command to completely dedicate a disk to
-.Fx .
-The
-.Xr bsdlabel 8
-command must be used for this.
diff --git a/sbin/fdisk_pc98/fdisk.c b/sbin/fdisk_pc98/fdisk.c
deleted file mode 100644
index 7b840535df80..000000000000
--- a/sbin/fdisk_pc98/fdisk.c
+++ /dev/null
@@ -1,910 +0,0 @@
-/*
- * Mach Operating System
- * Copyright (c) 1992 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/disk.h>
-#include <sys/disklabel.h>
-#include <sys/diskpc98.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/mount.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <err.h>
-#include <errno.h>
-#include <libgeom.h>
-#include <paths.h>
-#include <regex.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-int iotest;
-
-#define LBUF 100
-static char lbuf[LBUF];
-
-/*
- *
- * Ported to 386bsd by Julian Elischer Thu Oct 15 20:26:46 PDT 1992
- *
- * 14-Dec-89 Robert Baron (rvb) at Carnegie-Mellon University
- * Copyright (c) 1989 Robert. V. Baron
- * Created.
- */
-
-#define Decimal(str, ans, tmp) if (decimal(str, &tmp, ans)) ans = tmp
-#define String(str, ans, len) {char *z = ans; char **dflt = &z; if (string(str, dflt)) strncpy(ans, *dflt, len); }
-
-#define MAX_SEC_SIZE 2048 /* maximum section size that is supported */
-#define MIN_SEC_SIZE 512 /* the sector size to start sensing at */
-static int secsize = 0; /* the sensed sector size */
-
-static char *disk;
-
-static int cyls, sectors, heads, cylsecs, disksecs;
-
-struct mboot {
- unsigned char padding[2]; /* force the longs to be long aligned */
- unsigned char bootinst[510];
- unsigned short int signature;
- struct pc98_partition parts[8];
- unsigned char large_sector_overflow[MAX_SEC_SIZE-MIN_SEC_SIZE];
-};
-
-static struct mboot mboot;
-static int fd;
-
-static uint dos_cyls;
-static uint dos_heads;
-static uint dos_sectors;
-static uint dos_cylsecs;
-
-#define MAX_ARGS 10
-
-typedef struct cmd {
- char cmd;
- int n_args;
- struct arg {
- char argtype;
- int arg_val;
- } args[MAX_ARGS];
-} CMD;
-
-static int B_flag = 0; /* replace boot code */
-static int I_flag = 0; /* Inizialize disk to defaults */
-static int a_flag = 0; /* set active partition */
-static int i_flag = 0; /* replace partition data */
-static int u_flag = 0; /* update partition data */
-static int s_flag = 0; /* Print a summary and exit */
-static int t_flag = 0; /* test only */
-static char *f_flag = NULL; /* Read config info from file */
-static int v_flag = 0; /* Be verbose */
-
-static struct part_type
-{
- unsigned char type;
- const char *name;
-} part_types[] = {
- {0x00, "unused"}
- ,{0x01, "Primary DOS with 12 bit FAT"}
- ,{0x11, "MSDOS"}
- ,{0x20, "MSDOS"}
- ,{0x21, "MSDOS"}
- ,{0x22, "MSDOS"}
- ,{0x23, "MSDOS"}
- ,{0x02, "XENIX / file system"}
- ,{0x03, "XENIX /usr file system"}
- ,{0x04, "PC-UX"}
- ,{0x05, "Extended DOS"}
- ,{0x06, "Primary 'big' DOS (> 32MB)"}
- ,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
- ,{0x08, "AIX file system"}
- ,{0x09, "AIX boot partition or Coherent"}
- ,{0x0A, "OS/2 Boot Manager or OPUS"}
- ,{0x10, "OPUS"}
- ,{0x14, "FreeBSD/NetBSD/386BSD"}
- ,{0x94, "FreeBSD/NetBSD/386BSD"}
- ,{0x40, "VENIX 286"}
- ,{0x50, "DM"}
- ,{0x51, "DM"}
- ,{0x52, "CP/M or Microport SysV/AT"}
- ,{0x56, "GB"}
- ,{0x61, "Speed"}
- ,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
- ,{0x64, "Novell Netware 2.xx"}
- ,{0x65, "Novell Netware 3.xx"}
- ,{0x75, "PCIX"}
- ,{0x40, "Minix"}
-};
-
-static void print_s0(int which);
-static void print_part(int i);
-static void init_sector0(unsigned long start);
-static void init_boot(void);
-static void change_part(int i, int force);
-static void print_params(void);
-static void change_active(int which);
-static void change_code(void);
-static void get_params_to_use(void);
-static char *get_rootdisk(void);
-static void dos(u_int32_t start, u_int32_t size, struct pc98_partition *partp);
-static int open_disk(int flag);
-static ssize_t read_disk(off_t sector, void *buf);
-static int write_disk(off_t sector, void *buf);
-static int get_params(void);
-static int read_s0(void);
-static int write_s0(void);
-static int ok(const char *str);
-static int decimal(const char *str, int *num, int deflt);
-static const char *get_type(int type);
-static void usage(void);
-static int string(const char *str, char **ans);
-static void reset_boot(void);
-
-int
-main(int argc, char *argv[])
-{
- struct stat sb;
- int c, i;
- int partition = -1;
- struct pc98_partition *partp;
-
- while ((c = getopt(argc, argv, "BIa:f:istuv12345678")) != -1)
- switch (c) {
- case 'B':
- B_flag = 1;
- break;
- case 'I':
- I_flag = 1;
- break;
- case 'a':
- a_flag = 1;
- break;
- case 'f':
- f_flag = optarg;
- break;
- case 'i':
- i_flag = 1;
- break;
- case 's':
- s_flag = 1;
- break;
- case 't':
- t_flag = 1;
- break;
- case 'u':
- u_flag = 1;
- break;
- case 'v':
- v_flag = 1;
- break;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- partition = c - '0';
- break;
- default:
- usage();
- }
- if (f_flag || i_flag)
- u_flag = 1;
- if (t_flag)
- v_flag = 1;
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- disk = get_rootdisk();
- } else {
- if (stat(argv[0], &sb) == 0) {
- /* OK, full pathname given */
- disk = argv[0];
- } else if (errno == ENOENT && argv[0][0] != '/') {
- /* Try prepending "/dev" */
- asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
- if (disk == NULL)
- errx(1, "out of memory");
- } else {
- /* other stat error, let it fail below */
- disk = argv[0];
- }
- }
- if (open_disk(u_flag) < 0)
- err(1, "cannot open disk %s", disk);
-
- if (s_flag) {
- if (read_s0())
- err(1, "read_s0");
- printf("%s: %d cyl %d hd %d sec\n", disk, dos_cyls, dos_heads,
- dos_sectors);
- printf("Part %11s %11s %4s %4s %-16s\n", "Start", "Size", "MID",
- "SID", "Name");
- for (i = 0; i < PC98_NPARTS; i++) {
- partp = ((struct pc98_partition *) &mboot.parts) + i;
- if (partp->dp_sid == 0)
- continue;
- printf("%4d: %11u %11u 0x%02x 0x%02x %-16.16s\n", i + 1,
- partp->dp_scyl * cylsecs,
- (partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs,
- partp->dp_mid, partp->dp_sid, partp->dp_name);
- }
- exit(0);
- }
-
- printf("******* Working on device %s *******\n",disk);
-
- if (I_flag) {
- read_s0();
- reset_boot();
- partp = (struct pc98_partition *) (&mboot.parts[0]);
- partp->dp_mid = DOSMID_386BSD;
- partp->dp_sid = DOSSID_386BSD;
- strncpy(partp->dp_name, "FreeBSD", sizeof(partp->dp_name));
- /* Start c/h/s. */
- partp->dp_scyl = partp->dp_ipl_cyl = 1;
- partp->dp_shd = partp->dp_ipl_head = 1;
- partp->dp_ssect = partp->dp_ipl_sct = 0;
-
- /* End c/h/s. */
- partp->dp_ecyl = dos_cyls - 1;
- partp->dp_ehd = dos_cylsecs / dos_sectors;
- partp->dp_esect = dos_sectors;
-
- if (v_flag)
- print_s0(-1);
- if (!t_flag)
- write_s0();
- exit(0);
- }
-
- if (f_flag) {
- if (v_flag)
- print_s0(-1);
- if (!t_flag)
- write_s0();
- } else {
- if(u_flag)
- get_params_to_use();
- else
- print_params();
-
- if (read_s0())
- init_sector0(dos_sectors);
-
- printf("Media sector size is %d\n", secsize);
- printf("Warning: BIOS sector numbering starts with sector 1\n");
- printf("Information from DOS bootblock is:\n");
- if (partition == -1)
- for (i = 1; i <= PC98_NPARTS; i++)
- change_part(i, v_flag);
- else
- change_part(partition, 1);
-
- if (u_flag || a_flag)
- change_active(partition);
-
- if (B_flag)
- change_code();
-
- if (u_flag || a_flag || B_flag) {
- if (!t_flag) {
- printf("\nWe haven't changed the partition table yet. ");
- printf("This is your last chance.\n");
- }
- print_s0(-1);
- if (!t_flag) {
- if (ok("Should we write new partition table?"))
- write_s0();
- } else {
- printf("\n-t flag specified -- partition table not written.\n");
- }
- }
- }
-
- exit(0);
-}
-
-static void
-usage()
-{
- fprintf(stderr, "%s%s",
- "usage: fdisk [-BIaistu] [-12345678] [disk]\n",
- " fdisk -f configfile [-itv] [disk]\n");
- exit(1);
-}
-
-static struct pc98_partition mtpart;
-
-static int
-part_unused(int i)
-{
- struct pc98_partition *partp;
-
- partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
- return (bcmp(partp, &mtpart, sizeof (struct pc98_partition)) == 0);
-}
-
-static void
-print_s0(int which)
-{
- int i;
-
- print_params();
- printf("Information from DOS bootblock is:\n");
- if (which == -1) {
- for (i = 1; i <= PC98_NPARTS; i++)
- if (v_flag || !part_unused(i)) {
- printf("%d: ", i);
- print_part(i);
- }
- }
- else
- print_part(which);
-}
-
-static void
-print_part(int i)
-{
- struct pc98_partition *partp;
- u_int64_t part_sz, part_mb;
-
- if (part_unused(i)) {
- printf("<UNUSED>\n");
- return;
- }
- /*
- * Be careful not to overflow.
- */
- partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
- part_sz = (partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs;
- part_mb = part_sz * secsize;
- part_mb /= (1024 * 1024);
- printf("sysmid %d (%#04x),(%s)\n", partp->dp_mid, partp->dp_mid,
- get_type(partp->dp_mid));
- printf(" start %lu, size %lu (%ju Meg), sid %d\n",
- (u_long)(partp->dp_scyl * cylsecs), (u_long)part_sz,
- (uintmax_t)part_mb, partp->dp_sid);
- printf("\tbeg: cyl %d/ head %d/ sector %d;\n\tend: cyl %d/ head %d/ sector %d\n"
- ,partp->dp_scyl
- ,partp->dp_shd
- ,partp->dp_ssect
- ,partp->dp_ecyl
- ,partp->dp_ehd
- ,partp->dp_esect);
- printf ("\tsystem Name %.16s\n", partp->dp_name);
-}
-
-
-static void
-init_boot(void)
-{
-
- mboot.signature = PC98_MAGIC;
-}
-
-
-static void
-init_sector0(unsigned long start)
-{
- struct pc98_partition *partp =
- (struct pc98_partition *)(&mboot.parts[0]);
-
- init_boot();
-
- partp->dp_mid = DOSMID_386BSD;
- partp->dp_sid = DOSSID_386BSD;
-
- dos(start, disksecs - start, partp);
-}
-
-static void
-change_part(int i, int force)
-{
- struct pc98_partition *partp =
- ((struct pc98_partition *) &mboot.parts) + i - 1;
-
- if (!force && part_unused(i))
- return;
-
- printf("The data for partition %d is:\n", i);
- print_part(i);
-
- if (u_flag && ok("Do you want to change it?")) {
- int tmp;
-
- if (i_flag) {
- bzero((char *)partp, sizeof (struct pc98_partition));
- if (i == 1) {
- init_sector0(1);
- printf("\nThe static data for the slice 1 has been reinitialized to:\n");
- print_part(i);
- }
- }
- do {
- int x_start = partp->dp_scyl * cylsecs ;
- int x_size = (partp->dp_ecyl - partp->dp_scyl + 1) * cylsecs;
- Decimal("sysmid", partp->dp_mid, tmp);
- Decimal("syssid", partp->dp_sid, tmp);
- String ("system name", partp->dp_name, 16);
- Decimal("start", x_start, tmp);
- Decimal("size", x_size, tmp);
-
- if (ok("Explicitly specify beg/end address ?"))
- {
- int tsec,tcyl,thd;
- tcyl = partp->dp_scyl;
- thd = partp->dp_shd;
- tsec = partp->dp_ssect;
- Decimal("beginning cylinder", tcyl, tmp);
- Decimal("beginning head", thd, tmp);
- Decimal("beginning sector", tsec, tmp);
- partp->dp_scyl = tcyl;
- partp->dp_ssect = tsec;
- partp->dp_shd = thd;
- partp->dp_ipl_cyl = partp->dp_scyl;
- partp->dp_ipl_sct = partp->dp_ssect;
- partp->dp_ipl_head = partp->dp_shd;
-
- tcyl = partp->dp_ecyl;
- thd = partp->dp_ehd;
- tsec = partp->dp_esect;
- Decimal("ending cylinder", tcyl, tmp);
- Decimal("ending head", thd, tmp);
- Decimal("ending sector", tsec, tmp);
- partp->dp_ecyl = tcyl;
- partp->dp_esect = tsec;
- partp->dp_ehd = thd;
- } else
- dos(x_start, x_size, partp);
-
- print_part(i);
- } while (!ok("Are we happy with this entry?"));
- }
-}
-
-static void
-print_params()
-{
- printf("parameters extracted from in-core disklabel are:\n");
- printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n"
- ,cyls,heads,sectors,cylsecs);
- if (dos_cyls > 65535 || dos_heads > 255 || dos_sectors > 255)
- printf("Figures below won't work with BIOS for partitions not in cyl 1\n");
- printf("parameters to be used for BIOS calculations are:\n");
- printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n"
- ,dos_cyls,dos_heads,dos_sectors,dos_cylsecs);
-}
-
-static void
-change_active(int which)
-{
- struct pc98_partition *partp = &mboot.parts[0];
- int active, i, new, tmp;
-
- active = -1;
- for (i = 0; i < PC98_NPARTS; i++) {
- if ((partp[i].dp_sid & PC98_SID_ACTIVE) == 0)
- continue;
- printf("Partition %d is marked active\n", i + 1);
- if (active == -1)
- active = i + 1;
- }
- if (a_flag && which != -1)
- active = which;
- else if (active == -1)
- active = 1;
-
- if (!ok("Do you want to change the active partition?"))
- return;
-setactive:
- do {
- new = active;
- Decimal("active partition", new, tmp);
- if (new < 1 || new > 8) {
- printf("Active partition number must be in range 1-8."
- " Try again.\n");
- goto setactive;
- }
- active = new;
- } while (!ok("Are you happy with this choice"));
- if (active > 0 && active <= 8)
- partp[active-1].dp_sid |= PC98_SID_ACTIVE;
-}
-
-static void
-change_code()
-{
- if (ok("Do you want to change the boot code?"))
- init_boot();
-}
-
-void
-get_params_to_use()
-{
- int tmp;
- print_params();
- if (ok("Do you want to change our idea of what BIOS thinks ?"))
- {
- do
- {
- Decimal("BIOS's idea of #cylinders", dos_cyls, tmp);
- Decimal("BIOS's idea of #heads", dos_heads, tmp);
- Decimal("BIOS's idea of #sectors", dos_sectors, tmp);
- dos_cylsecs = dos_heads * dos_sectors;
- print_params();
- }
- while(!ok("Are you happy with this choice"));
- }
-}
-
-
-/***********************************************\
-* Change real numbers into strange dos numbers *
-\***********************************************/
-static void
-dos(u_int32_t start, u_int32_t size, struct pc98_partition *partp)
-{
- u_int32_t end;
-
- if (partp->dp_mid == 0 && partp->dp_sid == 0 &&
- start == 0 && size == 0) {
- memcpy(partp, &mtpart, sizeof(*partp));
- return;
- }
-
- /* Start c/h/s. */
- partp->dp_scyl = partp->dp_ipl_cyl = start / dos_cylsecs;
- partp->dp_shd = partp->dp_ipl_head = start % dos_cylsecs / dos_sectors;
- partp->dp_ssect = partp->dp_ipl_sct = start % dos_sectors;
-
- /* End c/h/s. */
- end = start + size - cylsecs;
- partp->dp_ecyl = end / dos_cylsecs;
- partp->dp_ehd = end % dos_cylsecs / dos_sectors;
- partp->dp_esect = end % dos_sectors;
-}
-
-static int
-open_disk(int flag)
-{
- struct stat st;
- int rwmode;
-
- if (stat(disk, &st) == -1) {
- if (errno == ENOENT)
- return -2;
- warnx("can't get file status of %s", disk);
- return -1;
- }
- if ( !(st.st_mode & S_IFCHR) )
- warnx("device %s is not character special", disk);
- rwmode = I_flag || a_flag || B_flag || flag ? O_RDWR : O_RDONLY;
- fd = open(disk, rwmode);
- if (fd == -1 && errno == EPERM && rwmode == O_RDWR)
- fd = open(disk, O_RDONLY);
- if (fd == -1 && errno == ENXIO)
- return -2;
- if (fd == -1) {
- warnx("can't open device %s", disk);
- return -1;
- }
- if (get_params() == -1) {
- warnx("can't get disk parameters on %s", disk);
- return -1;
- }
- return fd;
-}
-
-static ssize_t
-read_disk(off_t sector, void *buf)
-{
-
- lseek(fd, (sector * 512), 0);
- return read(fd, buf,
- secsize > MIN_SEC_SIZE ? secsize : MIN_SEC_SIZE * 2);
-}
-
-static int
-write_disk(off_t sector, void *buf)
-{
- int error;
- struct gctl_req *grq;
- const char *q;
- char fbuf[BUFSIZ];
- int i, fdw, sz;
-
- sz = secsize > MIN_SEC_SIZE ? secsize : MIN_SEC_SIZE * 2;
- grq = gctl_get_handle();
- gctl_ro_param(grq, "verb", -1, "write PC98");
- gctl_ro_param(grq, "class", -1, "PC98");
- q = strrchr(disk, '/');
- if (q == NULL)
- q = disk;
- else
- q++;
- gctl_ro_param(grq, "geom", -1, q);
- gctl_ro_param(grq, "data", sz, buf);
- q = gctl_issue(grq);
- if (q == NULL) {
- gctl_free(grq);
- return(0);
- }
- warnx("Geom problem: %s", q);
- gctl_free(grq);
-
- warnx("Warning: Partitioning via geom failed, trying raw write");
- error = pwrite(fd, buf, sz, sector * 512);
- if (error == sz)
- return (0);
-
- for (i = 0; i < PC98_NPARTS; i++) {
- sprintf(fbuf, "%ss%d", disk, i + 1);
- fdw = open(fbuf, O_RDWR, 0);
- if (fdw < 0)
- continue;
- error = ioctl(fdw, DIOCSPC98, buf);
- close(fdw);
- if (error == 0)
- return (0);
- }
- warnx("Failed to write sector zero");
- return(EINVAL);
-}
-
-static int
-get_params()
-{
- int error;
- u_int u;
- off_t o;
-
- error = ioctl(fd, DIOCGFWSECTORS, &u);
- if (error == 0)
- sectors = dos_sectors = u;
- else
- sectors = dos_sectors = 17;
-
- error = ioctl(fd, DIOCGFWHEADS, &u);
- if (error == 0)
- heads = dos_heads = u;
- else
- heads = dos_heads = 8;
-
- dos_cylsecs = cylsecs = heads * sectors;
- disksecs = cyls * heads * sectors;
-
- error = ioctl(fd, DIOCGSECTORSIZE, &u);
- if (error != 0 || u == 0)
- u = 512;
- secsize = u;
-
- error = ioctl(fd, DIOCGMEDIASIZE, &o);
- if (error == 0) {
- disksecs = o / u;
- cyls = dos_cyls = o / (u * dos_heads * dos_sectors);
- }
-
- return (disksecs);
-}
-
-
-static int
-read_s0()
-{
-
- if (read_disk(0, (char *) mboot.bootinst) == -1) {
- warnx("can't read fdisk partition table");
- return -1;
- }
- if (mboot.signature != PC98_MAGIC) {
- warnx("invalid fdisk partition table found");
- /* So should we initialize things */
- return -1;
- }
-
- return 0;
-}
-
-static int
-write_s0()
-{
-
- if (iotest) {
- print_s0(-1);
- return 0;
- }
-
- /*
- * write enable label sector before write (if necessary),
- * disable after writing.
- * needed if the disklabel protected area also protects
- * sector 0. (e.g. empty disk)
- */
- if (write_disk(0, (char *) mboot.bootinst) == -1) {
- warn("can't write fdisk partition table");
- return -1;
- }
-
- return(0);
-}
-
-
-static int
-ok(const char *str)
-{
- printf("%s [n] ", str);
- fflush(stdout);
- if (fgets(lbuf, LBUF, stdin) == NULL)
- exit(1);
- lbuf[strlen(lbuf)-1] = 0;
-
- if (*lbuf &&
- (!strcmp(lbuf, "yes") || !strcmp(lbuf, "YES") ||
- !strcmp(lbuf, "y") || !strcmp(lbuf, "Y")))
- return 1;
- else
- return 0;
-}
-
-static int
-decimal(const char *str, int *num, int deflt)
-{
- int acc = 0, c;
- char *cp;
-
- while (1) {
- printf("Supply a decimal value for \"%s\" [%d] ", str, deflt);
- fflush(stdout);
- if (fgets(lbuf, LBUF, stdin) == NULL)
- exit(1);
- lbuf[strlen(lbuf)-1] = 0;
-
- if (!*lbuf)
- return 0;
-
- cp = lbuf;
- while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
- if (!c)
- return 0;
- while ((c = *cp++)) {
- if (c <= '9' && c >= '0')
- acc = acc * 10 + c - '0';
- else
- break;
- }
- if (c == ' ' || c == '\t')
- while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
- if (!c) {
- *num = acc;
- return 1;
- } else
- printf("%s is an invalid decimal number. Try again.\n",
- lbuf);
- }
-
-}
-
-static int
-string(const char *str, char **ans)
-{
- int i, c;
- char *cp = lbuf;
-
- while (1) {
- printf("Supply a string value for \"%s\" [%s] ", str, *ans);
- fgets(lbuf, LBUF, stdin);
- lbuf[strlen(lbuf)-1] = 0;
-
- if (!*lbuf)
- return 0;
-
- while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
- if (c == '"') {
- c = *++cp;
- *ans = cp;
- while ((c = *cp) && c != '"') cp++;
- } else {
- *ans = cp;
- while ((c = *cp) && c != ' ' && c != '\t') cp++;
- }
-
- for (i = strlen(*ans); i < 16; i++)
- (*ans)[i] = ' ';
- (*ans)[16] = 0;
-
- return 1;
- }
-}
-
-static const char *
-get_type(int type)
-{
- size_t i;
-
- for (i = 0; i < nitems(part_types); i++)
- if (part_types[i].type == (type & 0x7f))
- return(part_types[i].name);
- return("unknown");
-}
-
-/*
- * Try figuring out the root device's canonical disk name.
- * The following choices are considered:
- * /dev/ad0s1a => /dev/ad0
- * /dev/da0a => /dev/da0
- * /dev/vinum/root => /dev/vinum/root
- */
-static char *
-get_rootdisk(void)
-{
- struct statfs rootfs;
- regex_t re;
-#define NMATCHES 2
- regmatch_t rm[NMATCHES];
- char *s;
- int rv;
-
- if (statfs("/", &rootfs) == -1)
- err(1, "statfs(\"/\")");
-
- if ((rv = regcomp(&re, "^(/dev/[a-z]+[0-9]+)([sp][0-9]+)?[a-h]?$",
- REG_EXTENDED)) != 0)
- errx(1, "regcomp() failed (%d)", rv);
- if ((rv = regexec(&re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0)
- errx(1,
-"mounted root fs resource doesn't match expectations (regexec returned %d)",
- rv);
- if ((s = malloc(rm[1].rm_eo - rm[1].rm_so + 1)) == NULL)
- errx(1, "out of memory");
- memcpy(s, rootfs.f_mntfromname + rm[1].rm_so,
- rm[1].rm_eo - rm[1].rm_so);
- s[rm[1].rm_eo - rm[1].rm_so] = 0;
-
- return s;
-}
-
-static void
-reset_boot(void)
-{
- int i;
- struct pc98_partition *partp;
-
- init_boot();
- for (i = 1; i <= PC98_NPARTS; i++) {
- partp = ((struct pc98_partition *) &mboot.parts) + i - 1;
- bzero((char *)partp, sizeof (struct pc98_partition));
- }
-}
diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8
index f9384ad9af53..7b81c21c933b 100644
--- a/sbin/geom/class/part/gpart.8
+++ b/sbin/geom/class/part/gpart.8
@@ -543,11 +543,6 @@ The
option enables backward compatibility for partition names
in the EBR scheme.
It also prevents any type of actions on such partitions.
-.It Cm PC98
-An MBR variant for NEC PC-98 and compatible computers.
-Requires the
-.Cm GEOM_PART_PC98
-kernel option.
.It Cm VTOC8
Sun's SMI Volume Table Of Contents, used by
.Tn SPARC64
@@ -945,12 +940,6 @@ The scheme-specific attributes for MBR:
.Bl -tag -width ".Cm active"
.It Cm active
.El
-.Pp
-The scheme-specific attributes for PC98:
-.Bl -tag -width ".Cm bootable"
-.It Cm active
-.It Cm bootable
-.El
.Sh BOOTSTRAPPING
.Fx
supports several partitioning schemes and each scheme uses different
diff --git a/share/examples/bootforth/frames.4th b/share/examples/bootforth/frames.4th
index 3b1f4046891f..4f1f9b812a03 100644
--- a/share/examples/bootforth/frames.4th
+++ b/share/examples/bootforth/frames.4th
@@ -12,49 +12,26 @@ variable rt_el
variable rb_el
variable fill
-s" arch-pc98" environment? [if]
- \ Single frames
- 149 constant sh_el
- 150 constant sv_el
- 152 constant slt_el
- 154 constant slb_el
- 153 constant srt_el
- 155 constant srb_el
- \ Double frames
- 149 constant dh_el
- 150 constant dv_el
- 152 constant dlt_el
- 154 constant dlb_el
- 153 constant drt_el
- 155 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 135 constant fill_dark
- 135 constant fill_med
- 135 constant fill_bright
-[else]
- \ Single frames
- 196 constant sh_el
- 179 constant sv_el
- 218 constant slt_el
- 192 constant slb_el
- 191 constant srt_el
- 217 constant srb_el
- \ Double frames
- 205 constant dh_el
- 186 constant dv_el
- 201 constant dlt_el
- 200 constant dlb_el
- 187 constant drt_el
- 188 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 176 constant fill_dark
- 177 constant fill_med
- 178 constant fill_bright
-[then]
+\ Single frames
+196 constant sh_el
+179 constant sv_el
+218 constant slt_el
+192 constant slb_el
+191 constant srt_el
+217 constant srb_el
+\ Double frames
+205 constant dh_el
+186 constant dv_el
+201 constant dlt_el
+200 constant dlb_el
+187 constant drt_el
+188 constant drb_el
+\ Fillings
+0 constant fill_none
+32 constant fill_blank
+176 constant fill_dark
+177 constant fill_med
+178 constant fill_bright
: hline ( len x y -- ) \ Draw horizontal single line
at-xy \ move cursor
diff --git a/share/man/man4/adv.4 b/share/man/man4/adv.4
index 366441d92572..0aaf93fff0ff 100644
--- a/share/man/man4/adv.4
+++ b/share/man/man4/adv.4
@@ -204,12 +204,6 @@ AdvanSys ABP950
AdvanSys ABP980, ABP980U
.It
AdvanSys ABP980UA/3980UA
-.It
-MELCO IFC-USP (PC-98)
-.It
-RATOC REX-PCI30 (PC-98)
-.It
-@Nifty FNECHARD IFC-USUP-TX (PC-98)
.El
.Sh SEE ALSO
.Xr adw 4 ,
diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4
index 3e47a8b21cf5..cbd3937184b3 100644
--- a/share/man/man4/ahc.4
+++ b/share/man/man4/ahc.4
@@ -349,14 +349,6 @@ Adaptec
Adaptec
.Tn 4944UW
.It
-NEC PC-9821Xt13 (PC-98)
-.It
-NEC RvII26 (PC-98)
-.It
-NEC PC-9821X-B02L/B09 (PC-98)
-.It
-NEC SV-98/2-B03 (PC-98)
-.It
Many motherboards with on-board
.Tn SCSI
support
diff --git a/share/man/man4/apic.4 b/share/man/man4/apic.4
index 2fb5b8cff521..1e7cc18070cd 100644
--- a/share/man/man4/apic.4
+++ b/share/man/man4/apic.4
@@ -32,7 +32,7 @@
.Nd Advanced Programmable Interrupt Controller (APIC) driver
.Sh SYNOPSIS
This driver is a mandatory part of amd64 kernel.
-To compile this driver into i386 or pc98 kernel,
+To compile this driver into i386 kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
diff --git a/share/man/man4/ed.4 b/share/man/man4/ed.4
index bfa5972d3d95..e7594c60c70a 100644
--- a/share/man/man4/ed.4
+++ b/share/man/man4/ed.4
@@ -133,12 +133,6 @@ Accton EN2212/EN2216/UE2216
.It
Allied Telesis CentreCOM LA100-PCM_V2
.It
-Allied Telesis LA-98 (flags 0x000000) (PC-98)
-.It
-Allied Telesis SIC-98, SIC-98NOTE (110pin), SIU-98 (flags 0x600000) (PC-98)
-.It
-Allied Telesis SIU-98-D (flags 0x610000) (PC-98)
-.It
AmbiCom 10BaseT card (8002, 8002T, 8010 and 8610)
.It
Bay Networks NETGEAR FA410TXC Fast Ethernet
@@ -163,12 +157,6 @@ Compex Net-A adapter
.It
Compex RL2000
.It
-Contec C-NET(98), RT-1007(98), C-NET(9N) (110pin) (flags 0xa00000) (PC-98)
-.It
-Contec C-NET(98)E-A, C-NET(98)L-A, C-NET(98)P (flags 0x300000) (PC-98)
-.It
-Corega Ether98-T (flags 0x000000) (PC-98)
-.It
Corega Ether PCC-T/EtherII PCC-T/FEther PCC-TXF/PCC-TXD PCC-T/Fether II TXD
.It
Corega LAPCCTXD (TC5299J)
@@ -179,16 +167,10 @@ DEC EtherWorks DE305
.It
Danpex EN-6200P2
.It
-D-Link DE-298, DE-298P (flags 0x500000) (PC-98)
-.It
D-Link DE-660, DE-660+
.It
D-Link IC-CARD/IC-CARD+ Ethernet
.It
-ELECOM LD-98P (flags 0x500000) (PC-98)
-.It
-ELECOM LD-BDN, LD-NW801G (flags 0x200000) (PC-98)
-.It
ELECOM Laneed LD-CDL/TX, LD-CDF, LD-CDS, LD-10/100CD, LD-CDWA (DP83902A)
.It
Hawking PN652TX PC Card (AX88790)
@@ -198,17 +180,10 @@ HP PC Lan+ 27247B and 27252A
.It
IBM Creditcard Ethernet I/II
.It
-ICM AD-ET2-T, DT-ET-25, DT-ET-T5, IF-2766ET, IF-2771ET, NB-ET-T (110pin)
-(flags 0x500000) (PC-98)
-.It
-I-O DATA LA/T-98, LA/T-98SB, LA2/T-98, ET/T-98 (flags 0x900000) (PC-98)
-.It
I-O DATA ET2/T-PCI
.It
I-O DATA PCLATE
.It
-Kansai KLA-98C/T (flags 0x900000) (PC-98)
-.It
Kingston KNE-PC2, CIO10T, KNE-PCM/x Ethernet
.It
KTI ET32P2 PCI
@@ -217,28 +192,14 @@ Linksys EC2T/PCMPC100/PCM100, PCMLM56
.It
Linksys EtherFast 10/100 PC Card, Combo PCMCIA Ethernet Card (PCMPC100 V2)
.It
-Logitec LAN-98T (flags 0xb00000) (PC-98)
-.It
MACNICA Ethernet ME1 for JEIDA
.It
-MACNICA ME98 (flags 0x900000) (PC-98)
-.It
-MACNICA NE2098 (flags 0x400000) (PC-98)
-.It
-MELCO EGY-98 (flags 0x300000) (PC-98)
-.It
-MELCO LGH-98, LGY-98, LGY-98-N (110pin), IND-SP, IND-SS (flags 0x400000) (PC-98)
-.It
MELCO LGY-PCI-TR
.It
MELCO LPC-T/LPC2-T/LPC2-CLT/LPC2-TX/LPC3-TX/LPC3-CLX
.It
NDC Ethernet Instant-Link
.It
-NEC PC-9801-77, PC-9801-78 (flags 0x910000) (PC-98)
-.It
-NEC PC-9801-107, PC-9801-108 (flags 0x800000) (PC-98)
-.It
National Semiconductor InfoMover NE4100
.It
NetGear FA-410TX
@@ -247,10 +208,6 @@ NetVin NV5000SC
.It
Network Everywhere Ethernet 10BaseT PC Card
.It
-Networld 98X3 (flags 0xd00000) (PC-98)
-.It
-Networld EC-98X, EP-98X (flags 0xd10000) (PC-98)
-.It
New Media LANSurfer 10+56 Ethernet/Modem
.It
New Media LANSurfer
@@ -259,10 +216,6 @@ Novell NE1000/NE2000/NE2100
.It
PLANEX ENW-8300-T
.It
-PLANEX EN-2298-C (flags 0x200000) (PC-98)
-.It
-PLANEX EN-2298P-T, EN-2298-T (flags 0x500000) (PC-98)
-.It
PLANEX FNW-3600-T
.It
Psion 10/100 LANGLOBAL Combine iT
@@ -277,8 +230,6 @@ SMC Elite 16 WD8013
.It
SMC Elite Ultra
.It
-SMC EtherEZ98 (flags 0x000000) (PC-98)
-.It
SMC WD8003E/WD8003EBT/WD8003S/WD8003SBT/WD8003W/WD8013EBT/WD8013W and clones
.It
SMC EZCard PC Card, 8040-TX, 8041-TX (AX88x90), 8041-TX V.2 (TC5299J)
diff --git a/share/man/man4/esp.4 b/share/man/man4/esp.4
index ccb574ce5e9e..74676f8f03f9 100644
--- a/share/man/man4/esp.4
+++ b/share/man/man4/esp.4
@@ -66,8 +66,6 @@ driver include:
.Pp
.Bl -bullet -compact
.It
-MELCO IFC-DP (PC-98)
-.It
Sun ESP family
.It
Sun FAS family
diff --git a/share/man/man4/fxp.4 b/share/man/man4/fxp.4
index 521c326ed09c..26367a51a984 100644
--- a/share/man/man4/fxp.4
+++ b/share/man/man4/fxp.4
@@ -137,12 +137,6 @@ Intel PRO/100 M Desktop Adapter
.It
Intel PRO/100 S Desktop, Server and Dual-Port Server Adapters
.It
-Contec C-NET(PI)-100TX (PC-98)
-.It
-NEC PC-9821Ra20, Rv20, Xv13, Xv20 internal 100Base-TX (PC-98)
-.It
-NEC PC-9821X-B06 (PC-98)
-.It
Many on-board network interfaces on Intel motherboards
.El
.Sh LOADER TUNABLES
diff --git a/share/man/man4/geom.4 b/share/man/man4/geom.4
index e03b65b3146e..1d0e13e0d1e9 100644
--- a/share/man/man4/geom.4
+++ b/share/man/man4/geom.4
@@ -65,9 +65,7 @@
.Cd options GEOM_PART_GPT
.Cd options GEOM_PART_LDM
.Cd options GEOM_PART_MBR
-.Cd options GEOM_PART_PC98
.Cd options GEOM_PART_VTOC8
-.Cd options GEOM_PC98
.Cd options GEOM_RAID
.Cd options GEOM_RAID3
.Cd options GEOM_SHSEC
diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile
index 328379b3a0cc..cdc623ef7f35 100644
--- a/share/man/man4/man4.i386/Makefile
+++ b/share/man/man4/man4.i386/Makefile
@@ -8,7 +8,6 @@ MAN= aic.4 \
cp.4 \
CPU_ELAN.4 \
cs.4 \
- ct.4 \
ctau.4 \
cx.4 \
ep.4 \
@@ -26,7 +25,6 @@ MAN= aic.4 \
pnpbios.4 \
sbni.4 \
smapi.4 \
- snc.4 \
streams.4 \
svr4.4 \
vpd.4 \
diff --git a/share/man/man4/man4.i386/aic.4 b/share/man/man4/man4.i386/aic.4
index 991a0c50be99..2af6e5fc97fb 100644
--- a/share/man/man4/man4.i386/aic.4
+++ b/share/man/man4/man4.i386/aic.4
@@ -62,10 +62,6 @@ Adaptec AHA-1535 (ISA)
Creative Labs SoundBlaster SCSI host adapter (ISA)
.It
Adaptec AHA-1460, AHA-1460B, AHA-1460C, AHA-1460D (PC Card)
-.It
-Adaptec AHA-1030B, AHA-1030P (PC98)
-.It
-NEC PC-9801-100 (PC98)
.El
.Sh SEE ALSO
.Xr aha 4 ,
diff --git a/share/man/man4/man4.i386/ct.4 b/share/man/man4/man4.i386/ct.4
deleted file mode 100644
index 28208a16893f..000000000000
--- a/share/man/man4/man4.i386/ct.4
+++ /dev/null
@@ -1,162 +0,0 @@
-.\" Copyright (c) 2003 Noriaki MITSUNAGA. All rights reserved.
-.\" Copyright (c) 2003 Hideyuki KURASHINA. 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 AUTHOR AND CONTRIBUTORS ``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 AUTHOR OR CONTRIBUTORS 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.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd November 18, 2003
-.Dt CT 4 i386
-.Os
-.Sh NAME
-.Nm ct
-.Nd "WD33C93[ABC] based CBUS SCSI host adapter driver"
-.Sh SYNOPSIS
-.Cd "device ct"
-.Cd "device scbus"
-.Pp
-In
-.Pa /boot/device.hints:
-.Pp
-For most PC-9801-55, -92 and compatibles:
-.Cd hint.ct.0.at="isa"
-.Pp
-For ELECOM bus-master
-.Tn SCSI
-adapters:
-.Cd hint.ct.0.at="isa"
-.Cd hint.ct.0.flags="0x30000"
-.Pp
-For I-O DATA SC98 adapters:
-.Cd hint.ct.0.at="isa"
-.Cd hint.ct.0.flags="0x10000"
-.Pp
-For LOGITEC adapters:
-.Cd hint.ct.0.at="isa"
-.Cd hint.ct.0.flags="0x50000"
-.Pp
-For TEXA adapters:
-.Cd hint.ct.0.at="isa"
-.Cd hint.ct.0.flags="0x20000"
-.Pp
-For adapters with SMIT transfer mode to enable SMIT transfer:
-.Cd hint.ct.0.at="isa"
-.Cd hint.ct.0.flags="0x40000"
-.Cd hint.ct.0.maddr="0xdc000"
-.Pp
-Flags meaning:
-.Bl -tag -offset indent -compact -width 0x000000
-.It 0x00000
-DMA transfer mode for an NEC PC-9801-55, -92 (or
-compatibles), ICM IF-2660, Midori-Denshi MDC-554NA, or
-Logitec LHA-N151
-.It 0x10000
-DMA transfer mode for an I-O DATA SC-98II
-.It 0x20000
-bus-master transfer mode for a TEXA HA-55BS2, its
-successors, or Midori-Denshi MDC-926R
-.It 0x30000
-bus-master transfer mode for an ELECOM bus-master SCSI
-adapter
-.It 0x40000
-SMIT transfer mode (for supported adapters only)
-.It 0x50000
-bus-master transfer mode for a Logitec LHA-20x series,
-ICM IF-2766, IF-2766ET, IF-2767 or IF-2769
-.El
-.Sh DESCRIPTION
-The
-.Nm
-driver provides access to the
-.Tn SCSI
-bus connected to a WD33C93[ABC] based host adapter.
-.Sh HARDWARE
-The
-.Nm
-driver supports the following adapters:
-.Pp
-.Bl -bullet -compact
-.It
-ELECOM bus-master
-.Tn SCSI
-adapters
-.It
-I-O DATA SC-98II
-.It
-ICM IF-2660, IF-2766, IF-2766ET, IF-2767 and IF-2769
-.It
-Logitec LHA-N151 and LHA-20x series
-.It
-Midori-Denshi MDC-554NA and MDC-926R
-.It
-NEC PC-9801-55, 92 and compatibles
-.It
-SMIT transfer type
-.Tn SCSI
-host adapters
-.It
-TEXA HA-55BS2 and its later models
-.El
-.Sh SEE ALSO
-.Xr cd 4 ,
-.Xr ch 4 ,
-.Xr ctau 4 ,
-.Xr da 4 ,
-.Xr intro 4 ,
-.Xr sa 4 ,
-.Xr scsi 4
-.Sh NOTES
-Historically, the driver for the Cronyx Tau WAN adapters was
-.Dq ct .
-This device name was changed to
-.Dq ctau
-to avoid conflicts
-with this pc98
-.Nm
-driver.
-The network device name for
-.Xr ctau 4
-is
-.Dq Li ct .
-Please see
-.Xr ctau 4
-for the details for that device.
-.Sh HISTORY
-The
-.Nm
-device driver has been developed for
-.Nx Ns /pc98
-and ported for
-.Fx .
-It first appeared in
-.Fx 4.4 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Naofumi HONDA .
-.Pp
-This manual page was written by
-.An Noriaki MITSUNAGA Aq Mt non@FreeBSD.org
-and
-.An Hideyuki KURASHINA Aq Mt rushani@FreeBSD.org .
diff --git a/share/man/man4/man4.i386/snc.4 b/share/man/man4/man4.i386/snc.4
deleted file mode 100644
index 6f826907352f..000000000000
--- a/share/man/man4/man4.i386/snc.4
+++ /dev/null
@@ -1,142 +0,0 @@
-.\"
-.\" Copyright (c) 2004 Tom Rhodes
-.\" 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd September 4, 2004
-.Dt SNC 4 i386
-.Os
-.Sh NAME
-.Nm snc
-.Nd National Semiconductor DP8393X SONIC Ethernet adapter driver
-.Sh SYNOPSIS
-.Cd device isa
-.Cd device snc
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for the
-.Tn National
-.Tn Semiconductor
-.Tn SONIC
-Ethernet adapters.
-.Sh HARDWARE
-The
-.Nm
-driver supports the following cards:
-.Pp
-.Bl -bullet -compact
-.It
-National Semiconductor DP83934AVQB
-.It
-NEC PC-9801-83
-.It
-NEC PC-9801-84
-.It
-NEC PC-9801-103
-.It
-NEC PC-9801-104
-.It
-NEC PC-9801N-15
-.It
-NEC PC-9801N-25
-.It
-NEC PC-9801N-J02 PCMCIA
-.It
-NEC PC-9801N-J02R PCMCIA
-.El
-.Pp
-The
-.Nm
-driver also includes support for the
-.Tn National
-.Tn Semiconductor
-.Tn NS46C46
-as
-64 * 16 bits Microwave Serial
-.Tn EEPROM .
-.Sh IMPLEMENTATION NOTES
-Accessing
-.Tn SONIC
-card data structures and registers as 32 bit values
-makes code endianness independent.
-The
-.Tn SONIC
-is however always in big-endian mode so it is necessary to
-ensure that data structures shared
-between the
-.Tn CPU
-and the
-.Tn SONIC
-card are always in big-endian order.
-The
-.Nm
-driver supports the
-.Tn PC-98
-C-Bus,
-and
-.Tn PnP
-buses.
-Support is also provided for the legacy C-Bus.
-.Sh DIAGNOSTICS
-The following driver specific error messages
-may be reported:
-.Bl -diag
-.It "snc%d: snc_nec16_register_irq: unsupported irq (%d)"
-The card returned an
-.Tn IRQ
-which is not supported by the driver.
-.It "snc%d: invalid packet length %d bytes"
-An attempt to transfer a data packet failed due to an
-invalid packet length.
-.El
-.Sh SEE ALSO
-.Xr netintro 4 ,
-.Xr bus_alloc_resource_any 9
-.Sh HISTORY
-The
-.Nm
-driver was ported from
-.Nx
-by
-.An -nosplit
-.An Motomichi Matsuzaki Aq Mt mzaki@e-mail.ne.jp
-and
-.An Hiroshi Yamashita Aq Mt bluemoon@msj.biglobe.ne.jp .
-It first appeared in
-.Fx 4.2 .
-This manual page first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-This manual page was written by
-.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
-.Sh BUGS
-Currently the
-.Nm
-driver only works on the
-.Tn PC-98
-architecture.
-It should probably work on the i386 architecture
-as well.
diff --git a/share/man/man4/ncr.4 b/share/man/man4/ncr.4
index 0521b4d9e1fc..a20418cbfdd4 100644
--- a/share/man/man4/ncr.4
+++ b/share/man/man4/ncr.4
@@ -72,15 +72,6 @@ chips:
.It
.Tn 53C1510D
.El
-.Pp
-The following add-on boards are known to be supported:
-.Pp
-.Bl -bullet -compact
-.It
-I-O DATA SC-98/PCI (PC-98)
-.It
-I-O DATA SC-PCI (PC-98)
-.El
.Sh SEE ALSO
.Xr cd 4 ,
.Xr ch 4 ,
diff --git a/share/man/man4/ncv.4 b/share/man/man4/ncv.4
index 01cdc93f5302..c7bdc30c523b 100644
--- a/share/man/man4/ncv.4
+++ b/share/man/man4/ncv.4
@@ -72,8 +72,6 @@ Macnica Miracle SCSI-II mPS110
.It
Media Intelligent MSC-110, MSC-200
.It
-NEC PC-9801N-J03R
-.It
New Media Corporation BASICS SCSI
.It
Qlogic Fast SCSI
diff --git a/share/man/man4/sym.4 b/share/man/man4/sym.4
index 205fe8650563..dd92eff75bda 100644
--- a/share/man/man4/sym.4
+++ b/share/man/man4/sym.4
@@ -329,10 +329,6 @@ DawiControl DC2976UW
.It
Diamond FirePort (all)
.It
-I-O DATA SC-UPCI (PC-98)
-.It
-Logitec LHA-521UA (PC-98)
-.It
NCR cards (all)
.It
Symbios cards (all)
diff --git a/share/mk/bsd.stand.mk b/share/mk/bsd.stand.mk
index 42e01d451319..c4d30874733a 100644
--- a/share/mk/bsd.stand.mk
+++ b/share/mk/bsd.stand.mk
@@ -18,9 +18,6 @@ CFLAGS.gcc+= -mpreferred-stack-boundary=2
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -fPIC -mno-red-zone
.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os
-.endif
.if ${MACHINE_CPUARCH} == "aarch64"
CFLAGS+= -mgeneral-regs-only
.endif
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 3a4e8f1352bd..2706683f210b 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -47,7 +47,6 @@ TARGET_ARCHES_arm?= arm armeb armv6
TARGET_ARCHES_arm64?= aarch64
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
-TARGET_ARCHES_pc98?= i386
TARGET_ARCHES_riscv?= riscv64 riscv64sf
# some corner cases
@@ -55,7 +54,7 @@ BOOT_MACHINE_DIR.amd64 = boot/i386
MACHINE_ARCH.host = ${_HOST_ARCH}
# the list of machines we support
-ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64
+ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips powerpc riscv sparc64
.for m in ${ALL_MACHINE_LIST:O:u}
MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
diff --git a/share/syscons/keymaps/INDEX.keymaps b/share/syscons/keymaps/INDEX.keymaps
index d8ca7360cae1..2ce16dd3a710 100644
--- a/share/syscons/keymaps/INDEX.keymaps
+++ b/share/syscons/keymaps/INDEX.keymaps
@@ -294,20 +294,6 @@ jp.106x.kbd:pt:Japons 106x
jp.106x.kbd:es:Japons 106x
jp.106x.kbd:uk: 106x
-jp.pc98.kbd:en:Japanese PC-98x1
-jp.pc98.kbd:de:Japanisch PC-98x1
-jp.pc98.kbd:fr:Japonais PC-98x1
-jp.pc98.kbd:pt:Japons PC-98x1
-jp.pc98.kbd:es:Japons PC-98x1
-jp.pc98.kbd:uk: PC-98x1
-
-jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO)
-jp.pc98.iso.kbd:de:Japanisch PC-98x1 (ISO)
-jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO)
-jp.pc98.iso.kbd:pt:Japons PC-98x1 (ISO)
-jp.pc98.iso.kbd:es:Japons PC-98x1 (ISO)
-jp.pc98.iso.kbd:uk: PC-98x1 (ISO)
-
kk.pt154.kst.kbd:en:Kazakh PT154 codepage
kk.pt154.kst.kbd:de:Kasachisch PT154 codepage
kk.pt154.kst.kbd:fr:Kazakh PT154 code page
diff --git a/share/syscons/keymaps/Makefile b/share/syscons/keymaps/Makefile
index 83ed4ae4d8b5..00b3ebe2a6c3 100644
--- a/share/syscons/keymaps/Makefile
+++ b/share/syscons/keymaps/Makefile
@@ -26,7 +26,7 @@ FILES= INDEX.keymaps \
icelandic.iso.kbd icelandic.iso.acc.kbd \
it.iso.kbd \
iw.iso8.kbd \
- jp.106.kbd jp.106x.kbd jp.pc98.kbd jp.pc98.iso.kbd \
+ jp.106.kbd jp.106x.kbd \
kk.pt154.kst.kbd kk.pt154.io.kbd \
latinamerican.kbd latinamerican.iso.acc.kbd \
lt.iso4.kbd \
diff --git a/share/syscons/keymaps/jp.pc98.iso.kbd b/share/syscons/keymaps/jp.pc98.iso.kbd
deleted file mode 100644
index 43719f51737c..000000000000
--- a/share/syscons/keymaps/jp.pc98.iso.kbd
+++ /dev/null
@@ -1,134 +0,0 @@
-# $FreeBSD$
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 esc esc esc esc esc esc debug esc O
- 001 '1' '!' '!' '!' '1' '!' '!' '!' O
- 002 '2' '@' sub sub '2' '"' nul nul O
- 003 '3' '#' esc esc '3' '#' esc esc O
- 004 '4' '$' fs fs '4' '$' fs fs O
- 005 '5' '%' gs gs '5' '%' gs gs O
- 006 '6' '^' rs rs '6' '&' rs rs O
- 007 '7' '&' '&' '&' '7' ''' us us O
- 008 '8' '*' bs bs '8' '(' del del O
- 009 '9' '(' '(' '(' '9' ')' '9' '9' O
- 010 '0' ')' ')' ')' '0' nop '0' '0' O
- 011 '-' '_' us us '-' '=' '-' '-' O
- 012 '=' '+' '+' '+' '^' '`' rs rs O
- 013 '\' '|' fs fs '\' '|' fs fs O
- 014 bs bs bs bs bs bs bs bs O
- 015 ht btab ht btab ht btab ht btab O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '[' '{' esc esc '@' '~' nul nul O
- 027 ']' '}' gs gs '[' '{' esc esc O
- 028 cr cr nl nl cr cr nl nl O
- 029 'a' 'A' soh soh 'a' 'A' soh soh C
- 030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 031 'd' 'D' eot eot 'd' 'D' eot eot C
- 032 'f' 'F' ack ack 'f' 'F' ack ack C
- 033 'g' 'G' bel bel 'g' 'G' bel bel C
- 034 'h' 'H' bs bs 'h' 'H' bs bs C
- 035 'j' 'J' nl nl 'j' 'J' nl nl C
- 036 'k' 'K' vt vt 'k' 'K' vt vt C
- 037 'l' 'L' ff ff 'l' 'L' ff ff C
- 038 ';' ':' ';' ';' ';' '+' ';' ';' O
- 039 ''' '"' ''' ''' ':' '*' ':' ':' O
- 040 '`' '~' '~' '~' ']' '}' gs gs O
- 041 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 042 'x' 'X' can can 'x' 'X' can can C
- 043 'c' 'C' etx etx 'c' 'C' etx etx C
- 044 'v' 'V' syn syn 'v' 'V' syn syn C
- 045 'b' 'B' stx stx 'b' 'B' stx stx C
- 046 'n' 'N' so so 'n' 'N' so so C
- 047 'm' 'M' cr cr 'm' 'M' cr cr C
- 048 ',' '<' '<' '<' ',' '<' '<' '<' O
- 049 '.' '>' '>' '>' '.' '>' '>' '>' O
- 050 '/' '?' del del '/' '?' del del O
- 051 '\' '|' fs fs nop '_' us us O
- 052 ' ' ' ' nul nul ' ' ' ' nul nul O
- 053 esc esc esc esc esc esc esc esc O
- 054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 057 del del del del del del boot boot N
- 058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 064 '-' '-' '-' '-' '-' '-' '-' '-' O
- 065 '/' '/' '/' '/' '/' '/' '/' '/' O
- 066 '7' '7' '7' '7' '7' '7' '7' '7' O
- 067 '8' '8' '8' '8' '8' '8' '8' '8' O
- 068 '9' '9' '9' '9' '9' '9' '9' '9' O
- 069 '*' '*' '*' '*' '*' '*' '*' '*' O
- 070 '4' '4' '4' '4' '4' '4' '4' '4' O
- 071 '5' '5' '5' '5' '5' '5' '5' '5' O
- 072 '6' '6' '6' '6' '6' '6' '6' '6' O
- 073 '+' '+' '+' '+' '+' '+' '+' '+' O
- 074 '1' '1' '1' '1' '1' '1' '1' '1' O
- 075 '2' '2' '2' '2' '2' '2' '2' '2' O
- 076 '3' '3' '3' '3' '3' '3' '3' '3' O
- 077 '=' '=' '=' '=' '=' '=' '=' '=' O
- 078 '0' '0' '0' '0' '0' '0' '0' '0' O
- 079 ',' ',' ',' ',' ',' ',' ',' ',' O
- 080 '.' '.' '.' '.' '.' '.' '.' '.' O
- 081 meta meta meta meta meta meta meta meta O
- 082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 084 slock slock slock slock slock slock slock slock O
- 085 nop nop nop nop nop nop nop nop O
- 086 nop nop nop nop nop nop nop nop O
- 087 nop nop nop nop nop nop nop nop O
- 088 nop nop nop nop nop nop nop nop O
- 089 nop nop nop nop nop nop nop nop O
- 090 nop nop nop nop nop nop nop nop O
- 091 nop nop nop nop nop nop nop nop O
- 092 nop nop nop nop nop nop nop nop O
- 093 nop nop nop nop nop nop nop nop O
- 094 nop nop nop nop nop nop nop nop O
- 095 nop nop nop nop nop nop nop nop O
- 096 slock saver slock saver susp nop susp nop O
- 097 nscr nscr debug debug nop nop nop nop O
- 098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
- 099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
- 100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
- 101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
- 102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
- 103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
- 104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 lshift lshift lshift lshift lshift lshift lshift lshift O
- 113 clock clock clock clock clock clock clock clock O
- 114 lalt lalt lalt lalt lalt lalt lalt lalt O
- 115 lalt lalt lalt lalt lalt lalt lalt lalt O
- 116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
-
diff --git a/share/syscons/keymaps/jp.pc98.kbd b/share/syscons/keymaps/jp.pc98.kbd
deleted file mode 100644
index d9a5d44a36b0..000000000000
--- a/share/syscons/keymaps/jp.pc98.kbd
+++ /dev/null
@@ -1,134 +0,0 @@
-# $FreeBSD$
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 esc esc esc esc esc esc debug esc O
- 001 '1' '!' '!' '!' '1' '!' '!' '!' O
- 002 '2' '"' sub sub '2' '@' nul nul O
- 003 '3' '#' esc esc '3' '#' esc esc O
- 004 '4' '$' fs fs '4' '$' fs fs O
- 005 '5' '%' gs gs '5' '%' gs gs O
- 006 '6' '&' rs rs '6' '^' rs rs O
- 007 '7' ''' us us '7' '&' '&' '&' O
- 008 '8' '(' del del '8' '*' bs bs O
- 009 '9' ')' '9' '9' '9' '(' '(' '(' O
- 010 '0' nop '0' '0' '0' ')' ')' ')' O
- 011 '-' '=' '-' '-' '-' '_' us us O
- 012 '^' '`' rs rs '=' '+' '+' '+' O
- 013 '\' '|' fs fs '\' '|' fs fs O
- 014 bs bs bs bs bs bs bs bs O
- 015 ht btab ht btab ht btab ht btab O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '@' '~' nul nul '[' '{' esc esc O
- 027 '[' '{' esc esc ']' '}' gs gs O
- 028 cr cr nl nl cr cr nl nl O
- 029 'a' 'A' soh soh 'a' 'A' soh soh C
- 030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 031 'd' 'D' eot eot 'd' 'D' eot eot C
- 032 'f' 'F' ack ack 'f' 'F' ack ack C
- 033 'g' 'G' bel bel 'g' 'G' bel bel C
- 034 'h' 'H' bs bs 'h' 'H' bs bs C
- 035 'j' 'J' nl nl 'j' 'J' nl nl C
- 036 'k' 'K' vt vt 'k' 'K' vt vt C
- 037 'l' 'L' ff ff 'l' 'L' ff ff C
- 038 ';' '+' ';' ';' ';' ':' ';' ';' O
- 039 ':' '*' ':' ':' ''' '"' ''' ''' O
- 040 ']' '}' gs gs '`' '~' '~' '~' O
- 041 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 042 'x' 'X' can can 'x' 'X' can can C
- 043 'c' 'C' etx etx 'c' 'C' etx etx C
- 044 'v' 'V' syn syn 'v' 'V' syn syn C
- 045 'b' 'B' stx stx 'b' 'B' stx stx C
- 046 'n' 'N' so so 'n' 'N' so so C
- 047 'm' 'M' cr cr 'm' 'M' cr cr C
- 048 ',' '<' '<' '<' ',' '<' '<' '<' O
- 049 '.' '>' '>' '>' '.' '>' '>' '>' O
- 050 '/' '?' del del '/' '?' del del O
- 051 nop '_' us us '\' '|' fs fs O
- 052 ' ' ' ' nul nul ' ' ' ' nul nul O
- 053 esc esc esc esc esc esc esc esc O
- 054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 057 del del del del del del boot boot N
- 058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 064 '-' '-' '-' '-' '-' '-' '-' '-' O
- 065 '/' '/' '/' '/' '/' '/' '/' '/' O
- 066 '7' '7' '7' '7' '7' '7' '7' '7' O
- 067 '8' '8' '8' '8' '8' '8' '8' '8' O
- 068 '9' '9' '9' '9' '9' '9' '9' '9' O
- 069 '*' '*' '*' '*' '*' '*' '*' '*' O
- 070 '4' '4' '4' '4' '4' '4' '4' '4' O
- 071 '5' '5' '5' '5' '5' '5' '5' '5' O
- 072 '6' '6' '6' '6' '6' '6' '6' '6' O
- 073 '+' '+' '+' '+' '+' '+' '+' '+' O
- 074 '1' '1' '1' '1' '1' '1' '1' '1' O
- 075 '2' '2' '2' '2' '2' '2' '2' '2' O
- 076 '3' '3' '3' '3' '3' '3' '3' '3' O
- 077 '=' '=' '=' '=' '=' '=' '=' '=' O
- 078 '0' '0' '0' '0' '0' '0' '0' '0' O
- 079 ',' ',' ',' ',' ',' ',' ',' ',' O
- 080 '.' '.' '.' '.' '.' '.' '.' '.' O
- 081 meta meta meta meta meta meta meta meta O
- 082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 084 slock slock slock slock slock slock slock slock O
- 085 nop nop nop nop nop nop nop nop O
- 086 nop nop nop nop nop nop nop nop O
- 087 nop nop nop nop nop nop nop nop O
- 088 nop nop nop nop nop nop nop nop O
- 089 nop nop nop nop nop nop nop nop O
- 090 nop nop nop nop nop nop nop nop O
- 091 nop nop nop nop nop nop nop nop O
- 092 nop nop nop nop nop nop nop nop O
- 093 nop nop nop nop nop nop nop nop O
- 094 nop nop nop nop nop nop nop nop O
- 095 nop nop nop nop nop nop nop nop O
- 096 slock saver slock saver susp nop susp nop O
- 097 nscr nscr debug debug nop nop nop nop O
- 098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
- 099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
- 100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
- 101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
- 102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
- 103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
- 104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 lshift lshift lshift lshift lshift lshift lshift lshift O
- 113 clock clock clock clock clock clock clock clock O
- 114 lalt lalt lalt lalt lalt lalt lalt lalt O
- 115 lalt lalt lalt lalt lalt lalt lalt lalt O
- 116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
-
diff --git a/share/vt/keymaps/INDEX.keymaps b/share/vt/keymaps/INDEX.keymaps
index 3fac998eb3b7..487058c2a5a7 100644
--- a/share/vt/keymaps/INDEX.keymaps
+++ b/share/vt/keymaps/INDEX.keymaps
@@ -301,20 +301,6 @@ jp.capsctrl.kbd:pt:Japonês 106x
jp.capsctrl.kbd:es:Japonés 106x
jp.capsctrl.kbd:uk:Японська 106x
-jp.pc98.kbd:en:Japanese PC-98x1
-jp.pc98.kbd:de:Japanisch PC-98x1
-jp.pc98.kbd:fr:Japonais PC-98x1
-jp.pc98.kbd:pt:Japonês PC-98x1
-jp.pc98.kbd:es:Japonés PC-98x1
-jp.pc98.kbd:uk:Японська PC-98x1
-
-jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO)
-jp.pc98.iso.kbd:de:Japanisch PC-98x1 (ISO)
-jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO)
-jp.pc98.iso.kbd:pt:Japonês PC-98x1 (ISO)
-jp.pc98.iso.kbd:es:Japonés PC-98x1 (ISO)
-jp.pc98.iso.kbd:uk:Японська PC-98x1 (ISO)
-
kz.kst.kbd:en:Kazakh
kz.kst.kbd:de:Kasachisch
kz.kst.kbd:fr:Kazakh
diff --git a/share/vt/keymaps/Makefile b/share/vt/keymaps/Makefile
index 283c3482d372..e1242bbeeb88 100644
--- a/share/vt/keymaps/Makefile
+++ b/share/vt/keymaps/Makefile
@@ -48,8 +48,6 @@ FILES= INDEX.keymaps \
it.kbd \
jp.capsctrl.kbd \
jp.kbd \
- jp.pc98.iso.kbd \
- jp.pc98.kbd \
kz.io.kbd \
kz.kst.kbd \
latinamerican.acc.kbd \
diff --git a/share/vt/keymaps/jp.pc98.iso.kbd b/share/vt/keymaps/jp.pc98.iso.kbd
deleted file mode 100644
index b60375c9f051..000000000000
--- a/share/vt/keymaps/jp.pc98.iso.kbd
+++ /dev/null
@@ -1,134 +0,0 @@
-# $FreeBSD$
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 esc esc esc esc esc esc debug esc O
- 001 '1' '!' '!' '!' '1' '!' '!' '!' O
- 002 '2' '@' sub sub '2' '"' nul nul O
- 003 '3' '#' esc esc '3' '#' esc esc O
- 004 '4' '$' fs fs '4' '$' fs fs O
- 005 '5' '%' gs gs '5' '%' gs gs O
- 006 '6' '^' rs rs '6' '&' rs rs O
- 007 '7' '&' '&' '&' '7' ''' us us O
- 008 '8' '*' bs bs '8' '(' del del O
- 009 '9' '(' '(' '(' '9' ')' '9' '9' O
- 010 '0' ')' ')' ')' '0' nop '0' '0' O
- 011 '-' '_' us us '-' '=' '-' '-' O
- 012 '=' '+' '+' '+' '^' '`' rs rs O
- 013 0xa5 '|' fs fs 0xa5 '|' fs fs O
- 014 bs bs bs bs bs bs bs bs O
- 015 ht btab ht btab ht btab ht btab O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '[' '{' esc esc '@' '~' nul nul O
- 027 ']' '}' gs gs '[' '{' esc esc O
- 028 cr cr nl nl cr cr nl nl O
- 029 'a' 'A' soh soh 'a' 'A' soh soh C
- 030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 031 'd' 'D' eot eot 'd' 'D' eot eot C
- 032 'f' 'F' ack ack 'f' 'F' ack ack C
- 033 'g' 'G' bel bel 'g' 'G' bel bel C
- 034 'h' 'H' bs bs 'h' 'H' bs bs C
- 035 'j' 'J' nl nl 'j' 'J' nl nl C
- 036 'k' 'K' vt vt 'k' 'K' vt vt C
- 037 'l' 'L' ff ff 'l' 'L' ff ff C
- 038 ';' ':' ';' ';' ';' '+' ';' ';' O
- 039 ''' '"' ''' ''' ':' '*' ':' ':' O
- 040 '`' '~' '~' '~' ']' '}' gs gs O
- 041 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 042 'x' 'X' can can 'x' 'X' can can C
- 043 'c' 'C' etx etx 'c' 'C' etx etx C
- 044 'v' 'V' syn syn 'v' 'V' syn syn C
- 045 'b' 'B' stx stx 'b' 'B' stx stx C
- 046 'n' 'N' so so 'n' 'N' so so C
- 047 'm' 'M' cr cr 'm' 'M' cr cr C
- 048 ',' '<' '<' '<' ',' '<' '<' '<' O
- 049 '.' '>' '>' '>' '.' '>' '>' '>' O
- 050 '/' '?' del del '/' '?' del del O
- 051 '\' '|' fs fs nop '_' us us O
- 052 ' ' ' ' nul nul ' ' ' ' nul nul O
- 053 esc esc esc esc esc esc esc esc O
- 054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 057 del del del del del del boot boot N
- 058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 064 '-' '-' '-' '-' '-' '-' '-' '-' O
- 065 '/' '/' '/' '/' '/' '/' '/' '/' O
- 066 '7' '7' '7' '7' '7' '7' '7' '7' O
- 067 '8' '8' '8' '8' '8' '8' '8' '8' O
- 068 '9' '9' '9' '9' '9' '9' '9' '9' O
- 069 '*' '*' '*' '*' '*' '*' '*' '*' O
- 070 '4' '4' '4' '4' '4' '4' '4' '4' O
- 071 '5' '5' '5' '5' '5' '5' '5' '5' O
- 072 '6' '6' '6' '6' '6' '6' '6' '6' O
- 073 '+' '+' '+' '+' '+' '+' '+' '+' O
- 074 '1' '1' '1' '1' '1' '1' '1' '1' O
- 075 '2' '2' '2' '2' '2' '2' '2' '2' O
- 076 '3' '3' '3' '3' '3' '3' '3' '3' O
- 077 '=' '=' '=' '=' '=' '=' '=' '=' O
- 078 '0' '0' '0' '0' '0' '0' '0' '0' O
- 079 ',' ',' ',' ',' ',' ',' ',' ',' O
- 080 '.' '.' '.' '.' '.' '.' '.' '.' O
- 081 meta meta meta meta meta meta meta meta O
- 082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 084 slock slock slock slock slock slock slock slock O
- 085 nop nop nop nop nop nop nop nop O
- 086 nop nop nop nop nop nop nop nop O
- 087 nop nop nop nop nop nop nop nop O
- 088 nop nop nop nop nop nop nop nop O
- 089 nop nop nop nop nop nop nop nop O
- 090 nop nop nop nop nop nop nop nop O
- 091 nop nop nop nop nop nop nop nop O
- 092 nop nop nop nop nop nop nop nop O
- 093 nop nop nop nop nop nop nop nop O
- 094 nop nop nop nop nop nop nop nop O
- 095 nop nop nop nop nop nop nop nop O
- 096 slock saver slock saver susp nop susp nop O
- 097 nscr nscr debug debug nop nop nop nop O
- 098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
- 099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
- 100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
- 101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
- 102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
- 103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
- 104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 lshift lshift lshift lshift lshift lshift lshift lshift O
- 113 clock clock clock clock clock clock clock clock O
- 114 lalt lalt lalt lalt lalt lalt lalt lalt O
- 115 lalt lalt lalt lalt lalt lalt lalt lalt O
- 116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
-
diff --git a/share/vt/keymaps/jp.pc98.kbd b/share/vt/keymaps/jp.pc98.kbd
deleted file mode 100644
index 6c8a4d656fc8..000000000000
--- a/share/vt/keymaps/jp.pc98.kbd
+++ /dev/null
@@ -1,134 +0,0 @@
-# $FreeBSD$
-# alt
-# scan cntrl alt alt cntrl lock
-# code base shift cntrl shift alt shift cntrl shift state
-# ------------------------------------------------------------------
- 000 esc esc esc esc esc esc debug esc O
- 001 '1' '!' '!' '!' '1' '!' '!' '!' O
- 002 '2' '"' sub sub '2' '@' nul nul O
- 003 '3' '#' esc esc '3' '#' esc esc O
- 004 '4' '$' fs fs '4' '$' fs fs O
- 005 '5' '%' gs gs '5' '%' gs gs O
- 006 '6' '&' rs rs '6' '^' rs rs O
- 007 '7' ''' us us '7' '&' '&' '&' O
- 008 '8' '(' del del '8' '*' bs bs O
- 009 '9' ')' '9' '9' '9' '(' '(' '(' O
- 010 '0' nop '0' '0' '0' ')' ')' ')' O
- 011 '-' '=' '-' '-' '-' '_' us us O
- 012 '^' '`' rs rs '=' '+' '+' '+' O
- 013 '\' '|' fs fs 0xa5 '|' fs fs O
- 014 bs bs bs bs bs bs bs bs O
- 015 ht btab ht btab ht btab ht btab O
- 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
- 017 'w' 'W' etb etb 'w' 'W' etb etb C
- 018 'e' 'E' enq enq 'e' 'E' enq enq C
- 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
- 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
- 021 'y' 'Y' em em 'y' 'Y' em em C
- 022 'u' 'U' nak nak 'u' 'U' nak nak C
- 023 'i' 'I' ht ht 'i' 'I' ht ht C
- 024 'o' 'O' si si 'o' 'O' si si C
- 025 'p' 'P' dle dle 'p' 'P' dle dle C
- 026 '@' '~' nul nul '[' '{' esc esc O
- 027 '[' '{' esc esc ']' '}' gs gs O
- 028 cr cr nl nl cr cr nl nl O
- 029 'a' 'A' soh soh 'a' 'A' soh soh C
- 030 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
- 031 'd' 'D' eot eot 'd' 'D' eot eot C
- 032 'f' 'F' ack ack 'f' 'F' ack ack C
- 033 'g' 'G' bel bel 'g' 'G' bel bel C
- 034 'h' 'H' bs bs 'h' 'H' bs bs C
- 035 'j' 'J' nl nl 'j' 'J' nl nl C
- 036 'k' 'K' vt vt 'k' 'K' vt vt C
- 037 'l' 'L' ff ff 'l' 'L' ff ff C
- 038 ';' '+' ';' ';' ';' ':' ';' ';' O
- 039 ':' '*' ':' ':' ''' '"' ''' ''' O
- 040 ']' '}' gs gs '`' '~' '~' '~' O
- 041 'z' 'Z' sub sub 'z' 'Z' sub sub C
- 042 'x' 'X' can can 'x' 'X' can can C
- 043 'c' 'C' etx etx 'c' 'C' etx etx C
- 044 'v' 'V' syn syn 'v' 'V' syn syn C
- 045 'b' 'B' stx stx 'b' 'B' stx stx C
- 046 'n' 'N' so so 'n' 'N' so so C
- 047 'm' 'M' cr cr 'm' 'M' cr cr C
- 048 ',' '<' '<' '<' ',' '<' '<' '<' O
- 049 '.' '>' '>' '>' '.' '>' '>' '>' O
- 050 '/' '?' del del '/' '?' del del O
- 051 nop '_' us us '\' '|' fs fs O
- 052 ' ' ' ' nul nul ' ' ' ' nul nul O
- 053 esc esc esc esc esc esc esc esc O
- 054 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
- 055 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
- 056 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
- 057 del del del del del del boot boot N
- 058 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
- 059 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
- 060 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
- 061 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
- 062 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
- 063 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
- 064 '-' '-' '-' '-' '-' '-' '-' '-' O
- 065 '/' '/' '/' '/' '/' '/' '/' '/' O
- 066 '7' '7' '7' '7' '7' '7' '7' '7' O
- 067 '8' '8' '8' '8' '8' '8' '8' '8' O
- 068 '9' '9' '9' '9' '9' '9' '9' '9' O
- 069 '*' '*' '*' '*' '*' '*' '*' '*' O
- 070 '4' '4' '4' '4' '4' '4' '4' '4' O
- 071 '5' '5' '5' '5' '5' '5' '5' '5' O
- 072 '6' '6' '6' '6' '6' '6' '6' '6' O
- 073 '+' '+' '+' '+' '+' '+' '+' '+' O
- 074 '1' '1' '1' '1' '1' '1' '1' '1' O
- 075 '2' '2' '2' '2' '2' '2' '2' '2' O
- 076 '3' '3' '3' '3' '3' '3' '3' '3' O
- 077 '=' '=' '=' '=' '=' '=' '=' '=' O
- 078 '0' '0' '0' '0' '0' '0' '0' '0' O
- 079 ',' ',' ',' ',' ',' ',' ',' ',' O
- 080 '.' '.' '.' '.' '.' '.' '.' '.' O
- 081 meta meta meta meta meta meta meta meta O
- 082 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
- 083 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
- 084 slock slock slock slock slock slock slock slock O
- 085 nop nop nop nop nop nop nop nop O
- 086 nop nop nop nop nop nop nop nop O
- 087 nop nop nop nop nop nop nop nop O
- 088 nop nop nop nop nop nop nop nop O
- 089 nop nop nop nop nop nop nop nop O
- 090 nop nop nop nop nop nop nop nop O
- 091 nop nop nop nop nop nop nop nop O
- 092 nop nop nop nop nop nop nop nop O
- 093 nop nop nop nop nop nop nop nop O
- 094 nop nop nop nop nop nop nop nop O
- 095 nop nop nop nop nop nop nop nop O
- 096 slock saver slock saver susp nop susp nop O
- 097 nscr nscr debug debug nop nop nop nop O
- 098 fkey01 fkey13 fkey25 fkey37 scr01 scr01 scr01 scr01 O
- 099 fkey02 fkey14 fkey26 fkey38 scr02 scr02 scr02 scr02 O
- 100 fkey03 fkey15 fkey27 fkey39 scr03 scr03 scr03 scr03 O
- 101 fkey04 fkey16 fkey28 fkey40 scr04 scr04 scr04 scr04 O
- 102 fkey05 fkey17 fkey29 fkey41 scr05 scr05 scr05 scr05 O
- 103 fkey06 fkey18 fkey30 fkey42 scr06 scr06 scr06 scr06 O
- 104 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
- 105 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
- 106 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
- 107 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
- 108 nop nop nop nop nop nop nop nop O
- 109 nop nop nop nop nop nop nop nop O
- 110 nop nop nop nop nop nop nop nop O
- 111 nop nop nop nop nop nop nop nop O
- 112 lshift lshift lshift lshift lshift lshift lshift lshift O
- 113 clock clock clock clock clock clock clock clock O
- 114 lalt lalt lalt lalt lalt lalt lalt lalt O
- 115 lalt lalt lalt lalt lalt lalt lalt lalt O
- 116 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
- 117 nop nop nop nop nop nop nop nop O
- 118 nop nop nop nop nop nop nop nop O
- 119 nop nop nop nop nop nop nop nop O
- 120 nop nop nop nop nop nop nop nop O
- 121 nop nop nop nop nop nop nop nop O
- 122 nop nop nop nop nop nop nop nop O
- 123 nop nop nop nop nop nop nop nop O
- 124 nop nop nop nop nop nop nop nop O
- 125 nop nop nop nop nop nop nop nop O
- 126 nop nop nop nop nop nop nop nop O
- 127 nop nop nop nop nop nop nop nop O
-
diff --git a/sys/Makefile b/sys/Makefile
index fa8941ef3378..7d88c4ecdf22 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -8,7 +8,7 @@ CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
.if !defined(CSCOPE_ARCHDIR)
.if defined(ALL_ARCH)
-CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64 x86
+CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv sparc64 x86
.else
CSCOPE_ARCHDIR = ${MACHINE}
.if ${MACHINE} != ${MACHINE_CPUARCH}
diff --git a/sys/boot/Makefile.pc98 b/sys/boot/Makefile.pc98
deleted file mode 100644
index 84683991a645..000000000000
--- a/sys/boot/Makefile.pc98
+++ /dev/null
@@ -1,3 +0,0 @@
-# $FreeBSD$
-
-SUBDIR+= libstand32
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index 1b2080a7772d..c83f00975814 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -7,8 +7,6 @@ SRCS+= module.c panic.c
.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
-.elif ${MACHINE} == "pc98"
-SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
.elif ${MACHINE_CPUARCH} == "aarch64"
SRCS+= load_elf64.c reloc_elf64.c
.elif ${MACHINE_CPUARCH} == "arm"
diff --git a/sys/boot/common/isapnp.h b/sys/boot/common/isapnp.h
index 0f9956c4f183..a5b8f28304f7 100644
--- a/sys/boot/common/isapnp.h
+++ b/sys/boot/common/isapnp.h
@@ -45,15 +45,9 @@
/* Static ports to access PnP state machine */
#ifndef _KERNEL
-#ifdef PC98
-/* pnp.h is included from pnpinfo.c. */
-#define _PNP_ADDRESS 0x259
-#define _PNP_WRITE_DATA 0xa59
-#else
#define _PNP_ADDRESS 0x279
#define _PNP_WRITE_DATA 0xa79
#endif
-#endif
/* PnP Registers. Write to ADDRESS and then use WRITE/READ_DATA */
#define SET_RD_DATA 0x00
diff --git a/sys/boot/ficl/loader.c b/sys/boot/ficl/loader.c
index 224619065790..50f70642cc5c 100644
--- a/sys/boot/ficl/loader.c
+++ b/sys/boot/ficl/loader.c
@@ -827,9 +827,7 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys)
SET_FOREACH(fnpp, Xficl_compile_set)
(*fnpp)(pSys);
-#if defined(PC98)
- ficlSetEnv(pSys, "arch-pc98", FICL_TRUE);
-#elif defined(__i386__)
+#if defined(__i386__)
ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
#elif defined(__powerpc__)
diff --git a/sys/boot/forth/frames.4th b/sys/boot/forth/frames.4th
index 0f8d460aa7b4..b237afe7ac43 100644
--- a/sys/boot/forth/frames.4th
+++ b/sys/boot/forth/frames.4th
@@ -46,49 +46,26 @@ variable fill
124 constant ascii_pipe
43 constant ascii_plus
-s" arch-pc98" environment? [if]
- \ Single frames
- 149 constant sh_el
- 150 constant sv_el
- 152 constant slt_el
- 154 constant slb_el
- 153 constant srt_el
- 155 constant srb_el
- \ Double frames
- 149 constant dh_el
- 150 constant dv_el
- 152 constant dlt_el
- 154 constant dlb_el
- 153 constant drt_el
- 155 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 135 constant fill_dark
- 135 constant fill_med
- 135 constant fill_bright
-[else]
- \ Single frames
- 196 constant sh_el
- 179 constant sv_el
- 218 constant slt_el
- 192 constant slb_el
- 191 constant srt_el
- 217 constant srb_el
- \ Double frames
- 205 constant dh_el
- 186 constant dv_el
- 201 constant dlt_el
- 200 constant dlb_el
- 187 constant drt_el
- 188 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 176 constant fill_dark
- 177 constant fill_med
- 178 constant fill_bright
-[then]
+\ Single frames
+196 constant sh_el
+179 constant sv_el
+218 constant slt_el
+192 constant slb_el
+191 constant srt_el
+217 constant srb_el
+\ Double frames
+205 constant dh_el
+186 constant dv_el
+201 constant dlt_el
+200 constant dlb_el
+187 constant drt_el
+188 constant drb_el
+\ Fillings
+0 constant fill_none
+32 constant fill_blank
+176 constant fill_dark
+177 constant fill_med
+178 constant fill_bright
only forth definitions also frame-drawing
diff --git a/sys/boot/pc98/Makefile b/sys/boot/pc98/Makefile
deleted file mode 100644
index e8f9dbffe1e0..000000000000
--- a/sys/boot/pc98/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader
-
-.include <bsd.subdir.mk>
diff --git a/sys/boot/pc98/Makefile.inc b/sys/boot/pc98/Makefile.inc
deleted file mode 100644
index 829793d63bd3..000000000000
--- a/sys/boot/pc98/Makefile.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-# Common defines for all of /sys/boot/pc98/
-#
-# $FreeBSD$
-
-BINDIR?= /boot
-
-LOADER_ADDRESS?=0x200000
-CFLAGS+= -march=i386 -ffreestanding
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
-CFLAGS+= -Os -DPC98
-LDFLAGS+= -nostdlib
-
-# BTX components
-.if exists(${.OBJDIR}/../btx)
-BTXDIR= ${.OBJDIR}/../btx
-.else
-BTXDIR= ${.CURDIR}/../btx
-.endif
-BTXLDR= ${BTXDIR}/btxldr/btxldr
-BTXKERN= ${BTXDIR}/btx/btx
-BTXCRT= ${BTXDIR}/lib/crt0.o
-
-# compact binary with no padding between text, data, bss
-LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript
-LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
-LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
-
-.include "../Makefile.inc"
diff --git a/sys/boot/pc98/boot0.5/Makefile b/sys/boot/pc98/boot0.5/Makefile
deleted file mode 100644
index ec40fe536ece..000000000000
--- a/sys/boot/pc98/boot0.5/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $FreeBSD$
-
-PROG= ${BOOT}.out
-INTERNALPROG=
-FILES= ${BOOT}
-MAN=
-SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \
- putssjis.s
-CLEANFILES= ${BOOT} ${BOOT}.bin
-
-BOOT= boot0.5
-
-# The base address that we the boot0 code to to run it. Don't change this
-# unless you are glutton for punishment.
-BOOT_BOOT0_ORG?= 0x0000
-
-LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript
-
-# The size of boot0.5 must be 7168 bytes
-${BOOT}: ${BOOT}.bin
- cat ${BOOT}.bin /dev/zero | ${DD} of=${BOOT} bs=1 count=7168
-
-${BOOT}.bin: ${BOOT}.out
- ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET}
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/boot0.5/boot.s b/sys/boot/pc98/boot0.5/boot.s
deleted file mode 100644
index 9d11206a882b..000000000000
--- a/sys/boot/pc98/boot0.5/boot.s
+++ /dev/null
@@ -1,174 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
-
- .text
- .global boot
-#
-# Read bootstrap program and jump to it.
-#
-boot:
- # Step 1: Save parameters
- movw curdevice, %si
- movb daua(%si), %al
- movb %al, b_daua
- shlw %si
- movw secsize(%si), %ax
- movw %ax, b_secsize
-
- movw curpartition, %si
- movb partnum(%si), %al # %al = real partition number
- xorb %ah, %ah
- movw %ax, b_partn # save real parttion number
- movb $5, %cl
- shlw %cl, %si # %si = offset to parttable
- addw $4, %si
- movb parttable(%si), %al # IPLS
- movb %al, b_sector
- incw %si
- movb parttable(%si), %al # IPLH
- movb %al, b_head
- incw %si # IPLC
- movw parttable(%si), %ax
- movw %ax, b_cylinder
-
- # Step 2: Calculate the segment address of the bootstrap routine
- movw $0x1d00, %ax
- movw b_secsize, %cx
- shrw %cx
- shrw %cx
- subw %cx, %ax
- subw $0x100, %ax
- movw %ax, b_bootseg
-
- # Step 3: Read bootstrap code
- movb $6, %ah
- movb b_daua, %al
- movw b_secsize, %bx
- shlw %bx # 2 sectors
- movw b_cylinder, %cx
- movb b_head, %dh
- movb b_sector, %dl
- movw b_bootseg, %es
- xorw %bp, %bp
- int $0x1b
- jc boot_error
-
- # Step 4: Set DA/UA into BIOS work area
- xorw %ax, %ax
- movw %ax, %es
- movw $0x584, %bx # DISK_BOOT
- movb b_daua, %dl
- call write_biosparam
-
- call sc_clean
- # Step 5: Set registers
- # %ah: 00
- # %al: DA/UA
- # %bx: Sector size * 2
- # %cx: cylinder number of boot partition
- # %si: pointer to partition table
- movw b_partn, %ax
- movb $5, %cl
- shl %cl, %ax # %ax = partition number * 32
- addw b_secsize, %ax
- movw %ax, %si # %si = pointer to partition table
- movw b_cylinder, %cx # %cx = cylinder
- movb b_head, %dh # %dh = head
- movb b_sector, %dl # %dl = sector
- movw b_bootseg, %es # %es = boot segment
- movb b_daua, %al # %al = DA/UA
- movw b_secsize, %bx
- shlw %bx # %bx = sector size * 2
- cli
- movw %cs:iniss, %ss # Restore stack pointer
- movw %cs:inisp, %sp
- push %es # Boot segment
- xorw %bp, %bp
- push %bp # 0
- movw %ax, %di # Save %ax
- xorw %ax, %ax
- movw %ax, %ds # %ds = 0
- movw %di, %ax # Restore %ax
- xorb %ah, %ah # %ah = 0
- xorw %di, %di # %di = 0
- sti
-
- # Jump to bootstrap code
- lret
- # NOTREACHED
-
-boot_error:
- ret
-
-#
-# Try to boot from default partition.
-#
- .global trydefault
-trydefault:
- movw ndevice, %cx
- xorw %si, %si
-trydefault_loop:
- movw %si, curdevice
- push %cx
- push %si
- call read_ipl
- pop %si
- pop %cx
- cmpb $0x80, defpartflag
- jne nodefpart
- # Default partition is defined.
- push %cx
- movw npartition, %cx
-srch_part:
- movw %cx, %bx
- decw %bx
- movb defpartnum, %al # %al = real partition number
- cmpb partnum(%bx), %al
- jne not_match
- movw %bx, curpartition # Store partition number
- call boot
-not_match:
- loop srch_part
- pop %cx
-nodefpart:
- incw %si
- loop trydefault_loop
- ret
-
- .data
-b_daua: .byte 0 # DA/UA
-b_head: .byte 0 # SYSH
-b_sector: .byte 0 # SYSS
-b_cylinder: .word 0 # SYSC
-b_bootseg: .word 0
-b_secsize: .word 0
-b_partn: .word 0 # Real partition number
diff --git a/sys/boot/pc98/boot0.5/boot0.5.s b/sys/boot/pc98/boot0.5/boot0.5.s
deleted file mode 100644
index f87800656767..000000000000
--- a/sys/boot/pc98/boot0.5/boot0.5.s
+++ /dev/null
@@ -1,293 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000, 2007.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
- .global main
- .code16
-
- .text
-main:
- # Check hireso mode
- movw $0x501, %bx # BIOS_FLAG
- call read_biosparam
- testb $0x08, %dl
- jz normalmode
- movb $1, ishireso
-normalmode:
- call sc_init
-
- # Display title and copyright.
- movw $title, %di
- call sc_puts
- xorw %cx, %cx
- movw $1, %dx
- call sc_goto
- movw $copyright, %di
- call sc_puts
-
- # Scan hard drives
- xorw %si, %si # number of partition
- call scan_sasi # SASI/IDE
- call scan_scsi # SCSI
- movw %si, ndevice
- orw %si, %si
- jnz drives_found
- jmp exit # No hard drives
-
-drives_found:
- # Setup sector size dependent parameters
- movw %si, %cx # %cx = number of devices
-setup_loop:
- movw %cx, %di
- decw %di
- shlw %di
- movw secsize(%di), %ax
- cmpw $1024, %ax
- je setup_1024
- cmpw $512, %ax
- je setup_512
- # 256 bytes/sector
- movw $0x100, partoff(%di)
- movw $0x0fa, defflagoff(%di)
- movw $0x0fb, defpartoff(%di)
- movw $8, maxpart(%di)
- jmp setup_secsize_end
- # 1024 bytes/sector
-setup_1024:
- # XXX Fix me!
- movw $0x400, partoff(%di)
- movw $0x3fa, defflagoff(%di)
- movw $0x3fb, defpartoff(%di)
- movb $32, maxpart(%di)
- jmp setup_secsize_end
- # 512 bytes/sector
-setup_512:
- movw $0x200, partoff(%di)
- movw $0x1fa, defflagoff(%di)
- movw $0x1fb, defpartoff(%di)
- movb $16, maxpart(%di)
-setup_secsize_end:
- loop setup_loop
-
- # For debug with floppy, fake the parameter.
- movw $0x584, %bx # DISK_BOOT
- call read_biosparam
- andb $0xf0, %dl
- cmpb $0x90, %ah
- jne boot_from_hdd
- movb daua, %dl
- call write_biosparam
-
-boot_from_hdd:
- movw $500, %cx
-wait_0_5:
- call wait1ms
- loop wait_0_5
-
- # If the TAB is pressed, don't try to boot from default partition
- xorw %di, %di # flag
-wait_key_release:
- call sc_iskeypress
- orw %ax, %ax
- jz key_release # KBD buffer empty.
- call sc_getc
- cmpb $0x0f, %ah # TAB
- jne wait_key_release
- # TAB pressed
- movw $1, %di
- jmp wait_key_release
-key_release:
- orw %di, %di
- jnz dont_try_default # TAB pressed.
- call trydefault
- # Default partition not found.
-dont_try_default:
- call show_usage
- call showdevices
- call selector
-exit:
- ret
-#
-# Display usage
-#
-show_usage:
- movw $44, %cx
- movw $3, %dx
- call sc_goto
- movw $msg_usage1, %di
- call sc_puts
- movw $44, %cx
- movw $4, %dx
- call sc_goto
- movw $msg_usage2, %di
- call sc_puts
- movw $44, %cx
- movw $5, %dx
- call sc_goto
- movw $msg_usage3, %di
- call sc_puts
- movw $44, %cx
- movw $7, %dx
- call sc_goto
- movw $msg_usage4, %di
- call sc_puts
- movw $44, %cx
- movw $8, %dx
- call sc_goto
- movw $msg_usage5, %di
- call sc_puts
- movw $44, %cx
- movw $9, %dx
- call sc_goto
- movw $msg_usage6, %di
- call sc_puts
- movw $44, %cx
- movw $10, %dx
- call sc_goto
- movw $msg_usage7, %di
- call sc_puts
- movw $44, %cx
- movw $11, %dx
- call sc_goto
- movw $msg_usage8, %di
- call sc_puts
- movw $44, %cx
- movw $16, %dx
- call sc_goto
- movw $msg_usage9, %di
- call sc_puts
- movw $44, %cx
- movw $17, %dx
- call sc_goto
- movw $msg_usage10, %di
- call sc_puts
- movw $44, %cx
- movw $18, %dx
- call sc_goto
- movw $msg_usage11, %di
- call sc_puts
- movw $44, %cx
- movw $19, %dx
- call sc_goto
- movw $msg_usage12, %di
- call sc_puts
- ret
-
-#
-# Display device list
-#
-showdevices:
- movw $2, %cx
- movw $4, %dx
- call sc_goto
- movw $msg_device, %di
- call sc_puts
- xorw %si, %si # %si = device number
- movw ndevice, %cx # %cx = number of devices
-showdev_loop:
- push %cx
- movw $2, %cx
- movw $5, %dx
- addw %si, %dx
- call sc_goto
- # Check DA
- movb daua(%si), %al
- push %ax
- andb $0xf0, %al
- cmpb $0x80, %al
- je show_sasi
- cmpb $0xa0, %al
- je show_scsi
- # unknown device
- movw $msg_unknown, %di
- call sc_puts
- jmp showunit
- # SASI
-show_sasi:
- movw $msg_sasi, %di
- call sc_puts
- jmp showunit
- # SCSI
-show_scsi:
- movw $msg_scsi, %di
- call sc_puts
- # Display unit number.
-showunit:
- pop %ax
- andb $0x0f, %al
- addb $'0', %al
- call sc_putc
- incw %si
- pop %cx
- loop showdev_loop
- movw ndevice, %dx
- addw $5, %dx
- movw $2, %cx
- call sc_goto
- movw $msg_exitmenu, %di
- call sc_puts
- ret
-
- .data
- .global curdevice, ndevice
-ndevice: .word 0 # number of device
-curdevice: .word 0 # current device
-
- .global ishireso
-ishireso: .byte 0
-
-title: .asciz "PC98 Boot Selector Version 1.2"
-copyright: .ascii "(C)Copyright 1999-2007 KATO Takenori. "
- .asciz "All rights reserved."
-msg_device: .asciz "Device"
-msg_sasi: .asciz "SASI/IDE unit "
-msg_scsi: .asciz "SCSI ID "
-msg_unknown: .asciz "unknown unit "
-msg_exitmenu: .asciz "Exit this menu"
-msg_usage1: .asciz "Device list"
-msg_usage2: .asciz "UP, DOWN: select boot device"
-msg_usage3: .asciz "RETURN: move to slice list"
-msg_usage4: .asciz "Slice list"
-msg_usage5: .asciz "UP, DOWN: select boot slice"
-msg_usage6: .asciz "RETURN: boot"
-msg_usage7: .asciz "SPACE: toggle default"
-msg_usage8: .asciz "ESC: move to device list"
-msg_usage9: .asciz "LEGEND"
-msg_usage10: .asciz ">>: selected device/slice"
-msg_usage11: .asciz "*: default slice to boot"
-msg_usage12: .asciz "!: unbootable slice"
-
- .bss
- .global daua, secsize, defflagoff, defpartoff
- .global maxpart, partoff
-daua: .space 12 # DA/DU list
-secsize: .space 12 * 2 # Sector soize
-defflagoff: .space 12 * 2
-defpartoff: .space 12 * 2
-maxpart: .space 12 * 2
-partoff: .space 12 * 2
diff --git a/sys/boot/pc98/boot0.5/disk.s b/sys/boot/pc98/boot0.5/disk.s
deleted file mode 100644
index 6e8034898c82..000000000000
--- a/sys/boot/pc98/boot0.5/disk.s
+++ /dev/null
@@ -1,296 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
- .text
-#
-# Check magic number at the end of the sector 0
-#
-check_magic:
- movw curdevice, %si
- shlw %si
- movw secsize(%si), %bx
- decw %bx
- decw %bx
- movw iplbuf(%bx), %ax
- cmpw $0xaa55, %ax
- je magic_ok
- movw $1, %ax
- ret
-magic_ok:
- xorw %ax, %ax
- ret
-
-#
-# Copy partition table from buffer to parttable.
-#
-setup_partition:
- push %cs
- pop %es
- movw curdevice, %bx
- shlw %bx
- movw maxpart(%bx), %cx # %cx = max num of partitions
- movw partoff(%bx), %di
- movw %di, %bx # %bx = offset to partition table
- xorw %dx, %dx # %dx = partition number
-setup_partition_loop:
- push %cx
- movw %dx, %si
- movb $5, %cl
- shlw %cl, %si
- addw %bx, %si
- movb iplbuf(%si), %al
- orb %al, %al
- jz unused_partition
- addw $iplbuf, %si
- movw npartition, %ax
- movw %ax, %di
- movb $5, %cl
- shlw %cl, %di
- addw $parttable, %di
- movw $32, %cx
- rep
- movsb
- movw %ax, %di
- addw $partnum, %di
- movb %dl, (%di)
- incw npartition
-unused_partition:
- incw %dx
- pop %cx
- loop setup_partition_loop
- ret
-
-#
-# Read IPL and partition table in the current device.
-#
- .global read_ipl
-read_ipl:
- movw curdevice, %ax
- movw %ax, %si # %si = device number
- movw %ax, %di
- shlw %di
-
- movw %cs, %ax
- movw %ax, %es
- movb $6, %ah
- movb daua(%si), %al
- movw $0x400, %bx
- xorw %cx, %cx
- xorw %dx, %dx
- movw $iplbuf, %bp
- int $0x1b
- jc read_ipl_error
- movw defflagoff(%di), %bx
- movb iplbuf(%bx), %al
- movb %al, defpartflag
- incw %bx
- movb iplbuf(%bx), %al
- movb %al, defpartnum
- movw $0, npartition
- call check_magic
- orw %ax, %ax
- jnz no_magic
- call setup_partition
-no_magic:
- xorw %ax, %ax
-read_ipl_error:
- xorw %bx, %bx
- movw %bx, %es
- ret
-
-#
-# Restore IPL from the buffer
-#
- .global write_ipl
-write_ipl:
- movw curdevice, %ax
- movw %ax, %si
- movw %ax, %di
- shlw %di
-
- # Restore default boot partition info.
- movw defflagoff(%di), %bx
- movb defpartflag, %al
- movb %al, iplbuf(%bx)
- incw %bx
- movb defpartnum, %al
- movb %al, iplbuf(%bx)
-
- movw %cs, %ax
- movw %ax, %es
- movb $5, %ah
- movb daua(%si), %al
- movw secsize(%di), %bx
- xorw %cx, %cx
- xorw %dx, %dx
- movw $iplbuf, %bp
- int $0x1b
- jc write_ipl_error
- xorw %ax, %ax
-write_ipl_error:
- xorw %bx, %bx
- movw %bx, %es
- ret
-
-#
-# Scan HDD devices
-#
- .global scan_sasi, scan_scsi
- # Scan SASI disk
-scan_sasi:
- # SASI Disk
- movw $4, %cx
- movw $0x0001, %ax # %ah = unit number, %al = for bit operation
-
-sasi_loop:
- movw %si, %di
- shlw %di
- movw $0x55d, %bx # DISK_EQUIP
- call read_biosparam
- testb %al, %dl
- jz no_sasi_unit
- movb $0x80, %dh
- addb %ah, %dh # %dh = DA/UA
- movb %dh, daua(%si) # Store DA/UA
-
- # Try new sense command
- push %ax
- push %cx
- movb %dh, %al
- movb $0x84, %ah
- int $0x1b
- pop %cx
- pop %ax
- jc err_newsense
- movw %bx, %dx
- jmp found_sasi_unit
-
-err_newsense:
- movw $0x457, %bx # capacity & sector size of IDE HDD
- call read_biosparam
- orb %ah, %ah
- jz sasi_1
- cmpb $1, %ah
- jz sasi_2
-
- # SASI #3/#4
- movw $512, %dx # XXX
- jmp found_sasi_unit
-
-sasi_1:
- # SASI #1
- testb $0x80, %dl
- jz sasi_256
- jmp sasi_512
-sasi_2:
- # SASI #2
- testb $0x40, %dl
- jz sasi_256
- jmp sasi_512
-
-sasi_256:
- movw $256, %dx
- jmp found_sasi_unit
-sasi_512:
- movw $512, %dx
-found_sasi_unit:
- movw %dx, secsize(%di)
- incw %si
-no_sasi_unit:
- incb %ah
- shlb %al
- loop sasi_loop
- ret
-
-#
-# Scan SCSI disk
-# SI number of disks
-# destroyed: %ax, %bx, %cx, %dx
-scan_scsi:
- movw $8, %cx
- movw $0x0001, %ax # %ah = ID number, %al = for bit operation
-scsi_loop:
- # Check whether drive exist.
- movw %si, %di
- shlw %di
- movw $0x482, %bx # DISK_EQUIPS
- call read_biosparam
- testb %al, %dl
- jz no_scsi_unit
- xorw %bx, %bx
- movb %ah, %bl
- shlw %bx
- shlw %bx
- addw $0x460, %bx # SCSI parameter block
- call read_biosparam
- orb %dl, %dl
- jz no_scsi_unit
-
- # SCSI harddrive found.
- movb $0xa0, %dh
- addb %ah, %dh
- movb %dh, daua(%si)
-
- # Check sector size.
- addw $3, %bx
- call read_biosparam
- andb $0x30, %dl
- cmpb $0x20, %dl
- je scsi_1024
- cmpb $0x10, %dl
- je scsi_512
- movw $256, %dx
- jmp found_scsi
-scsi_1024:
- movw $1024, %dx
- jmp found_scsi
-scsi_512:
- movw $512, %dx
-found_scsi:
- movw %dx, secsize(%di)
- incw %si
-no_scsi_unit:
- incb %ah
- shlb %al
- loop scsi_loop
- ret
-
- .data
- .global defpartflag, defpartnum, npartition
-defpartflag: .byte 0
-defpartnum: .byte 0
-npartition: .word 0 # number of partitions
-
- .bss
- .global partnum, parttable
-iplbuf: .space 0x400 # Read buffer for IPL
-partnum: .space 32 # Index of parttable
-parttable: .space 1024 # Copy of valid partition table
diff --git a/sys/boot/pc98/boot0.5/ldscript b/sys/boot/pc98/boot0.5/ldscript
deleted file mode 100644
index 49044abfb159..000000000000
--- a/sys/boot/pc98/boot0.5/ldscript
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-SECTIONS
-{
- .text : { *(.text) }
- .data : { *(.data) }
- . = 0x1243;
- .putssjis : { *(.putssjis) }
- .bss : { *(.bss) }
-}
diff --git a/sys/boot/pc98/boot0.5/putssjis.s b/sys/boot/pc98/boot0.5/putssjis.s
deleted file mode 100644
index 221b9e67818b..000000000000
--- a/sys/boot/pc98/boot0.5/putssjis.s
+++ /dev/null
@@ -1,137 +0,0 @@
-# Copyright (c) KATO Takenori, 2007.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
- .section .putssjis, "awx", @progbits
-
- #
- # Display string with Shift-JIS support
- # %si: address of string, %di: T-VRAM address, %cx: count
- #
-
- # Absolute address of putssjis_entry must be 0x1243.
-putssjis_entry:
- push %es
- push %ax
- # Setup the T-VRAM segement address.
- xorw %ax, %ax
- movw %ax, %es
- movw $0xa000, %ax
- testb $0x08, %es:0x501
- jz normalmode
- movw $0xe000, %ax
-normalmode:
- movw %ax, %es
-
-putssjis_loop:
- lodsw
- call check_sjis
- jc put_2byte_char
-
- # 1 byte character
- xorb %ah, %ah
- testb $0xe0, %al # Check control code.
- jnz put_1byte_char
- movb $0x20, %al # Convert control code into the space.
-put_1byte_char:
- stosw
- decw %si
- jmp putssjis_loop_end
-
-put_2byte_char:
- subb $0x20, %al
-
- # Check 2byte "hankaku"
- cmp $0x09, %al
- je put_2byte_hankaku
- cmp $0x0a, %al
- je put_2byte_hankaku
- cmp $0x0b, %al
- je put_2byte_hankaku
- jmp put_2byte_zenkaku
-
-put_2byte_hankaku:
- stosw
- jmp putssjis_loop_end
-
-put_2byte_zenkaku:
- stosw
- orb $0x80, %ah
- stosw
- decw %cx
-
-putssjis_loop_end:
- loop putssjis_loop
-
- pop %ax
- pop %es
- ret
-
- # Check 2-byte code.
-check_sjis:
- cmpb $0x80, %al
- jbe found_ank_kana
- cmpb $0xa0, %al
- jb found_2byte_char
- cmpb $0xe0, %al
- jb found_ank_kana
- cmpb $0xf0, %al
- jae found_ank_kana
- jmp found_2byte_char
-found_ank_kana:
- clc
- ret
-
-found_2byte_char:
- # Convert Shift-JIS into JIS.
- cmpb $0x9f, %al
- ja sjis_h_2 # Upper > 0x9f
- subb $0x71, %al # Upper -= 0x71
- jmp sjis_lower
-sjis_h_2:
- subb $0xb1, %al # Upper -= 0xb1
-sjis_lower:
- salb %al # Upper *= 2
- incb %al # Upper += 1
-
- cmpb $0x7f, %ah
- jbe sjis_l_2
- decb %ah # Lower -= 1 if lower > 0x7f
-sjis_l_2:
- cmpb $0x9e, %ah
- jb sjis_l_3
- subb $0x7d, %ah # Lower -= 0x7d
- incb %al # Upper += 1
- jmp check_2byte_end
-sjis_l_3:
- subb $0x1f, %ah # Lower -= 0x1f
-check_2byte_end:
- stc
- ret
diff --git a/sys/boot/pc98/boot0.5/selector.s b/sys/boot/pc98/boot0.5/selector.s
deleted file mode 100644
index 9d98ef866d17..000000000000
--- a/sys/boot/pc98/boot0.5/selector.s
+++ /dev/null
@@ -1,450 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000, 2007.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
-
- .text
-#
-# Display partition table.
-#
-showpartitions:
- # Clear partition table area
- movw $16, %cx
-clear_part:
- push %cx
- movw %cx, %dx
- decw %dx
- addw $5, %dx
- movw $20, %cx
- call sc_goto
- movw $msg_spc, %di
- call sc_puts
- pop %cx
- loop clear_part
-
- # Check `Exit' menu
- movw curdevice, %ax
- cmpw ndevice, %ax
- je no_slice
-
- # XXX Move this to a suitable place!
- movw $22, %cx
- movw $4, %dx
- call sc_goto
- movw $msg_slice, %di
- call sc_puts
-
- # Check the number of partitions
- movw npartition, %cx
- orw %cx, %cx
- jnz partitionexist
-no_slice:
- # Just show the `no slice' message.
- movw $22, %cx
- movw $5, %dx
- call sc_goto
- movw $msg_noslice, %di
- call sc_puts
- ret
-partitionexist:
- xorw %si, %si # %si = partition number
-showpart_loop:
- push %cx # %cx = number of partitions
- movw $22, %cx
- movw %si, %dx
- addw $5, %dx
- call sc_goto
- movw %si, %di
- movb $5, %cl
- shlw %cl, %di
- addw $0x10, %di # SYSM field
- # SYSM: space filled string. Don't use sc_puts.
- movw $16, %cx
-showpart_name:
- push %cx
- movb parttable(%di), %al
- call sc_putc
- incw %di
- pop %cx
- loop showpart_name
- incw %si
- pop %cx
- loop showpart_loop
- ret
-
-#
-# Show default slice indicator
-# If the default boot slice exists, `*' indicator will be showed.
-#
-showdefaultslicemark:
- cmpb $0x80, defpartflag
- je defpartexist
- ret
-defpartexist:
- movw npartition, %cx
-defslice_loop:
- movw %cx, %bx
- decw %bx
- push %cx
- push %bx
- movw $40, %cx
- movw %bx, %dx
- addw $5, %dx
- call sc_goto
-
- pop %bx
- pop %cx
- movb defpartnum, %al
- cmpb partnum(%bx), %al
- jne nomatch
- movb $'*', %al
- call sc_putc
- jmp defslice_done
-nomatch:
- movb $' ', %al
- call sc_putc
-defslice_done:
- loop defslice_loop
- ret
-
-#
-# Hide default slice indicator
-#
-hidedefaultslicemark:
- movw $16, %cx
-hidedefslice_loop:
- push %cx
- movw %cx, %dx
- addw $4, %dx
- movw $40, %cx
- call sc_goto
- movb $' ', %al
- call sc_putc
- pop %cx
- loop hidedefslice_loop
- ret
-
-#
-# Toggle default slice
-#
-toggle_default:
- cmpb $0x80, defpartflag
- jne set_default
- # Clear default
- movb $0, defpartflag
- call write_ipl # Restore
- call hidedefaultslicemark
- ret
- # Set default slice
-set_default:
- movw curpartition, %si
- movb partnum(%si), %al # %al = real partition number
- movb $5, %cl
- shlw %cl, %si
- # Default slice must be bootable
- testb $0x80, parttable(%si)
- jnz curpart_bootable
- # Current partition is not bootable.
- ret
-curpart_bootable:
- movb $0x80, defpartflag
- movb %al, defpartnum
- call write_ipl # Restore
- call showdefaultslicemark
- ret
-
-#
-# Show/hide cursor
-#
-show_devcurs:
- xorw %cx, %cx
- movw curdevice, %dx
- addw $5, %dx
- call sc_goto
- movb $'>', %al
- call sc_putc
- movb $'>', %al
- call sc_putc
- ret
-
-hide_devcurs:
- xorw %cx, %cx
- movw curdevice, %dx
- addw $5, %dx
- call sc_goto
- movb $' ', %al
- call sc_putc
- movb $' ', %al
- call sc_putc
- ret
-
-show_slicecurs:
- movw $20, %cx
- movw curpartition, %dx
- addw $5, %dx
- call sc_goto
- movb $'>', %al
- call sc_putc
- movb $'>', %al
- call sc_putc
- ret
-
-hide_slicecurs:
- movw $20, %cx
- movw curpartition, %dx
- addw $5, %dx
- call sc_goto
- movb $' ', %al
- call sc_putc
- movb $' ', %al
- call sc_putc
- ret
-
-isforceboot:
- xorw %cx, %cx
- movw $20, %dx
- call sc_goto
- movw $msg_force, %di
- call sc_puts
- call sc_getc
- push %ax
- xorw %cx, %cx
- movw $20, %dx
- call sc_goto
- movw $msg_forceclr, %di
- call sc_puts
- pop %ax
- cmpb $0x15, %ah
- je force_yes
- xorw %ax, %ax
- ret
-force_yes:
- movw $1, %ax
- ret
-
-#
-# Main loop for device mode
-#
-devmode:
- call read_ipl
- call hidedefaultslicemark
- call showpartitions
- call showdefaultslicemark
- call show_devcurs
-
- movw $2, %cx
- movw $4, %dx
- call sc_goto
- movb $0xe5, %al
- movw $6, %cx
- call sc_setattr
- movw $22, %cx
- movw $4, %dx
- call sc_goto
- movb $0xe1, %al
- movw $5, %cx
- call sc_setattr
- movw $44, %cx
- movw $3, %dx
- call sc_goto
- movb $0xe5, %al
- movw $11, %cx
- call sc_setattr
- movw $44, %cx
- movw $7, %dx
- call sc_goto
- movb $0xe1, %al
- movw $10, %cx
- call sc_setattr
-
-devmode_loop:
- call sc_getc
- movw ndevice, %bx
- cmpb $0x3a, %ah # UP
- je dev_up
- cmpb $0x3d, %ah # DOWN
- je dev_down
- cmpb $0x3c, %ah # RIGHT
- je dev_right
- cmpb $0x1c, %ah # RETURN
- jne devmode_loop
- cmpw curdevice, %bx
- jne dev_right
- movw $3, mode # N88-BASIC
- ret
-
- # XXX
- .space 5, 0x90
- ret # Dummy ret @0x9ab
-
-dev_up:
- cmpw $0, curdevice
- je devmode_loop
- call hide_devcurs
- decw curdevice
- call read_ipl
- call hidedefaultslicemark
- call showpartitions
- call showdefaultslicemark
- call show_devcurs
- jmp devmode_loop
-dev_down:
- cmpw curdevice, %bx
- je devmode_loop
- call hide_devcurs
- incw curdevice
- call read_ipl
- call hidedefaultslicemark
- call showpartitions
- call showdefaultslicemark
- call show_devcurs
- jmp devmode_loop
-dev_right:
- cmpw curdevice, %bx
- je devmode_loop
- movw $1, mode # Slice mode
- ret
-
-#
-# main loop for slice mode
-#
-slicemode:
- movw $0, curpartition
- call show_slicecurs
- movw $2, %cx
- movw $4, %dx
- call sc_goto
- movb $0xe1, %al
- movw $6, %cx
- call sc_setattr
- movw $22, %cx
- movw $4, %dx
- call sc_goto
- movb $0xe5, %al
- movw $5, %cx
- call sc_setattr
- movw $44, %cx
- movw $3, %dx
- call sc_goto
- movb $0xe1, %al
- movw $11, %cx
- call sc_setattr
- movw $44, %cx
- movw $7, %dx
- call sc_goto
- movb $0xe5, %al
- movw $10, %cx
- call sc_setattr
-
-slicemode_loop:
- call sc_getc
- cmpb $0x3a, %ah # UP
- je slice_up
- cmpb $0x3d, %ah # DOWN
- je slice_down
- cmpb $0x3b, %ah # LEFT
- je slice_esc
- cmpb $0x00, %ah # ESC
- je slice_esc
- cmpb $0x1c, %ah # RETURN
- je slice_ret
- cmpb $0x34, %ah # SPC
- je slice_spc
- cmpb $0x62, %ah # f1
- je slice_spc
- jmp slicemode_loop
-slice_up:
- cmpw $0, curpartition
- je slicemode_loop
- call hide_slicecurs
- decw curpartition
- call show_slicecurs
- jmp slicemode_loop
-slice_down:
- movw curpartition, %bx
- movw npartition, %ax
- decw %ax
- cmpw %bx, %ax
- je slicemode_loop
- call hide_slicecurs
- incw curpartition
- call show_slicecurs
- jmp slicemode_loop
-slice_esc:
- movw $0, mode # Device mode
- ret
-slice_spc:
- call toggle_default
- jmp slicemode_loop
-slice_ret:
- # Test bit 7 of mid
- movw curpartition, %si
- movb $5, %cl
- shlw %cl, %si
- testb $0x80, parttable(%si)
- jnz bootable_slice
- call isforceboot
- orw %ax, %ax
- jz slicemode_loop
-bootable_slice:
- call boot
- jmp slicemode_loop
-
-#
-# Main loop
-#
- .global selector
-selector:
- movw $0, curdevice # trydefault may change the curdevice.
- movw $0, mode
-
-selector_loop:
- cmpw $0, mode
- je status_dev
- cmpw $1, mode
- je status_slice
- ret
-status_dev:
- call devmode
- jmp selector_loop
-status_slice:
- call slicemode
- jmp selector_loop
-
- .data
- .global curpartition
-curpartition: .word 0 # current patition
-mode: .word 0
-
-msg_spc: .asciz " "
-msg_slice: .asciz "Slice"
-msg_noslice: .asciz "no slice"
-msg_force: .asciz "This slice is not bootable. Continue? (Y / [N])"
-msg_forceclr: .asciz " "
diff --git a/sys/boot/pc98/boot0.5/start.s b/sys/boot/pc98/boot0.5/start.s
deleted file mode 100644
index 008ae66b15e3..000000000000
--- a/sys/boot/pc98/boot0.5/start.s
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000, 2007.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
- .global start
- .code16
-
- .text
-start:
- jmp start1
-
- # Magic
- .org 0x053, 0x20
- .byte 0x4e, 0x45, 0x43
-
- .org 0x8f
- .byte 0x32, 0x2e, 0x37, 0x30
-
- .org 0x2d4
-start1:
- # The instruction 'call 0x9ab' can be here. See also selector.s.
- nop
- nop
- nop
- cli
- movw %cs, %ax
- movw %ax, %ds
- movw %ss, iniss
- movw %sp, inisp
- movw %ax, %ss
- movw $0xfffe, %sp
- sti
- xorw %ax, %ax
- movw %ax, %es
- call main
-
- cli
- movw %cs:iniss, %ss
- movw %cs:inisp, %sp
- sti
- int $0x1e
- # NOTREACHED
- lret
-
- .data
- .global iniss, inisp
-iniss: .word 0
-inisp: .word 0
diff --git a/sys/boot/pc98/boot0.5/support.s b/sys/boot/pc98/boot0.5/support.s
deleted file mode 100644
index df1115bdaaeb..000000000000
--- a/sys/boot/pc98/boot0.5/support.s
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
-
- .text
-#
-# Wait 1ms
-#
- .global wait1ms
-wait1ms:
- push %cx
- movw $800, %cx
-wait_loop:
- outb %al, $0x5f
- loop wait_loop
- pop %cx
- ret
-
-#
-# Read one byte from BIOS parameter block
-# %bx offset
-# %dl value
-#
- .global read_biosparam
-read_biosparam:
- movb %es:(%bx), %dl
- ret
-
-#
-# Write one byte to BIOS parameter block
-# %bx offset
-# %dl value
-#
- .global write_biosparam
-write_biosparam:
- movb %dl, %es:(%bx)
- ret
-
-#
-# beep
-#
- .global beep_on, beep_off, beep
-beep_on:
- movb $0x17, %ah
- int $0x18
- ret
-
-beep_off:
- movb $0x18, %ah
- int $0x18
- ret
-
-beep:
- push %cx
- call beep_on
- movw $100, %cx
-beep_loop1:
- call wait1ms
- loop beep_loop1
- call beep_off
- movw $50, %cx
-beep_loop2:
- call wait1ms
- loop beep_loop2
- pop %cx
- ret
diff --git a/sys/boot/pc98/boot0.5/syscons.s b/sys/boot/pc98/boot0.5/syscons.s
deleted file mode 100644
index 150b835f795d..000000000000
--- a/sys/boot/pc98/boot0.5/syscons.s
+++ /dev/null
@@ -1,253 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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 ``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 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.
-#
-# $FreeBSD$
-#
-
- .code16
-
- .text
-#
-# %al character code
-# destroyed: %al, %bx
-#
-put_character:
- movw $0xe000, %bx
- movb ishireso, %ah
- orb %ah, %ah
- jne hireso_ch
- movw $0xa000, %bx
-hireso_ch:
- movw %bx, %es
- xorb %ah, %ah
- movw curpos, %bx
- movw %ax, %es:(%bx)
- xorw %ax, %ax
- movw %ax, %es
- ret
-
-#
-# %al attribute
-# destroyed: %ah, %cx
-#
-set_attribute:
- movw $0xe200, %bx
- movb ishireso, %ah
- orb %ah, %ah
- jne hireso_ch
- movw $0xa200, %bx
-hireso_attr:
- movw %bx, %es
- xorb %ah, %ah
- movw curpos, %bx
- movw %ax, %es:(%bx)
- xorw %bx, %bx
- movw %bx, %es
- ret
-
-#
-# Put a character
-# %al: character code
-# destroyed: %ah, %bx, %cx
-#
- .global sc_putc
-sc_putc:
- call put_character
- incw curpos
- incw curpos
- cmpw $4000, curpos
- jng putc_end
- movw $0, curpos
-putc_end:
- ret
-
-#
-# Put a null terminated string
-# %di: pointer to string
-# destroyed: %ah, %cx, %di
-#
- .global sc_puts
-sc_puts:
- movb (%di), %al
- orb %al, %al
- jz puts_end
- call sc_putc
- incw %di
- jmp sc_puts
-puts_end:
- ret
-
-#
-# Change the current cursor position
-# %cx: X
-# %dx: Y
-# destroyed: %ax, %bx
-#
- .global sc_goto
-sc_goto:
- movw %dx, %ax # AX=Y
- shlw %ax # AX=Y*64
- shlw %ax
- shlw %ax
- shlw %ax
- shlw %ax
- shlw %ax
- movw %dx, %bx # BX=Y
- shlw %bx # BX=Y*16
- shlw %bx
- shlw %bx
- shlw %bx
- addw %bx, %ax # AX=Y*64+Y*16=Y*80
- addw %cx, %ax
- shlw %ax
- movw %ax, curpos
- ret
-
-#
-# Clear screen
-# destroyed: %ax, %bx
-#
- .global sc_clean
-sc_clean:
- movb $0x16, %ah
- movw $0xe120, %dx
- int $0x18 # KBD/CRT BIOS
- movw $0, curpos
- ret
-
-#
-# Set sttribute code
-# %al: attribute
-# %cx: count
-# destroyed: %ax, %bx, %cx
-#
- .global sc_setattr
-sc_setattr:
- call set_attribute
- incw curpos
- incw curpos
- loop sc_setattr
-
-#
-# Sense the state of shift key
-# destroyed: %ax
-#
- .global sc_getshiftkey
-sc_getshiftkey:
- movb $2, %ah # Sense KB_SHIFT_COD
- int $0x18 # KBD/CRT BIOS
- xorb %ah, %ah
- ret
-
-#
-# Check KBD buffer
-#
- .global sc_iskeypress
-sc_iskeypress:
- mov $1, %ah
- int $0x18 # KBD/CRT BIOS
- testb $1, %bh
- jz no_key
- movw $1, %ax
- ret
-no_key:
- xorw %ax, %ax
- ret
-
-#
-# Read from KBD
-#
- .global sc_getc
-sc_getc:
- xorb %ah, %ah
- int $0x18
- ret
-
-#
-# Initialize CRT (normal mode)
-#
-init_screen_normal:
- # Disable graphic screen
- movb $0x41, %ah
- int $0x18
- # Init graphic screen
- movb $0x42, %al
- movb $0xc0, %ch
- int $0x18
- # 80x25 mode
- movw $0x0a00, %ax
- int $0x18
- ret
-
-#
-# Initialize CRT (hireso mode)
-#
-init_screen_hireso:
- # Init RAM window
- movb $8, %al
- outb %al, $0x91
- movb $0x0a, %al
- outb %al, $0x93
- # 80x31 mode
- movw $0x0a00, %ax
- int $0x18
- ret
-
-#
-# Initialize screen (internal)
-#
-init_screen:
- movb ishireso, %ah
- orb %ah, %ah
- jne hireso_ini
- call init_screen_normal
- jmp init_next
-hireso_ini:
- call init_screen_hireso
-init_next:
- movb $0x0c, %ah
- int $0x18
- # cursor home and off
- xorw %dx, %dx
- movb $0x13, %ah
- int $0x18
- movb $0x12, %ah
- int $0x18
- ret
-
-#
-# Initialize screeen
-#
- .global sc_init
-sc_init:
- call init_screen
- call sc_clean
- movw $0, curpos
- ret
-
- .data
-curpos: .word 0 # Current cursor position
diff --git a/sys/boot/pc98/boot0/Makefile b/sys/boot/pc98/boot0/Makefile
deleted file mode 100644
index d348f6020e41..000000000000
--- a/sys/boot/pc98/boot0/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-
-PROG= ${BOOT}
-INTERNALPROG=
-FILES= ${BOOT}
-MAN=
-SRCS= ${BOOT}.s
-CLEANFILES= ${BOOT}
-
-BOOT= boot0
-
-# The base address that we the boot0 code to to run it. Don't change this
-# unless you are glutton for punishment.
-BOOT_BOOT0_ORG?= 0x0000
-ORG=${BOOT_BOOT0_ORG}
-
-LDFLAGS=${LDFLAGS_BIN}
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/boot0/boot0.s b/sys/boot/pc98/boot0/boot0.s
deleted file mode 100644
index 508e2521157a..000000000000
--- a/sys/boot/pc98/boot0/boot0.s
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright (c) KATO Takenori, 1999, 2000.
-#
-# All rights reserved. Unpublished rights reserved under the copyright
-# laws of Japan.
-#
-# 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 as
-# the first lines of this file unmodified.
-# 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.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
-#
-# $FreeBSD$
-
- .globl start
- .code16
-start:
- jmp main
-
- .org 4
- .ascii "IPL1"
- .byte 0, 0, 0
-
- .globl start
-main:
- xor %ax, %ax
- mov %ax, %ds
- mov (0x584), %al # DA/UA
- mov %al, %ah
- and $0xf0, %ah
- cmp $0x90, %ah
- je fdd
-
- # hdd
- mov $6, %ah
- mov $0x3000, %bx
- mov %bx, %es
- mov $0x2000, %bx
- xor %cx, %cx
- xor %dx, %dx
- xor %bp, %bp
- int $0x1b
- jc error_hdd
-
- push %ax
- mov %es, %ax
- add $0x40, %ax
- mov %ax, %es
- pop %ax
- push %es
- push %bp
- lret
-
- # fdd
-fdd:
- xor %di, %di
-fdd_retry:
- mov $0xd6, %ah
- mov $0x3000, %bx
- mov %bx, %es
- mov $0x2000, %bx
- mov $0x0200, %cx
- mov $0x0001, %dx
- xor %bp, %bp
- int $0x1b
- jc error
- push %ax
- mov %es, %ax
- add $0x40, %ax
- mov %ax, %es
- pop %ax
- push %es
- push %bp
- lret
-
-error:
- or %di, %di
- jnz error_hdd
- and $0x0f, %al
- or $0x30, %al
- jmp fdd_retry
-
-error_hdd:
- jmp error
-
- .org 0x1fa
- .byte 0 # defflag_off
- .byte 0 # defpart_off
- .byte 1 # menu version
- .byte 0
- .word 0xaa55
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
deleted file mode 100644
index 2db0590964a2..000000000000
--- a/sys/boot/pc98/boot2/Makefile
+++ /dev/null
@@ -1,116 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-FILES= boot boot1 boot2
-
-NM?= nm
-
-BOOT_COMCONSOLE_PORT?= 0x238
-BOOT_COMCONSOLE_SPEED?= 9600
-B2SIOFMT?= 0x3
-
-REL1= 0x700
-ORG1= 0
-ORG2= 0x2000
-
-# Decide level of UFS support.
-BOOT2_UFS?= UFS1_AND_UFS2
-#BOOT2_UFS?= UFS2_ONLY
-#BOOT2_UFS?= UFS1_ONLY
-
-CFLAGS= -fomit-frame-pointer \
- -mrtd \
- -mregparm=3 \
- -D${BOOT2_UFS} \
- -DFLAGS=${BOOT_BOOT1_FLAGS} \
- -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
- -DSIOFMT=${B2SIOFMT} \
- -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
- -I${.CURDIR}/../../.. \
- -I${.CURDIR}/../../i386/boot2 \
- -I${.CURDIR}/../../common \
- -I${.CURDIR}/../btx/lib -I. \
- -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
- -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
- -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
- -Winline
-
-CFLAGS.gcc+= -Os \
- -fno-guess-branch-probability \
- -fno-unit-at-a-time \
- --param max-inline-insns-single=100
-.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
-CFLAGS.gcc+= -mno-align-long-strings
-.endif
-
-# Set machine type to PC98_SYSTEM_PARAMETER
-#CFLAGS+= -DSET_MACHINE_TYPE
-
-# Initialize the bi_bios_geom using the BIOS geometry
-#CFLAGS+= -DGET_BIOSGEOM
-
-CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
-
-LD_FLAGS=${LD_FLAGS_BIN}
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
-
-.PATH: ${.CURDIR}/../../i386/boot2
-
-CLEANFILES= boot
-
-boot: boot1 boot2
- cat boot1 boot2 > boot
-
-CLEANFILES+= boot1 boot1.out boot1.o
-
-boot1: boot1.out
- ${OBJCOPY} -S -O binary boot1.out ${.TARGET}
-
-boot1.out: boot1.o
- ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
-
-CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
- boot2.s boot2.s.tmp boot2.h sio.o
-
-boot2: boot2.ld
- @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
- echo "$$x bytes available"; test $$x -ge 0
- ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync
-
-boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
- btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
- -o ${.TARGET} -P 1 boot2.bin
-
-boot2.ldr:
- ${DD} if=/dev/zero of=${.TARGET} bs=276 count=1
-
-boot2.bin: boot2.out
- ${OBJCOPY} -S -O binary boot2.out ${.TARGET}
-
-boot2.out: ${BTXCRT} boot2.o sio.o
- ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
-
-boot2.o: boot2.s
- ${CC} ${ACFLAGS} -c boot2.s
-
-SRCS= boot2.c boot2.h
-
-boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
- ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
- sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
- rm -f boot2.s.tmp
-
-boot2.h: boot1.out
- ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \
- { x = $$1 - ORG1; \
- printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
- ORG1=`printf "%d" ${ORG1}` \
- REL1=`printf "%d" ${REL1}` > ${.TARGET}
-
-.include <bsd.prog.mk>
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.boot1.S= ${CLANG_NO_IAS}
diff --git a/sys/boot/pc98/boot2/boot1.S b/sys/boot/pc98/boot2/boot1.S
deleted file mode 100644
index 5c972061d07c..000000000000
--- a/sys/boot/pc98/boot2/boot1.S
+++ /dev/null
@@ -1,395 +0,0 @@
-/*-
- * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- *
- * $FreeBSD$
- */
-
-/* Memory Locations */
- .set STACK_OFF,0x6000 # Stack offset
- .set LOAD_SIZE,8192 # Load size
- .set DAUA,0x0584 # DA/UA
- .set MEM_REL,0x700 # Relocation address
- .set MEM_ARG,0x900 # Arguments
- .set MEM_BUF,0x8cec # Load area
- .set MEM_BTX,0x9000 # BTX start
- .set MEM_JMP,0x9010 # BTX entry point
- .set MEM_USR,0xa000 # Client start
-
-/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */
- .set MEM_SYS, 0xa100 # System common area segment
- .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type
- .set EPSON_ID, 0x0624 # EPSON machine id
-
- .set M_NEC_PC98, 0x0001
- .set M_EPSON_PC98, 0x0002
- .set M_NOT_H98, 0x0010
- .set M_H98, 0x0020
- .set M_NOTE, 0x0040
- .set M_NORMAL, 0x1000
- .set M_8M, 0x8000
-
-/* Partition Constants */
- .set PRT_OFF,0x1be # Partition offset
-
-/* Misc. Constants */
- .set SIZ_PAG,0x1000 # Page size
- .set SIZ_SEC,0x200 # Sector size
-
- .set NSECT,0x10
-
- .globl start
- .globl read
- .globl putc
- .code16
-
-start: jmp main
-
-boot_cyl: .org 4
- .ascii "IPL1 "
-
-main: cld
-
- /* Setup the stack */
- xor %si,%si
- mov %si,%ss
- mov $STACK_OFF,%sp
-
- push %cx
-
- /* Relocate ourself to MEM_REL */
- push %cs
- pop %ds
- mov %si,%es
- mov $MEM_REL,%di
- mov $SIZ_SEC,%cx
- rep
- movsb
-
- /* Transfer PC-9801 system common area */
- xor %ax,%ax
- mov %ax,%si
- mov %ax,%ds
- mov %ax,%di
- mov $MEM_SYS,%ax
- mov %ax,%es
- mov $0x0600,%cx
- rep
- movsb
-
- /* Transfer EPSON machine type */
- mov $0xfd00,%ax
- mov %ax,%ds
- mov (0x804),%eax
- and $0x00ffffff,%eax
- mov %eax,%es:(EPSON_ID)
-
- /* Set machine type to PC98_SYSTEM_PARAMETER */
-#ifdef SET_MACHINE_TYPE
- call set_machine_type
-#else
- mov $M_NEC_PC98+M_NOT_H98,%eax
- mov %eax,%es:(PC98_MACHINE_TYPE)
-#endif
-
- /* Setup graphic screen */
- mov $0x42,%ah /* 640x400 */
- mov $0xc0,%ch
- int $0x18
- mov $0x40,%ah /* graph on */
- int $0x18
-
- /* Setup text screen */
- mov $0x0a00,%ax /* 80x25 */
- int $0x18
- mov $0x0c,%ah /* text on */
- int $0x18
- mov $0x13,%ah /* cursor home */
- xor %dx,%dx
- int $0x18
- mov $0x11,%ah /* cursor on */
- int $0x18
-
- /* Setup keyboard */
- mov $0x03,%ah
- int $0x18
-
- pop %cx
-
- /* bootstrap passes */
- xor %edi,%edi
- mov %di,%ds
- mov %di,%es
- mov %cs,%bx
- cmp $0x1fe0,%bx
- jz boot_fd
- cmp $0x1fc0,%bx
- jnz boot_hd
- xor %cx,%cx
- mov (DAUA),%al
- and $0xf0,%al
- cmp $0x30,%al
- jz boot_fd
- cmp $0x90,%al
- jnz boot_hd
-boot_fd: xor %cx,%cx
- jmp boot_load
-boot_hd: test %cx,%cx
- jnz boot_load
- mov %cs:(boot_cyl),%cx
-boot_load: mov %cx,MEM_ARG /* Save cylinder number */
- mov %cx,%di
- xor %dx,%dx
- mov $LOAD_SIZE,%bx
- mov $MEM_BUF,%bp
- push %cs
- callw read
- jc error
-
- /* Transfer boot2.bin */
- mov $MEM_BTX,%bx
- mov 0xa(%bx),%si /* BTX size */
- add %bx,%si /* start of boot2.bin */
- mov $MEM_USR+SIZ_PAG*2,%di
- mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx
- sub %si,%cx
- rep
- movsb
-
- /* Enable A20 */
- xor %ax,%ax
- outb %al,$0xf2
- mov $0x02,%al
- outb %al,$0xf6
-
- /* Start BTX */
- ljmp $0x0000,$MEM_JMP
-
-/*
- * Reads sectors from the disk.
- * Call with:
- *
- * %bx - bytes to read
- * %cx - cylinder
- * %dh - head
- * %dl - sector
- * %edi - lba
- * %es:(%bp) - buffer to read data into
- */
-read: xor %ax,%ax
- mov %ax,%ds
- mov $0x06,%ah
- mov (DAUA),%al
- mov %ax,%si
- and $0xf0,%al
- cmp $0x30,%al /* 1.44MB FDD */
- jz read_fd
- cmp $0x90,%al /* 1MB FDD */
- jz read_fd
- cmp $0xa0,%al /* Is SCSI device? */
- jnz read_load
- push %cx
- mov %si,%cx
- and $0x0f,%cl
- inc %cl
- mov (0x482),%ah
- shr %cl,%ah /* Is SCSI HDD? */
- pop %cx
- jc read_load
- and $0xff7f,%si /* SCSI MO */
- mov %di,%cx
- shr $16,%edi
- mov %di,%dx
- jmp read_load
-read_fd: or $0xd000,%si
- or $0x0200,%cx
- inc %dx
-read_load: mov %si,%ax
- int $0x1b
- lret
-
-/*
- * Print out the error message, wait for a keypress, and then reboot
- * the machine.
- */
-error: push %cs
- pop %ds
- mov $msg_eread,%si
- call putstr
- xor %ax,%ax /* Get keypress */
- int $0x18
- xor %ax,%ax /* CPU reset */
- outb %al,$0xf0
-halt: hlt
- jmp halt /* Spin */
-
-/*
- * Display a null-terminated string.
- */
-putstr.0: push %cs
- callw putc
-putstr: lodsb
- test %al,%al
- jne putstr.0
- ret
-
-/*
- * Display a single char.
- */
-putc: pusha
- xor %dx,%dx
- mov %dx,%ds
- mov MEM_REL+cursor-start,%di
- mov $0xa000,%bx
- mov %bx,%es
- mov $(80*2),%cx
-
- cmp $0x08,%al
- je putc.bs
- cmp $0x0d,%al
- je putc.cr
- cmp $0x0a,%al
- je putc.lf
- cmp $0x5c,%al /* \ */
- jne 1f
- mov $0xfc,%al
-1: movb $0xe1,%es:0x2000(%di)
- stosw
- jmp putc.scr
-putc.bs: test %di,%di
- jz putc.move
- dec %di
- dec %di
- movb $0xe1,%es:0x2000(%di)
- movw $0x20,%es:(%di)
- jmp putc.move
-putc.cr: mov %di,%ax
- div %cx
- sub %dx,%di
- jmp putc.move
-putc.lf: add %cx,%di
-putc.scr: cmp $(80*2*25),%di /* Scroll screen */
- jb putc.move
- push %ds
- mov %bx,%ds
- mov $(80*2),%si
- xor %di,%di
- mov $(80*24/2),%cx
- rep
- movsl
- xor %ax,%ax
- mov $0x20,%al
- mov $80,%cl
- rep
- stosw
- pop %ds
- mov $(80*24*2),%di
-putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */
- mov $0x13,%ah
- mov %di,%dx
- int $0x18
- popa
- lret
-
-cursor: .word 0
-
-#ifdef SET_MACHINE_TYPE
-/*
- * Set machine type to PC98_SYSTEM_PARAMETER.
- */
-set_machine_type:
- xor %edx,%edx
- mov %dx,%ds
-// mov $MEM_SYS,%ax
-// mov %ax,%es
-
- /* Wait V-SYNC */
-vsync.1: inb $0x60,%al
- test $0x20,%al
- jnz vsync.1
-vsync.2: inb $0x60,%al
- test $0x20,%al
- jz vsync.2
-
- /* ANK 'A' font */
- xor %al,%al
- outb %al,$0xa1
- mov $0x41,%al
- outb %al,$0xa3
-
- /* Get 'A' font from CG window */
- push %ds
- mov $0xa400,%ax
- mov %ax,%ds
- xor %eax,%eax
- xor %bx,%bx
- mov $4,%cx
-font.1: add (%bx),%eax
- add $4,%bx
- loop font.1
- pop %ds
- cmp $0x6efc58fc,%eax
- jnz m_epson
-
-m_pc98: or $M_NEC_PC98,%edx
- mov $0x0458,%bx
- mov (%bx),%al
- test $0x80,%al
- jz m_not_h98
- or $M_H98,%edx
- jmp 1f
-m_epson: or $M_EPSON_PC98,%edx
-m_not_h98: or $M_NOT_H98,%edx
-
-1: inb $0x42,%al
- test $0x20,%al
- jz 1f
- or $M_8M,%edx
-
-1: mov $0x0400,%bx
- mov (%bx),%al
- test $0x80,%al
- jz 1f
- or $M_NOTE,%edx
-
-1: mov $PC98_MACHINE_TYPE,%bx
- mov %edx,%es:(%bx)
- ret
-#endif
-
-/* Messages */
-
-msg_eread: .asciz "Error\r\n"
-
- .org PRT_OFF,0x90
-
-/* Partition table */
-
- .fill 0x30,0x1,0x0
- .byte 0x80, 0x00, 0x01, 0x00
- .byte 0xa5, 0xff, 0xff, 0xff
- .byte 0x00, 0x00, 0x00, 0x00
- .byte 0x50, 0xc3, 0x00, 0x00
-
- .word 0xaa55 # Magic number
diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c
deleted file mode 100644
index b5825168d84e..000000000000
--- a/sys/boot/pc98/boot2/boot2.c
+++ /dev/null
@@ -1,803 +0,0 @@
-/*-
- * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro
- * Copyright (c) 1998 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/disklabel.h>
-#include <sys/diskpc98.h>
-#include <sys/dirent.h>
-#include <sys/reboot.h>
-
-#include <machine/bootinfo.h>
-#include <machine/cpufunc.h>
-#include <machine/elf.h>
-
-#include <stdarg.h>
-
-#include <a.out.h>
-
-#include <btxv86.h>
-
-#include "boot2.h"
-#include "lib.h"
-#include "paths.h"
-#include "rbx.h"
-
-/* Define to 0 to omit serial support */
-#ifndef SERIAL
-#define SERIAL 0
-#endif
-
-#define IO_KEYBOARD 1
-#define IO_SERIAL 2
-
-#if SERIAL
-#define DO_KBD (ioctrl & IO_KEYBOARD)
-#define DO_SIO (ioctrl & IO_SERIAL)
-#else
-#define DO_KBD (1)
-#define DO_SIO (0)
-#endif
-
-#define SECOND 1 /* Circa that many ticks in a second. */
-
-#define ARGS 0x900
-#define NOPT 14
-#define NDEV 3
-
-#define DRV_DISK 0xf0
-#define DRV_UNIT 0x0f
-
-#define TYPE_AD 0
-#define TYPE_DA 1
-#define TYPE_FD 2
-
-extern uint32_t _end;
-
-static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */
-static const unsigned char flags[NOPT] = {
- RBX_DUAL,
- RBX_SERIAL,
- RBX_ASKNAME,
- RBX_CDROM,
- RBX_CONFIG,
- RBX_KDB,
- RBX_GDB,
- RBX_MUTE,
- RBX_NOINTR,
- RBX_PAUSE,
- RBX_QUIET,
- RBX_DFLTROOT,
- RBX_SINGLE,
- RBX_VERBOSE
-};
-
-static const char *const dev_nm[NDEV] = {"ad", "da", "fd"};
-static const unsigned char dev_maj[NDEV] = {30, 4, 2};
-static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90};
-
-static struct dsk {
- unsigned daua;
- unsigned type;
- unsigned disk;
- unsigned unit;
- unsigned head;
- unsigned sec;
- uint8_t slice;
- uint8_t part;
- unsigned start;
-} dsk;
-static char cmd[512], cmddup[512], knamebuf[1024];
-static const char *kname;
-uint32_t opts;
-static struct bootinfo bootinfo;
-#if SERIAL
-static int comspeed = SIOSPD;
-static uint8_t ioctrl = IO_KEYBOARD;
-#endif
-
-int main(void);
-void exit(int);
-static void load(void);
-static int parse(void);
-static int dskread(void *, unsigned, unsigned);
-static void printf(const char *,...);
-static void putchar(int);
-static int drvread(void *, unsigned);
-static int keyhit(unsigned);
-static int xputc(int);
-static int xgetc(int);
-static inline int getc(int);
-
-static void memcpy(void *, const void *, int);
-static void
-memcpy(void *dst, const void *src, int len)
-{
- const char *s = src;
- char *d = dst;
-
- while (len--)
- *d++ = *s++;
-}
-
-static inline int
-strcmp(const char *s1, const char *s2)
-{
- for (; *s1 == *s2 && *s1; s1++, s2++);
- return (unsigned char)*s1 - (unsigned char)*s2;
-}
-
-#define UFS_SMALL_CGBASE
-#include "ufsread.c"
-
-static inline int
-xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
-{
- if ((size_t)fsread(inode, buf, nbyte) != nbyte) {
- printf("Invalid %s\n", "format");
- return -1;
- }
- return 0;
-}
-
-static inline void
-getstr(void)
-{
- char *s;
- int c;
-
- s = cmd;
- for (;;) {
- switch (c = xgetc(0)) {
- case 0:
- break;
- case '\177':
- case '\b':
- if (s > cmd) {
- s--;
- printf("\b \b");
- }
- break;
- case '\n':
- case '\r':
- *s = 0;
- return;
- default:
- if (s - cmd < sizeof(cmd) - 1)
- *s++ = c;
- putchar(c);
- }
- }
-}
-
-static inline void
-putc(int c)
-{
-
- v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
- v86.addr = PUTCORG; /* call to putc in boot1 */
- v86.eax = c;
- v86int();
- v86.ctl = V86_FLAGS;
-}
-
-static inline int
-is_scsi_hd(void)
-{
-
- if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01)
- return 1;
-
- return 0;
-}
-
-static inline void
-fix_sector_size(void)
-{
- u_char *p;
-
- p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */
-
- if ((p[0] & 0x1f) == 7) { /* SCSI MO */
- if (!(p[3] & 0x30)) { /* 256B / sector */
- p[3] |= 0x10; /* forced set 512B / sector */
- p[3 + 0xa1000] |= 0x10;
- }
- }
-}
-
-static inline uint32_t
-get_diskinfo(void)
-{
-
- if (dsk.disk == 0x30) { /* 1440KB FD */
- /* 80 cylinders, 2 heads, 18 sectors */
- return (80 << 16) | (2 << 8) | 18;
- } else if (dsk.disk == 0x90) { /* 1200KB FD */
- /* 80 cylinders, 2 heads, 15 sectors */
- return (80 << 16) | (2 << 8) | 15;
- } else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */
- v86.addr = 0x1b;
- v86.eax = 0x8400 | dsk.daua;
- v86int();
- return (v86.ecx << 16) | v86.edx;
- }
-
- /* SCSI MO or CD */
- fix_sector_size(); /* SCSI MO */
-
- /* other SCSI devices */
- return (65535 << 16) | (8 << 8) | 32;
-}
-
-static void
-set_dsk(void)
-{
- uint32_t di;
-
- di = get_diskinfo();
-
- dsk.head = (di >> 8) & 0xff;
- dsk.sec = di & 0xff;
- dsk.start = 0;
-}
-
-#ifdef GET_BIOSGEOM
-static uint32_t
-bd_getbigeom(int bunit)
-{
- int hds = 0;
- int unit = 0x80; /* IDE HDD */
- u_int addr = 0x55d;
-
- while (unit < 0xa7) {
- if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f)))
- if (hds++ == bunit)
- break;
-
- if (unit >= 0xA0) {
- int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F;
-
- if (media == 7 && hds++ == bunit) /* SCSI MO */
- return(0xFFFE0820); /* C:65535 H:8 S:32 */
- }
- if (++unit == 0x84) {
- unit = 0xA0; /* SCSI HDD */
- addr = 0x482;
- }
- }
- if (unit == 0xa7)
- return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
- v86.addr = 0x1b;
- v86.eax = 0x8400 | unit;
- v86int();
- if (V86_CY(v86.efl))
- return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
- return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff);
-}
-#endif
-
-static int
-check_slice(void)
-{
- struct pc98_partition *dp;
- char *sec;
- unsigned i, cyl;
-
- sec = dmadat->secbuf;
- cyl = *(uint16_t *)PTOV(ARGS);
- set_dsk();
-
- if (dsk.type == TYPE_FD)
- return (WHOLE_DISK_SLICE);
- if (drvread(sec, PC98_BBSECTOR))
- return (WHOLE_DISK_SLICE); /* Read error */
- dp = (void *)(sec + PC98_PARTOFF);
- for (i = 0; i < PC98_NPARTS; i++) {
- if (dp[i].dp_mid == DOSMID_386BSD) {
- if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl)
- return (BASE_SLICE + i);
- }
- }
-
- return (WHOLE_DISK_SLICE);
-}
-
-int
-main(void)
-{
-#ifdef GET_BIOSGEOM
- int i;
-#endif
- uint8_t autoboot;
- ufs_ino_t ino;
- size_t nbyte;
-
- dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base);
- v86.ctl = V86_FLAGS;
- v86.efl = PSL_RESERVED_DEFAULT | PSL_I;
- dsk.daua = *(uint8_t *)PTOV(0x584);
- dsk.disk = dsk.daua & DRV_DISK;
- dsk.unit = dsk.daua & DRV_UNIT;
- if (dsk.disk == 0x80)
- dsk.type = TYPE_AD;
- else if (dsk.disk == 0xa0)
- dsk.type = TYPE_DA;
- else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */
- dsk.type = TYPE_FD;
- dsk.slice = check_slice();
-#ifdef GET_BIOSGEOM
- for (i = 0; i < N_BIOS_GEOM; i++)
- bootinfo.bi_bios_geom[i] = bd_getbigeom(i);
-#endif
- bootinfo.bi_version = BOOTINFO_VERSION;
- bootinfo.bi_size = sizeof(bootinfo);
-
- /* Process configuration file */
-
- autoboot = 1;
-
- if ((ino = lookup(PATH_CONFIG)) ||
- (ino = lookup(PATH_DOTCONFIG))) {
- nbyte = fsread(ino, cmd, sizeof(cmd) - 1);
- cmd[nbyte] = '\0';
- }
-
- if (*cmd) {
- memcpy(cmddup, cmd, sizeof(cmd));
- if (parse())
- autoboot = 0;
- if (!OPT_CHECK(RBX_QUIET))
- printf("%s: %s", PATH_CONFIG, cmddup);
- /* Do not process this command twice */
- *cmd = 0;
- }
-
- /*
- * Try to exec stage 3 boot loader. If interrupted by a keypress,
- * or in case of failure, try to load a kernel directly instead.
- */
-
- if (!kname) {
- kname = PATH_LOADER;
- if (autoboot && !keyhit(3*SECOND)) {
- load();
- kname = PATH_KERNEL;
- }
- }
-
- /* Present the user with the boot2 prompt. */
-
- for (;;) {
- if (!autoboot || !OPT_CHECK(RBX_QUIET))
- printf("\nFreeBSD/pc98 boot\n"
- "Default: %u:%s(%u,%c)%s\n"
- "boot: ",
- dsk.unit, dev_nm[dsk.type], dsk.unit,
- 'a' + dsk.part, kname);
- if (DO_SIO)
- sio_flush();
- if (!autoboot || keyhit(3*SECOND))
- getstr();
- else if (!autoboot || !OPT_CHECK(RBX_QUIET))
- putchar('\n');
- autoboot = 0;
- if (parse())
- putchar('\a');
- else
- load();
- }
-}
-
-/* XXX - Needed for btxld to link the boot2 binary; do not remove. */
-void
-exit(int x)
-{
-}
-
-static void
-load(void)
-{
- union {
- struct exec ex;
- Elf32_Ehdr eh;
- } hdr;
- static Elf32_Phdr ep[2];
- static Elf32_Shdr es[2];
- caddr_t p;
- ufs_ino_t ino;
- uint32_t addr;
- int k;
- uint8_t i, j;
-
- if (!(ino = lookup(kname))) {
- if (!ls)
- printf("No %s\n", kname);
- return;
- }
- if (xfsread(ino, &hdr, sizeof(hdr)))
- return;
-
- if (N_GETMAGIC(hdr.ex) == ZMAGIC) {
- addr = hdr.ex.a_entry & 0xffffff;
- p = PTOV(addr);
- fs_off = PAGE_SIZE;
- if (xfsread(ino, p, hdr.ex.a_text))
- return;
- p += roundup2(hdr.ex.a_text, PAGE_SIZE);
- if (xfsread(ino, p, hdr.ex.a_data))
- return;
- } else if (IS_ELF(hdr.eh)) {
- fs_off = hdr.eh.e_phoff;
- for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) {
- if (xfsread(ino, ep + j, sizeof(ep[0])))
- return;
- if (ep[j].p_type == PT_LOAD)
- j++;
- }
- for (i = 0; i < 2; i++) {
- p = PTOV(ep[i].p_paddr & 0xffffff);
- fs_off = ep[i].p_offset;
- if (xfsread(ino, p, ep[i].p_filesz))
- return;
- }
- p += roundup2(ep[1].p_memsz, PAGE_SIZE);
- bootinfo.bi_symtab = VTOP(p);
- if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) {
- fs_off = hdr.eh.e_shoff + sizeof(es[0]) *
- (hdr.eh.e_shstrndx + 1);
- if (xfsread(ino, &es, sizeof(es)))
- return;
- for (i = 0; i < 2; i++) {
- *(Elf32_Word *)p = es[i].sh_size;
- p += sizeof(es[i].sh_size);
- fs_off = es[i].sh_offset;
- if (xfsread(ino, p, es[i].sh_size))
- return;
- p += es[i].sh_size;
- }
- }
- addr = hdr.eh.e_entry & 0xffffff;
- bootinfo.bi_esymtab = VTOP(p);
- } else {
- printf("Invalid %s\n", "format");
- return;
- }
-
- bootinfo.bi_kernelname = VTOP(kname);
- bootinfo.bi_bios_dev = dsk.daua;
- __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
- MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part),
- 0, 0, 0, VTOP(&bootinfo));
-}
-
-static int
-parse()
-{
- char *arg = cmd;
- char *ep, *p, *q;
- const char *cp;
- unsigned int drv;
- int c, i, j;
- size_t k;
-
- while ((c = *arg++)) {
- if (c == ' ' || c == '\t' || c == '\n')
- continue;
- for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++);
- ep = p;
- if (*p)
- *p++ = 0;
- if (c == '-') {
- while ((c = *arg++)) {
- if (c == 'P') {
- if (*(uint8_t *)PTOV(0x481) & 0x48) {
- cp = "yes";
- } else {
- opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL);
- cp = "no";
- }
- printf("Keyboard: %s\n", cp);
- continue;
-#if SERIAL
- } else if (c == 'S') {
- j = 0;
- while ((unsigned int)(i = *arg++ - '0') <= 9)
- j = j * 10 + i;
- if (j > 0 && i == -'0') {
- comspeed = j;
- break;
- }
- /* Fall through to error below ('S' not in optstr[]). */
-#endif
- }
- for (i = 0; c != optstr[i]; i++)
- if (i == NOPT - 1)
- return -1;
- opts ^= OPT_SET(flags[i]);
- }
-#if SERIAL
- ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) :
- OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD;
- if (DO_SIO) {
- if (sio_init(115200 / comspeed) != 0)
- ioctrl &= ~IO_SERIAL;
- }
-#endif
- } else {
- for (q = arg--; *q && *q != '('; q++);
- if (*q) {
- drv = -1;
- if (arg[1] == ':') {
- drv = *arg - '0';
- if (drv > 9)
- return (-1);
- arg += 2;
- }
- if (q - arg != 2)
- return -1;
- for (i = 0; arg[0] != dev_nm[i][0] ||
- arg[1] != dev_nm[i][1]; i++)
- if (i == NDEV - 1)
- return -1;
- dsk.type = i;
- arg += 3;
- dsk.unit = *arg - '0';
- if (arg[1] != ',' || dsk.unit > 9)
- return -1;
- arg += 2;
- dsk.slice = WHOLE_DISK_SLICE;
- if (arg[1] == ',') {
- dsk.slice = *arg - '0' + 1;
- if (dsk.slice > PC98_NPARTS + 1)
- return -1;
- arg += 2;
- }
- if (arg[1] != ')')
- return -1;
- dsk.part = *arg - 'a';
- if (dsk.part > 7)
- return (-1);
- arg += 2;
- if (drv == -1)
- drv = dsk.unit;
- dsk.disk = dev_daua[dsk.type];
- dsk.daua = dsk.disk | dsk.unit;
- dsk_meta = 0;
- }
- k = ep - arg;
- if (k > 0) {
- if (k >= sizeof(knamebuf))
- return -1;
- memcpy(knamebuf, arg, k + 1);
- kname = knamebuf;
- }
- }
- arg = p;
- }
- return 0;
-}
-
-static int
-dskread(void *buf, unsigned lba, unsigned nblk)
-{
- struct pc98_partition *dp;
- struct disklabel *d;
- char *sec;
- unsigned i;
- uint8_t sl;
- u_char *p;
- const char *reason;
-
- if (!dsk_meta) {
- sec = dmadat->secbuf;
- set_dsk();
- if (dsk.type == TYPE_FD)
- goto unsliced;
- if (drvread(sec, PC98_BBSECTOR))
- return -1;
- dp = (void *)(sec + PC98_PARTOFF);
- sl = dsk.slice;
- if (sl < BASE_SLICE) {
- for (i = 0; i < PC98_NPARTS; i++)
- if (dp[i].dp_mid == DOSMID_386BSD) {
- sl = BASE_SLICE + i;
- break;
- }
- dsk.slice = sl;
- }
- if (sl != WHOLE_DISK_SLICE) {
- dp += sl - BASE_SLICE;
- if (dp->dp_mid != DOSMID_386BSD) {
- reason = "slice";
- goto error;
- }
- dsk.start = dp->dp_scyl * dsk.head * dsk.sec +
- dp->dp_shd * dsk.sec + dp->dp_ssect;
- }
- if (drvread(sec, dsk.start + LABELSECTOR))
- return -1;
- d = (void *)(sec + LABELOFFSET);
- if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) {
- if (dsk.part != RAW_PART) {
- reason = "label";
- goto error;
- }
- } else {
- if (dsk.part >= d->d_npartitions ||
- !d->d_partitions[dsk.part].p_size) {
- reason = "partition";
- goto error;
- }
- dsk.start += d->d_partitions[dsk.part].p_offset;
- dsk.start -= d->d_partitions[RAW_PART].p_offset;
- }
- unsliced: ;
- }
- for (p = buf; nblk; p += 512, lba++, nblk--) {
- if ((i = drvread(p, dsk.start + lba)))
- return i;
- }
- return 0;
-error:
- printf("Invalid %s\n", reason);
- return -1;
-}
-
-static void
-printf(const char *fmt,...)
-{
- va_list ap;
- static char buf[10];
- char *s;
- unsigned u;
- int c;
-
- va_start(ap, fmt);
- while ((c = *fmt++)) {
- if (c == '%') {
- c = *fmt++;
- switch (c) {
- case 'c':
- putchar(va_arg(ap, int));
- continue;
- case 's':
- for (s = va_arg(ap, char *); *s; s++)
- putchar(*s);
- continue;
- case 'u':
- u = va_arg(ap, unsigned);
- s = buf;
- do
- *s++ = '0' + u % 10U;
- while (u /= 10U);
- while (--s >= buf)
- putchar(*s);
- continue;
- }
- }
- putchar(c);
- }
- va_end(ap);
- return;
-}
-
-static void
-putchar(int c)
-{
- if (c == '\n')
- xputc('\r');
- xputc(c);
-}
-
-static int
-drvread(void *buf, unsigned lba)
-{
- static unsigned c = 0x2d5c7c2f;
- unsigned bpc, x, cyl, head, sec;
-
- bpc = dsk.sec * dsk.head;
- cyl = lba / bpc;
- x = lba % bpc;
- head = x / dsk.sec;
- sec = x % dsk.sec;
-
- if (!OPT_CHECK(RBX_QUIET)) {
- xputc(c = c << 8 | c >> 24);
- xputc('\b');
- }
- v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
- v86.addr = READORG; /* call to read in boot1 */
- v86.ecx = cyl;
- v86.edx = (head << 8) | sec;
- v86.edi = lba;
- v86.ebx = 512;
- v86.es = VTOPSEG(buf);
- v86.ebp = VTOPOFF(buf);
- v86int();
- v86.ctl = V86_FLAGS;
- if (V86_CY(v86.efl)) {
- printf("error %u c/h/s %u/%u/%u lba %u\n", v86.eax >> 8 & 0xff,
- cyl, head, sec, lba);
- return -1;
- }
- return 0;
-}
-
-static inline void
-delay(void)
-{
- int i;
-
- i = 800;
- do {
- outb(0x5f, 0); /* about 600ns */
- } while (--i >= 0);
-}
-
-static int
-keyhit(unsigned sec)
-{
- unsigned i;
-
- if (OPT_CHECK(RBX_NOINTR))
- return 0;
- for (i = 0; i < sec * 1000; i++) {
- if (xgetc(1))
- return 1;
- delay();
- }
- return 0;
-}
-
-static int
-xputc(int c)
-{
- if (DO_KBD)
- putc(c);
- if (DO_SIO)
- sio_putc(c);
- return c;
-}
-
-static int
-getc(int fn)
-{
- v86.addr = 0x18;
- v86.eax = fn << 8;
- v86int();
- if (fn)
- return (v86.ebx >> 8) & 0x01;
- else
- return v86.eax & 0xff;
-}
-
-static int
-xgetc(int fn)
-{
- if (OPT_CHECK(RBX_NOINTR))
- return 0;
- for (;;) {
- if (DO_KBD && getc(1))
- return fn ? 1 : getc(0);
- if (DO_SIO && sio_ischar())
- return fn ? 1 : sio_getc();
- if (fn)
- return 0;
- }
-}
diff --git a/sys/boot/pc98/btx/Makefile b/sys/boot/pc98/btx/Makefile
deleted file mode 100644
index 39f78ed639b9..000000000000
--- a/sys/boot/pc98/btx/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= btx btxldr lib
-
-.include <bsd.subdir.mk>
diff --git a/sys/boot/pc98/btx/Makefile.inc b/sys/boot/pc98/btx/Makefile.inc
deleted file mode 100644
index 265f86d1ed55..000000000000
--- a/sys/boot/pc98/btx/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc"
diff --git a/sys/boot/pc98/btx/btx/Makefile b/sys/boot/pc98/btx/btx/Makefile
deleted file mode 100644
index 275546068286..000000000000
--- a/sys/boot/pc98/btx/btx/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# $FreeBSD$
-
-PROG= btx
-INTERNALPROG=
-MAN=
-SRCS= btx.S
-
-.if defined(BOOT_BTX_NOHANG)
-BOOT_BTX_FLAGS=0x1
-.else
-BOOT_BTX_FLAGS=0x0
-.endif
-
-CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS}
-CFLAGS+=-I${.CURDIR}/../../../i386/common
-
-.if defined(BTX_SERIAL)
-BOOT_COMCONSOLE_PORT?= 0x238
-BOOT_COMCONSOLE_SPEED?= 9600
-B2SIOFMT?= 0x3
-
-CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
- -DSIOFMT=${B2SIOFMT} -DSIOSPD=${BOOT_COMCONSOLE_SPEED}
-.endif
-
-ORG= 0x9000
-
-LDFLAGS=${LDFLAGS_BIN}
-
-.include <bsd.prog.mk>
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.btx.S= ${CLANG_NO_IAS}
diff --git a/sys/boot/pc98/btx/btx/btx.S b/sys/boot/pc98/btx/btx/btx.S
deleted file mode 100644
index e8710d38584a..000000000000
--- a/sys/boot/pc98/btx/btx/btx.S
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*
- * Copyright (c) 1998 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- *
- * $FreeBSD$
- */
-
-#include <bootargs.h>
-
-/*
- * Memory layout.
- */
- .set MEM_BTX,0x1000 # Start of BTX memory
- .set MEM_ESP0,0x1800 # Supervisor stack
- .set MEM_BUF,0x1800 # Scratch buffer
- .set MEM_ESPR,0x5e00 # Real mode stack
- .set MEM_IDT,0x5e00 # IDT
- .set MEM_TSS,0x5f98 # TSS
- .set MEM_MAP,0x6000 # I/O bit map
- .set MEM_TSS_END,0x7fff # End of TSS
- .set MEM_ORG,0x9000 # BTX code
- .set MEM_USR,0xa000 # Start of user memory
-/*
- * Paging control.
- */
- .set PAG_SIZ,0x1000 # Page size
- .set PAG_CNT,0x1000 # Pages to map
-/*
- * Fields in %eflags.
- */
- .set PSL_RESERVED_DEFAULT,0x00000002
- .set PSL_T,0x00000100 # Trap flag
- .set PSL_I,0x00000200 # Interrupt enable flag
- .set PSL_VM,0x00020000 # Virtual 8086 mode flag
- .set PSL_AC,0x00040000 # Alignment check flag
-/*
- * Segment selectors.
- */
- .set SEL_SCODE,0x8 # Supervisor code
- .set SEL_SDATA,0x10 # Supervisor data
- .set SEL_RCODE,0x18 # Real mode code
- .set SEL_RDATA,0x20 # Real mode data
- .set SEL_UCODE,0x28|3 # User code
- .set SEL_UDATA,0x30|3 # User data
- .set SEL_TSS,0x38 # TSS
-/*
- * Task state segment fields.
- */
- .set TSS_ESP0,0x4 # PL 0 ESP
- .set TSS_SS0,0x8 # PL 0 SS
- .set TSS_MAP,0x66 # I/O bit map base
-/*
- * System calls.
- */
- .set SYS_EXIT,0x0 # Exit
- .set SYS_EXEC,0x1 # Exec
-/*
- * Fields in V86 interface structure.
- */
- .set V86_CTL,0x0 # Control flags
- .set V86_ADDR,0x4 # Int number/address
- .set V86_ES,0x8 # V86 ES
- .set V86_DS,0xc # V86 DS
- .set V86_FS,0x10 # V86 FS
- .set V86_GS,0x14 # V86 GS
-/*
- * V86 control flags.
- */
- .set V86F_ADDR,0x10000 # Segment:offset address
- .set V86F_CALLF,0x20000 # Emulate far call
- .set V86F_FLAGS,0x40000 # Return flags
-/*
- * Dump format control bytes.
- */
- .set DMP_X16,0x1 # Word
- .set DMP_X32,0x2 # Long
- .set DMP_MEM,0x4 # Memory
- .set DMP_EOL,0x8 # End of line
-/*
- * Screen defaults and assumptions.
- */
- .set SCR_MAT,0xe1 # Mode/attribute
- .set SCR_COL,0x50 # Columns per row
- .set SCR_ROW,0x19 # Rows per screen
-/*
- * BIOS Data Area locations.
- */
- .set BDA_MEM,0x501 # Free memory
- .set BDA_POS,0x53e # Cursor position
-/*
- * Derivations, for brevity.
- */
- .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0
- .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base
- .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit
- .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit
-/*
- * Code segment.
- */
- .globl start
- .code16
-start: # Start of code
-/*
- * BTX header.
- */
-btx_hdr: .byte 0xeb # Machine ID
- .byte 0xe # Header size
- .ascii "BTX" # Magic
- .byte 0x1 # Major version
- .byte 0x2 # Minor version
- .byte BTX_FLAGS # Flags
- .word PAG_CNT-MEM_ORG>>0xc # Paging control
- .word break-start # Text size
- .long 0x0 # Entry address
-/*
- * Initialization routine.
- */
-init: cli # Disable interrupts
- xor %ax,%ax # Zero/segment
- mov %ax,%ss # Set up
- mov $MEM_ESP0,%sp # stack
- mov %ax,%es # Address
- mov %ax,%ds # data
- pushl $0x2 # Clear
- popfl # flags
-/*
- * Initialize memory.
- */
- mov $MEM_IDT,%di # Memory to initialize
- mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero
- rep # Zero-fill
- stosw # memory
-/*
- * Update real mode IDT for reflecting hardware interrupts.
- */
- mov $intr20,%bx # Address first handler
- mov $0x10,%cx # Number of handlers
- mov $0x20*4,%di # First real mode IDT entry
-init.0: mov %bx,(%di) # Store IP
- inc %di # Address next
- inc %di # entry
- stosw # Store CS
- add $4,%bx # Next handler
- loop init.0 # Next IRQ
-/*
- * Create IDT.
- */
- mov $MEM_IDT,%di
- mov $idtctl,%si # Control string
-init.1: lodsb # Get entry
- cbw # count
- xchg %ax,%cx # as word
- jcxz init.4 # If done
- lodsb # Get segment
- xchg %ax,%dx # P:DPL:type
- lodsw # Get control
- xchg %ax,%bx # set
- lodsw # Get handler offset
- mov $SEL_SCODE,%dh # Segment selector
-init.2: shr %bx # Handle this int?
- jnc init.3 # No
- mov %ax,(%di) # Set handler offset
- mov %dh,0x2(%di) # and selector
- mov %dl,0x5(%di) # Set P:DPL:type
- add $0x4,%ax # Next handler
-init.3: lea 0x8(%di),%di # Next entry
- loop init.2 # Till set done
- jmp init.1 # Continue
-/*
- * Initialize TSS.
- */
-init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0
- movb $SEL_SDATA,TSS_SS0(%di) # Set SS0
- movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base
-/*
- * Bring up the system.
- */
- mov $0x2820,%bx # Set protected mode
- callw setpic # IRQ offsets
- lidt idtdesc # Set IDT
- lgdt gdtdesc # Set GDT
- mov %cr0,%eax # Switch to protected
- inc %ax # mode
- mov %eax,%cr0 #
- ljmp $SEL_SCODE,$init.8 # To 32-bit code
- .code32
-init.8: xorl %ecx,%ecx # Zero
- movb $SEL_SDATA,%cl # To 32-bit
- movw %cx,%ss # stack
-/*
- * Launch user task.
- */
- movb $SEL_TSS,%cl # Set task
- ltr %cx # register
- movl $MEM_USR,%edx # User base address
- movzwl %ss:BDA_MEM,%eax # Get free memory
- andl $0x7,%eax
- incl %eax
- shll $0x11,%eax # To bytes
- subl $ARGSPACE,%eax # Less arg space
- subl %edx,%eax # Less base
- movb $SEL_UDATA,%cl # User data selector
- pushl %ecx # Set SS
- pushl %eax # Set ESP
- push $0x202 # Set flags (IF set)
- push $SEL_UCODE # Set CS
- pushl btx_hdr+0xc # Set EIP
- pushl %ecx # Set GS
- pushl %ecx # Set FS
- pushl %ecx # Set DS
- pushl %ecx # Set ES
- pushl %edx # Set EAX
- movb $0x7,%cl # Set remaining
-init.9: push $0x0 # general
- loop init.9 # registers
-#ifdef BTX_SERIAL
- call sio_init # setup the serial console
-#endif
- popa # and initialize
- popl %es # Initialize
- popl %ds # user
- popl %fs # segment
- popl %gs # registers
- iret # To user mode
-/*
- * Exit routine.
- */
-exit: cli # Disable interrupts
- movl $MEM_ESP0,%esp # Clear stack
-/*
- * Turn off paging.
- */
- movl %cr0,%eax # Get CR0
- andl $~0x80000000,%eax # Disable
- movl %eax,%cr0 # paging
- xorl %ecx,%ecx # Zero
- movl %ecx,%cr3 # Flush TLB
-/*
- * Restore the GDT in case we caught a kernel trap.
- */
- lgdt %cs:gdtdesc # Set GDT
-/*
- * To 16 bits.
- */
- ljmpw $SEL_RCODE,$exit.1 # Reload CS
- .code16
-exit.1: mov $SEL_RDATA,%cl # 16-bit selector
- mov %cx,%ss # Reload SS
- mov %cx,%ds # Load
- mov %cx,%es # remaining
- mov %cx,%fs # segment
- mov %cx,%gs # registers
-/*
- * To real-address mode.
- */
- dec %ax # Switch to
- mov %eax,%cr0 # real mode
- ljmp $0x0,$exit.2 # Reload CS
-exit.2: xor %ax,%ax # Real mode segment
- mov %ax,%ss # Reload SS
- mov %ax,%ds # Address data
- mov $0x1008,%bx # Set real mode
- callw setpic # IRQ offsets
- lidt ivtdesc # Set IVT
-/*
- * Reboot or await reset.
- */
- sti # Enable interrupts
- testb $0x1,btx_hdr+0x7 # Reboot?
-exit.3: jz exit.3 # No
- movb $0xa0,%al
- outb %al,$0x35
- movb $0x00,%al
- outb %al,$0xf0 # reboot the machine
-exit.4: jmp exit.4
-/*
- * Set IRQ offsets by reprogramming 8259A PICs.
- */
-setpic: in $0x02,%al # Save master
- push %ax # IMR
- in $0x0a,%al # Save slave
- push %ax # IMR
- movb $0x11,%al # ICW1 to
- outb %al,$0x00 # master,
- outb %al,$0x08 # slave
- movb %bl,%al # ICW2 to
- outb %al,$0x02 # master
- movb %bh,%al # ICW2 to
- outb %al,$0x0a # slave
- movb $0x80,%al # ICW3 to
- outb %al,$0x02 # master
- movb $0x7,%al # ICW3 to
- outb %al,$0x0a # slave
- movb $0x1d,%al # ICW4 to
- outb %al,$0x02 # master,
- movb $0x9,%al # ICW4 to
- outb %al,$0x0a # slave
- pop %ax # Restore slave
- outb %al,$0x0a # IMR
- pop %ax # Restore master
- outb %al,$0x02 # IMR
- retw # To caller
- .code32
-/*
- * Exception jump table.
- */
-intx00: push $0x0 # Int 0x0: #DE
- jmp ex_noc # Divide error
- push $0x1 # Int 0x1: #DB
- jmp ex_noc # Debug
- push $0x3 # Int 0x3: #BP
- jmp ex_noc # Breakpoint
- push $0x4 # Int 0x4: #OF
- jmp ex_noc # Overflow
- push $0x5 # Int 0x5: #BR
- jmp ex_noc # BOUND range exceeded
- push $0x6 # Int 0x6: #UD
- jmp ex_noc # Invalid opcode
- push $0x7 # Int 0x7: #NM
- jmp ex_noc # Device not available
- push $0x8 # Int 0x8: #DF
- jmp except # Double fault
- push $0xa # Int 0xa: #TS
- jmp except # Invalid TSS
- push $0xb # Int 0xb: #NP
- jmp except # Segment not present
- push $0xc # Int 0xc: #SS
- jmp except # Stack segment fault
- push $0xd # Int 0xd: #GP
- jmp except # General protection
- push $0xe # Int 0xe: #PF
- jmp except # Page fault
-intx10: push $0x10 # Int 0x10: #MF
- jmp ex_noc # Floating-point error
-/*
- * Save a zero error code.
- */
-ex_noc: pushl (%esp,1) # Duplicate int no
- movb $0x0,0x4(%esp,1) # Fake error code
-/*
- * Handle exception.
- */
-except: cld # String ops inc
- pushl %ds # Save
- pushl %es # most
- pusha # registers
- pushl %gs # Set GS
- pushl %fs # Set FS
- pushl %ds # Set DS
- pushl %es # Set ES
- cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode?
- jne except.1 # No
- pushl %ss # Set SS
- jmp except.2 # Join common code
-except.1: pushl 0x50(%esp,1) # Set SS
-except.2: pushl 0x50(%esp,1) # Set ESP
- push $SEL_SDATA # Set up
- popl %ds # to
- pushl %ds # address
- popl %es # data
- movl %esp,%ebx # Stack frame
- movl $dmpfmt,%esi # Dump format string
- movl $MEM_BUF,%edi # Buffer
- pushl %eax
- pushl %edx
-wait.1: inb $0x60,%al
- testb $0x04,%al
- jz wait.1
- movb $0xe0,%al
- outb %al,$0x62
-wait.2: inb $0x60,%al
- testb $0x01,%al
- jz wait.2
- xorl %edx,%edx
- inb $0x62,%al
- movb %al,%dl
- inb $0x62,%al
- movb %al,%dh
- inb $0x62,%al
- inb $0x62,%al
- inb $0x62,%al
- movl %edx,%eax
- shlw $1,%ax
- movl $BDA_POS,%edx
- movw %ax,(%edx)
- popl %edx
- popl %eax
- pushl %edi # Dump to
- call dump # buffer
- popl %esi # and
- call putstr # display
- leal 0x18(%esp,1),%esp # Discard frame
- popa # Restore
- popl %es # registers
- popl %ds # saved
- cmpb $0x3,(%esp,1) # Breakpoint?
- je except.3 # Yes
- cmpb $0x1,(%esp,1) # Debug?
- jne except.2a # No
- testl $PSL_T,0x10(%esp,1) # Trap flag set?
- jnz except.3 # Yes
-except.2a: jmp exit # Exit
-except.3: leal 0x8(%esp,1),%esp # Discard err, int no
- iret # From interrupt
-
-/*
- * Reboot the machine by setting the reboot flag and exiting
- */
-reboot: orb $0x1,btx_hdr+0x7 # Set the reboot flag
- jmp exit # Terminate BTX and reboot
-
-/*
- * Protected Mode Hardware interrupt jump table.
- */
-intx20: push $0x8 # Int 0x20: IRQ0
- jmp int_hw # V86 int 0x8
- push $0x9 # Int 0x21: IRQ1
- jmp int_hw # V86 int 0x9
- push $0xa # Int 0x22: IRQ2
- jmp int_hw # V86 int 0xa
- push $0xb # Int 0x23: IRQ3
- jmp int_hw # V86 int 0xb
- push $0xc # Int 0x24: IRQ4
- jmp int_hw # V86 int 0xc
- push $0xd # Int 0x25: IRQ5
- jmp int_hw # V86 int 0xd
- push $0xe # Int 0x26: IRQ6
- jmp int_hw # V86 int 0xe
- push $0xf # Int 0x27: IRQ7
- jmp int_hw # V86 int 0xf
- push $0x10 # Int 0x28: IRQ8
- jmp int_hw # V86 int 0x10
- push $0x11 # Int 0x29: IRQ9
- jmp int_hw # V86 int 0x11
- push $0x12 # Int 0x2a: IRQ10
- jmp int_hw # V86 int 0x12
- push $0x13 # Int 0x2b: IRQ11
- jmp int_hw # V86 int 0x13
- push $0x14 # Int 0x2c: IRQ12
- jmp int_hw # V86 int 0x14
- push $0x15 # Int 0x2d: IRQ13
- jmp int_hw # V86 int 0x15
- push $0x16 # Int 0x2e: IRQ14
- jmp int_hw # V86 int 0x16
- push $0x17 # Int 0x2f: IRQ15
- jmp int_hw # V86 int 0x17
-
-/*
- * Invoke real mode interrupt/function call from user mode with arguments.
- */
-intx31: pushl $-1 # Dummy int no for btx_v86
-/*
- * Invoke real mode interrupt/function call from protected mode.
- *
- * We place a trampoline on the user stack that will return to rret_tramp
- * which will reenter protected mode and then finally return to the user
- * client.
- *
- * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR:
- *
- * -0x00 user %ss -0x04 kernel %esp (with full frame)
- * -0x04 user %esp -0x08 btx_v86 pointer
- * -0x08 user %eflags -0x0c flags (only used if interrupt)
- * -0x0c user %cs -0x10 real mode CS:IP return trampoline
- * -0x10 user %eip -0x12 real mode flags
- * -0x14 int no -0x16 real mode CS:IP (target)
- * -0x18 %eax
- * -0x1c %ecx
- * -0x20 %edx
- * -0x24 %ebx
- * -0x28 %esp
- * -0x2c %ebp
- * -0x30 %esi
- * -0x34 %edi
- * -0x38 %gs
- * -0x3c %fs
- * -0x40 %ds
- * -0x44 %es
- * -0x48 zero %eax (hardware int only)
- * -0x4c zero %ecx (hardware int only)
- * -0x50 zero %edx (hardware int only)
- * -0x54 zero %ebx (hardware int only)
- * -0x58 zero %esp (hardware int only)
- * -0x5c zero %ebp (hardware int only)
- * -0x60 zero %esi (hardware int only)
- * -0x64 zero %edi (hardware int only)
- * -0x68 zero %gs (hardware int only)
- * -0x6c zero %fs (hardware int only)
- * -0x70 zero %ds (hardware int only)
- * -0x74 zero %es (hardware int only)
- */
-int_hw: cld # String ops inc
- pusha # Save gp regs
- pushl %gs # Save
- pushl %fs # seg
- pushl %ds # regs
- pushl %es
- push $SEL_SDATA # Set up
- popl %ds # to
- pushl %ds # address
- popl %es # data
- leal 0x44(%esp,1),%esi # Base of frame
- movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer
- movl -0x14(%esi),%eax # Get Int no
- cmpl $-1,%eax # Hardware interrupt?
- jne intusr.1 # Yes
-/*
- * v86 calls save the btx_v86 pointer on the real mode stack and read
- * the address and flags from the btx_v86 structure. For interrupt
- * handler invocations (VM86 INTx requests), disable interrupts,
- * tracing, and alignment checking while the handler runs.
- */
- movl $MEM_USR,%ebx # User base
- movl %ebx,%edx # address
- addl -0x4(%esi),%ebx # User ESP
- movl (%ebx),%ebp # btx_v86 pointer
- addl %ebp,%edx # Flatten btx_v86 ptr
- movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr
- movl V86_ADDR(%edx),%eax # Get int no/address
- movl V86_CTL(%edx),%edx # Get control flags
- movl -0x08(%esi),%ebx # Save user flags in %ebx
- testl $V86F_ADDR,%edx # Segment:offset?
- jnz intusr.4 # Yes
- andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing,
- # and alignment checking for
- # interrupt handler
- jmp intusr.3 # Skip hardware interrupt
-/*
- * Hardware interrupts store a NULL btx_v86 pointer and use the
- * address (interrupt number) from the stack with empty flags. Also,
- * push a dummy frame of zeros onto the stack for all the general
- * purpose and segment registers and clear %eflags. This gives the
- * hardware interrupt handler a clean slate.
- */
-intusr.1: xorl %edx,%edx # Control flags
- movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr
- movl $12,%ecx # Frame is 12 dwords
-intusr.2: pushl $0x0 # Fill frame
- loop intusr.2 # with zeros
- movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags
-/*
- * Look up real mode IDT entry for hardware interrupts and VM86 INTx
- * requests.
- */
-intusr.3: shll $0x2,%eax # Scale
- movl (%eax),%eax # Load int vector
- jmp intusr.5 # Skip CALLF test
-/*
- * Panic if V86F_CALLF isn't set with V86F_ADDR.
- */
-intusr.4: testl $V86F_CALLF,%edx # Far call?
- jnz intusr.5 # Ok
- movl %edx,0x30(%esp,1) # Place VM86 flags in int no
- movl $badvm86,%esi # Display bad
- call putstr # VM86 call
- popl %es # Restore
- popl %ds # seg
- popl %fs # regs
- popl %gs
- popal # Restore gp regs
- jmp ex_noc # Panic
-/*
- * %eax now holds the segment:offset of the function.
- * %ebx now holds the %eflags to pass to real mode.
- * %edx now holds the V86F_* flags.
- */
-intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode
- # target
-/*
- * If this is a v86 call, copy the seg regs out of the btx_v86 structure.
- */
- movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr
- jecxz intusr.6 # Skip for hardware ints
- leal -0x44(%esi),%edi # %edi => kernel stack seg regs
- pushl %esi # Save
- leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs
- movl $4,%ecx # Copy seg regs
- rep # from btx_v86
- movsl # to kernel stack
- popl %esi # Restore
-intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real
- movl %ebx,MEM_ESPR-0x0c # mode return trampoline
- movl $rret_tramp,%ebx # Set return trampoline
- movl %ebx,MEM_ESPR-0x10 # CS:IP
- movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP
- ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment
- .code16
-intusr.7: movl %cr0,%eax # Leave
- dec %al # protected
- movl %eax,%cr0 # mode
- ljmpw $0x0,$intusr.8
-intusr.8: xorw %ax,%ax # Reset %ds
- movw %ax,%ds # and
- movw %ax,%ss # %ss
- lidt ivtdesc # Set IVT
- popl %es # Restore
- popl %ds # seg
- popl %fs # regs
- popl %gs
- popal # Restore gp regs
- movw $MEM_ESPR-0x16,%sp # Switch to real mode stack
- iret # Call target routine
-/*
- * For the return to real mode we setup a stack frame like this on the real
- * mode stack. Note that callf calls won't pop off the flags, but we just
- * ignore that by repositioning %sp to be just above the btx_v86 pointer
- * so it is aligned. The stack is relative to MEM_ESPR.
- *
- * -0x04 kernel %esp
- * -0x08 btx_v86
- * -0x0c %eax
- * -0x10 %ecx
- * -0x14 %edx
- * -0x18 %ebx
- * -0x1c %esp
- * -0x20 %ebp
- * -0x24 %esi
- * -0x28 %edi
- * -0x2c %gs
- * -0x30 %fs
- * -0x34 %ds
- * -0x38 %es
- * -0x3c %eflags
- */
-rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer
- pushal # Save gp regs
- pushl %gs # Save
- pushl %fs # seg
- pushl %ds # regs
- pushl %es
- pushfl # Save %eflags
- cli # Disable interrupts
- std # String ops dec
- xorw %ax,%ax # Reset seg
- movw %ax,%ds # regs
- movw %ax,%es # (%ss is already 0)
- lidt idtdesc # Set IDT
- lgdt gdtdesc # Set GDT
- mov %cr0,%eax # Switch to protected
- inc %ax # mode
- mov %eax,%cr0 #
- ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code
- .code32
-rret_tramp.1: xorl %ecx,%ecx # Zero
- movb $SEL_SDATA,%cl # Setup
- movw %cx,%ss # 32-bit
- movw %cx,%ds # seg
- movw %cx,%es # regs
- movl MEM_ESPR-0x04,%esp # Switch to kernel stack
- leal 0x44(%esp,1),%esi # Base of frame
- andb $~0x2,tss_desc+0x5 # Clear TSS busy
- movb $SEL_TSS,%cl # Set task
- ltr %cx # register
-/*
- * Now we are back in protected mode. The kernel stack frame set up
- * before entering real mode is still intact. For hardware interrupts,
- * leave the frame unchanged.
- */
- cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged
- jz rret_tramp.3 # for hardware ints
-/*
- * For V86 calls, copy the registers off of the real mode stack onto
- * the kernel stack as we want their updated values. Also, initialize
- * the segment registers on the kernel stack.
- *
- * Note that the %esp in the kernel stack after this is garbage, but popa
- * ignores it, so we don't have to fix it up.
- */
- leal -0x18(%esi),%edi # Kernel stack GP regs
- pushl %esi # Save
- movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs
- movl $8,%ecx # Copy GP regs from
- rep # real mode stack
- movsl # to kernel stack
- movl $SEL_UDATA,%eax # Selector for data seg regs
- movl $4,%ecx # Initialize %ds,
- rep # %es, %fs, and
- stosl # %gs
-/*
- * For V86 calls, copy the saved seg regs on the real mode stack back
- * over to the btx_v86 structure. Also, conditionally update the
- * saved eflags on the kernel stack based on the flags from the user.
- */
- movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr
- leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs
- leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs
- xchgl %ecx,%edx # Save btx_v86 ptr
- movl $4,%ecx # Copy seg regs
- rep # from real mode stack
- movsl # to btx_v86
- popl %esi # Restore
- movl V86_CTL(%edx),%edx # Read V86 control flags
- testl $V86F_FLAGS,%edx # User wants flags?
- jz rret_tramp.3 # No
- movl MEM_ESPR-0x3c,%eax # Read real mode flags
- movw %ax,-0x08(%esi) # Update user flags (low 16)
-/*
- * Return to the user task
- */
-rret_tramp.3: popl %es # Restore
- popl %ds # seg
- popl %fs # regs
- popl %gs
- popal # Restore gp regs
- addl $4,%esp # Discard int no
- iret # Return to user mode
-
-/*
- * System Call.
- */
-intx30: cmpl $SYS_EXEC,%eax # Exec system call?
- jne intx30.1 # No
- pushl %ss # Set up
- popl %es # all
- pushl %es # segment
- popl %ds # registers
- pushl %ds # for the
- popl %fs # program
- pushl %fs # we're
- popl %gs # invoking
- movl $MEM_USR,%eax # User base address
- addl 0xc(%esp,1),%eax # Change to user
- leal 0x4(%eax),%esp # stack
- popl %eax # Call
- call *%eax # program
-intx30.1: orb $0x1,%ss:btx_hdr+0x7 # Flag reboot
- jmp exit # Exit
-/*
- * Dump structure [EBX] to [EDI], using format string [ESI].
- */
-dump.0: stosb # Save char
-dump: lodsb # Load char
- testb %al,%al # End of string?
- jz dump.10 # Yes
- testb $0x80,%al # Control?
- jz dump.0 # No
- movb %al,%ch # Save control
- movb $'=',%al # Append
- stosb # '='
- lodsb # Get offset
- pushl %esi # Save
- movsbl %al,%esi # To
- addl %ebx,%esi # pointer
- testb $DMP_X16,%ch # Dump word?
- jz dump.1 # No
- lodsw # Get and
- call hex16 # dump it
-dump.1: testb $DMP_X32,%ch # Dump long?
- jz dump.2 # No
- lodsl # Get and
- call hex32 # dump it
-dump.2: testb $DMP_MEM,%ch # Dump memory?
- jz dump.8 # No
- pushl %ds # Save
- testl $PSL_VM,0x50(%ebx) # V86 mode?
- jnz dump.3 # Yes
- verr 0x4(%esi) # Readable selector?
- jnz dump.3 # No
- ldsl (%esi),%esi # Load pointer
- jmp dump.4 # Join common code
-dump.3: lodsl # Set offset
- xchgl %eax,%edx # Save
- lodsl # Get segment
- shll $0x4,%eax # * 0x10
- addl %edx,%eax # + offset
- xchgl %eax,%esi # Set pointer
-dump.4: movb $2,%dl # Num lines
-dump.4a: movb $0x10,%cl # Bytes to dump
-dump.5: lodsb # Get byte and
- call hex8 # dump it
- decb %cl # Keep count
- jz dump.6a # If done
- movb $'-',%al # Separator
- cmpb $0x8,%cl # Half way?
- je dump.6 # Yes
- movb $' ',%al # Use space
-dump.6: stosb # Save separator
- jmp dump.5 # Continue
-dump.6a: decb %dl # Keep count
- jz dump.7 # If done
- movb $0xa,%al # Line feed
- stosb # Save one
- movb $7,%cl # Leading
- movb $' ',%al # spaces
-dump.6b: stosb # Dump
- decb %cl # spaces
- jnz dump.6b
- jmp dump.4a # Next line
-dump.7: popl %ds # Restore
-dump.8: popl %esi # Restore
- movb $0xa,%al # Line feed
- testb $DMP_EOL,%ch # End of line?
- jnz dump.9 # Yes
- movb $' ',%al # Use spaces
- stosb # Save one
-dump.9: jmp dump.0 # Continue
-dump.10: stosb # Terminate string
- ret # To caller
-/*
- * Convert EAX, AX, or AL to hex, saving the result to [EDI].
- */
-hex32: pushl %eax # Save
- shrl $0x10,%eax # Do upper
- call hex16 # 16
- popl %eax # Restore
-hex16: call hex16.1 # Do upper 8
-hex16.1: xchgb %ah,%al # Save/restore
-hex8: pushl %eax # Save
- shrb $0x4,%al # Do upper
- call hex8.1 # 4
- popl %eax # Restore
-hex8.1: andb $0xf,%al # Get lower 4
- cmpb $0xa,%al # Convert
- sbbb $0x69,%al # to hex
- das # digit
- orb $0x20,%al # To lower case
- stosb # Save char
- ret # (Recursive)
-/*
- * Output zero-terminated string [ESI] to the console.
- */
-putstr.0: call putchr # Output char
-putstr: lodsb # Load char
- testb %al,%al # End of string?
- jnz putstr.0 # No
- ret # To caller
-#ifdef BTX_SERIAL
- .set SIO_PRT,SIOPRT # Base port
- .set SIO_FMT,SIOFMT # 8N1
- .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD
-
-/*
- * int sio_init(void)
- */
-sio_init: movw $SIO_PRT+0x3,%dx # Data format reg
- movb $SIO_FMT|0x80,%al # Set format
- outb %al,(%dx) # and DLAB
- pushl %edx # Save
- subb $0x3,%dl # Divisor latch reg
- movw $SIO_DIV,%ax # Set
- outw %ax,(%dx) # BPS
- popl %edx # Restore
- movb $SIO_FMT,%al # Clear
- outb %al,(%dx) # DLAB
- incl %edx # Modem control reg
- movb $0x3,%al # Set RTS,
- outb %al,(%dx) # DTR
- incl %edx # Line status reg
- call sio_getc.1 # Get character
-
-/*
- * int sio_flush(void)
- */
-sio_flush: xorl %eax,%eax # Return value
- xorl %ecx,%ecx # Timeout
- movb $0x80,%ch # counter
-sio_flush.1: call sio_ischar # Check for character
- jz sio_flush.2 # Till none
- loop sio_flush.1 # or counter is zero
- movb $1, %al # Exhausted all tries
-sio_flush.2: ret # To caller
-
-/*
- * void sio_putc(int c)
- */
-sio_putc: movw $SIO_PRT+0x5,%dx # Line status reg
- xor %ecx,%ecx # Timeout
- movb $0x40,%ch # counter
-sio_putc.1: inb (%dx),%al # Transmitter
- testb $0x20,%al # buffer empty?
- loopz sio_putc.1 # No
- jz sio_putc.2 # If timeout
- movb 0x4(%esp,1),%al # Get character
- subb $0x5,%dl # Transmitter hold reg
- outb %al,(%dx) # Write character
-sio_putc.2: ret $0x4 # To caller
-
-/*
- * int sio_getc(void)
- */
-sio_getc: call sio_ischar # Character available?
- jz sio_getc # No
-sio_getc.1: subb $0x5,%dl # Receiver buffer reg
- inb (%dx),%al # Read character
- ret # To caller
-
-/*
- * int sio_ischar(void)
- */
-sio_ischar: movw $SIO_PRT+0x5,%dx # Line status register
- xorl %eax,%eax # Zero
- inb (%dx),%al # Received data
- andb $0x1,%al # ready?
- ret # To caller
-
-/*
- * Output character AL to the serial console.
- */
-putchr: pusha # Save
- cmpb $10, %al # is it a newline?
- jne putchr.1 # no?, then leave
- push $13 # output a carriage
- call sio_putc # return first
- movb $10, %al # restore %al
-putchr.1: pushl %eax # Push the character
- # onto the stack
- call sio_putc # Output the character
- popa # Restore
- ret # To caller
-#else
-/*
- * Output character AL to the console.
- */
-putchr: pusha # Save
- xorl %ecx,%ecx # Zero for loops
- movb $SCR_MAT,%ah # Mode/attribute
- movl $BDA_POS,%ebx # BDA pointer
- movw (%ebx),%dx # Cursor position
- movl $0xa0000,%edi
-putchr.1: cmpb $0xa,%al # New line?
- je putchr.2 # Yes
- movw %dx,%cx
- movb %al,(%edi,%ecx,1) # Write char
- addl $0x2000,%ecx
- movb %ah,(%edi,%ecx,1) # Write attr
- addw $0x02,%dx
- jmp putchr.3
-putchr.2: movw %dx,%ax
- movb $SCR_COL*2,%dl
- div %dl
- incb %al
- mul %dl
- movw %ax,%dx
-putchr.3: cmpw $SCR_ROW*SCR_COL*2,%dx
- jb putchr.4 # No
- leal 2*SCR_COL(%edi),%esi # New top line
- movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move
- rep # Scroll
- movsl # screen
- movb $0x20,%al # Space
- xorb %ah,%ah
- movb $SCR_COL,%cl # Columns to clear
- rep # Clear
- stosw # line
- movw $(SCR_ROW-1)*SCR_COL*2,%dx
-putchr.4: movw %dx,(%ebx) # Update position
- popa # Restore
- ret # To caller
-#endif
-
- .code16
-/*
- * Real Mode Hardware interrupt jump table.
- */
-intr20: push $0x8 # Int 0x20: IRQ0
- jmp int_hwr # V86 int 0x8
- push $0x9 # Int 0x21: IRQ1
- jmp int_hwr # V86 int 0x9
- push $0xa # Int 0x22: IRQ2
- jmp int_hwr # V86 int 0xa
- push $0xb # Int 0x23: IRQ3
- jmp int_hwr # V86 int 0xb
- push $0xc # Int 0x24: IRQ4
- jmp int_hwr # V86 int 0xc
- push $0xd # Int 0x25: IRQ5
- jmp int_hwr # V86 int 0xd
- push $0xe # Int 0x26: IRQ6
- jmp int_hwr # V86 int 0xe
- push $0xf # Int 0x27: IRQ7
- jmp int_hwr # V86 int 0xf
- push $0x10 # Int 0x28: IRQ8
- jmp int_hwr # V86 int 0x10
- push $0x11 # Int 0x29: IRQ9
- jmp int_hwr # V86 int 0x11
- push $0x12 # Int 0x2a: IRQ10
- jmp int_hwr # V86 int 0x12
- push $0x13 # Int 0x2b: IRQ11
- jmp int_hwr # V86 int 0x13
- push $0x14 # Int 0x2c: IRQ12
- jmp int_hwr # V86 int 0x14
- push $0x15 # Int 0x2d: IRQ13
- jmp int_hwr # V86 int 0x15
- push $0x16 # Int 0x2e: IRQ14
- jmp int_hwr # V86 int 0x16
- push $0x17 # Int 0x2f: IRQ15
- jmp int_hwr # V86 int 0x17
-/*
- * Reflect hardware interrupts in real mode.
- */
-int_hwr: push %ax # Save
- push %ds # Save
- push %bp # Save
- mov %sp,%bp # Address stack frame
- xchg %bx,6(%bp) # Swap BX, int no
- xor %ax,%ax # Set %ds:%bx to
- shl $2,%bx # point to
- mov %ax,%ds # IDT entry
- mov (%bx),%ax # Load IP
- mov 2(%bx),%bx # Load CS
- xchg %ax,4(%bp) # Swap saved %ax,%bx with
- xchg %bx,6(%bp) # CS:IP of handler
- pop %bp # Restore
- pop %ds # Restore
- lret # Jump to handler
-
- .p2align 4
-/*
- * Global descriptor table.
- */
-gdt: .word 0x0,0x0,0x0,0x0 # Null entry
- .word 0xffff,0x0,0x9a00,0xcf # SEL_SCODE
- .word 0xffff,0x0,0x9200,0xcf # SEL_SDATA
- .word 0xffff,0x0,0x9a00,0x0 # SEL_RCODE
- .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA
- .word 0xffff,MEM_USR,0xfa00,0xcf# SEL_UCODE
- .word 0xffff,MEM_USR,0xf200,0xcf# SEL_UDATA
-tss_desc: .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS
-gdt.1:
-/*
- * Pseudo-descriptors.
- */
-gdtdesc: .word gdt.1-gdt-1,gdt,0x0 # GDT
-idtdesc: .word _IDTLM,MEM_IDT,0x0 # IDT
-ivtdesc: .word 0x400-0x0-1,0x0,0x0 # IVT
-/*
- * IDT construction control string.
- */
-idtctl: .byte 0x10, 0x8e # Int 0x0-0xf
- .word 0x7dfb,intx00 # (exceptions)
- .byte 0x10, 0x8e # Int 0x10
- .word 0x1, intx10 # (exception)
- .byte 0x10, 0x8e # Int 0x20-0x2f
- .word 0xffff,intx20 # (hardware)
- .byte 0x1, 0xee # int 0x30
- .word 0x1, intx30 # (system call)
- .byte 0x2, 0xee # Int 0x31-0x32
- .word 0x1, intx31 # (V86, null)
- .byte 0x0 # End of string
-/*
- * Dump format string.
- */
-dmpfmt: .byte '\n' # "\n"
- .ascii "int" # "int="
- .byte 0x80|DMP_X32, 0x40 # "00000000 "
- .ascii "err" # "err="
- .byte 0x80|DMP_X32, 0x44 # "00000000 "
- .ascii "efl" # "efl="
- .byte 0x80|DMP_X32, 0x50 # "00000000 "
- .ascii "eip" # "eip="
- .byte 0x80|DMP_X32|DMP_EOL,0x48 # "00000000\n"
- .ascii "eax" # "eax="
- .byte 0x80|DMP_X32, 0x34 # "00000000 "
- .ascii "ebx" # "ebx="
- .byte 0x80|DMP_X32, 0x28 # "00000000 "
- .ascii "ecx" # "ecx="
- .byte 0x80|DMP_X32, 0x30 # "00000000 "
- .ascii "edx" # "edx="
- .byte 0x80|DMP_X32|DMP_EOL,0x2c # "00000000\n"
- .ascii "esi" # "esi="
- .byte 0x80|DMP_X32, 0x1c # "00000000 "
- .ascii "edi" # "edi="
- .byte 0x80|DMP_X32, 0x18 # "00000000 "
- .ascii "ebp" # "ebp="
- .byte 0x80|DMP_X32, 0x20 # "00000000 "
- .ascii "esp" # "esp="
- .byte 0x80|DMP_X32|DMP_EOL,0x0 # "00000000\n"
- .ascii "cs" # "cs="
- .byte 0x80|DMP_X16, 0x4c # "0000 "
- .ascii "ds" # "ds="
- .byte 0x80|DMP_X16, 0xc # "0000 "
- .ascii "es" # "es="
- .byte 0x80|DMP_X16, 0x8 # "0000 "
- .ascii " " # " "
- .ascii "fs" # "fs="
- .byte 0x80|DMP_X16, 0x10 # "0000 "
- .ascii "gs" # "gs="
- .byte 0x80|DMP_X16, 0x14 # "0000 "
- .ascii "ss" # "ss="
- .byte 0x80|DMP_X16|DMP_EOL,0x4 # "0000\n"
- .ascii "cs:eip" # "cs:eip="
- .byte 0x80|DMP_MEM|DMP_EOL,0x48 # "00 00 ... 00 00\n"
- .ascii "ss:esp" # "ss:esp="
- .byte 0x80|DMP_MEM|DMP_EOL,0x0 # "00 00 ... 00 00\n"
- .asciz "BTX halted\n" # End
-/*
- * Bad VM86 call panic
- */
-badvm86: .asciz "Invalid VM86 Request\n"
-
-/*
- * End of BTX memory.
- */
- .p2align 4
-break:
diff --git a/sys/boot/pc98/btx/btxldr/Makefile b/sys/boot/pc98/btx/btxldr/Makefile
deleted file mode 100644
index 47e83a083056..000000000000
--- a/sys/boot/pc98/btx/btxldr/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# $FreeBSD$
-
-PROG= btxldr
-INTERNALPROG=
-MAN=
-SRCS= btxldr.S
-
-CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS}
-CFLAGS+=-I${.CURDIR}/../../../i386/common
-
-.if defined(BTXLDR_VERBOSE)
-CFLAGS+=-DBTXLDR_VERBOSE
-.endif
-
-ORG=${LOADER_ADDRESS}
-LDFLAGS=${LDFLAGS_BIN}
-
-.include <bsd.prog.mk>
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.btxldr.S= ${CLANG_NO_IAS}
diff --git a/sys/boot/pc98/btx/btxldr/btxldr.S b/sys/boot/pc98/btx/btxldr/btxldr.S
deleted file mode 100644
index 9a6483f72c3d..000000000000
--- a/sys/boot/pc98/btx/btxldr/btxldr.S
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright (c) 1998 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- *
- * $FreeBSD$
- */
-
-#include <bootargs.h>
-
-/*
- * Prototype BTX loader program, written in a couple of hours. The
- * real thing should probably be more flexible, and in C.
- */
-
-/*
- * Memory locations.
- */
- .set MEM_STUB,0x600 # Real mode stub
- .set MEM_ESP,0x1000 # New stack pointer
- .set MEM_TBL,0x5000 # BTX page tables
- .set MEM_ENTRY,0x9010 # BTX entry point
- .set MEM_DATA,start+0x1000 # Data segment
-/*
- * Segment selectors.
- */
- .set SEL_SCODE,0x8 # 4GB code
- .set SEL_SDATA,0x10 # 4GB data
- .set SEL_RCODE,0x18 # 64K code
- .set SEL_RDATA,0x20 # 64K data
-/*
- * Paging constants.
- */
- .set PAG_SIZ,0x1000 # Page size
- .set PAG_ENT,0x4 # Page entry size
-/*
- * Screen constants.
- */
- .set SCR_MAT,0xe1 # Mode/attribute
- .set SCR_COL,0x50 # Columns per row
- .set SCR_ROW,0x19 # Rows per screen
-/*
- * BIOS Data Area locations.
- */
- .set BDA_MEM,0xa1501 # Free memory
- .set BDA_POS,0xa153e # Cursor position
-/*
- * Required by aout gas inadequacy.
- */
- .set SIZ_STUB,0x1a # Size of stub
-/*
- * We expect to be loaded by boot2 at the origin defined in ./Makefile.
- */
- .globl start
-/*
- * BTX program loader for ELF clients.
- */
-start: cld # String ops inc
- cli
-gdcwait.1: inb $0x60,%al
- testb $0x04,%al
- jz gdcwait.1
- movb $0xe0,%al
- outb %al,$0x62
- nop
-gdcwait.2: inb $0x60,%al
- testb $0x01,%al
- jz gdcwait.2
- inb $0x62,%al
- movb %al,%dl
- inb $0x62,%al
- movb %al,%dh
- inb $0x62,%al
- inb $0x62,%al
- inb $0x62,%al
- shlw $1,%dx
- movl $BDA_POS,%ebx
- movw %dx,(%ebx)
- movl $m_logo,%esi # Identify
- call putstr # ourselves
- movzwl BDA_MEM,%eax # Get base memory
- andl $0x7,%eax
- incl %eax
- shll $0x11,%eax # in bytes
- movl %eax,%ebp # Base of user stack
-#ifdef BTXLDR_VERBOSE
- movl $m_mem,%esi # Display
- call hexout # amount of
- call putstr # base memory
-#endif
- lgdt gdtdesc # Load new GDT
-/*
- * Relocate caller's arguments.
- */
-#ifdef BTXLDR_VERBOSE
- movl $m_esp,%esi # Display
- movl %esp,%eax # caller
- call hexout # stack
- call putstr # pointer
- movl $m_args,%esi # Format string
- leal 0x4(%esp),%ebx # First argument
- movl $0x6,%ecx # Count
-start.1: movl (%ebx),%eax # Get argument and
- addl $0x4,%ebx # bump pointer
- call hexout # Display it
- loop start.1 # Till done
- call putstr # End message
-#endif
- movl BA_BOOTINFO+4(%esp),%esi # Source: bootinfo
- cmpl $0x0, %esi # If the bootinfo pointer
- je start_null_bi # is null, don't copy it
- movl BI_SIZE(%esi),%ecx # Allocate space
- subl %ecx,%ebp # for bootinfo
- movl %ebp,%edi # Destination
- rep # Copy
- movsb # it
- movl %ebp,BA_BOOTINFO+4(%esp) # Update pointer
- movl %edi,%ebp # Restore base pointer
-#ifdef BTXLDR_VERBOSE
- movl $m_rel_bi,%esi # Display
- movl %ebp,%eax # bootinfo
- call hexout # relocation
- call putstr # message
-#endif
-start_null_bi: movl $BOOTARGS_SIZE,%ecx # Fixed size of arguments
- testl $KARGS_FLAGS_EXTARG, BA_BOOTFLAGS+4(%esp) # Check for extra data
- jz start_fixed # Skip if the flag is not set
- addl BOOTARGS_SIZE+4(%esp),%ecx # Add size of variable args
-start_fixed: subl $ARGOFF,%ebp # Place args at fixed offset
- leal 0x4(%esp),%esi # Source
- movl %ebp,%edi # Destination
- rep # Copy
- movsb # them
-#ifdef BTXLDR_VERBOSE
- movl $m_rel_args,%esi # Display
- movl %ebp,%eax # argument
- call hexout # relocation
- call putstr # message
-#endif
-/*
- * Set up BTX kernel.
- */
- movl $MEM_ESP,%esp # Set up new stack
- movl $MEM_DATA,%ebx # Data segment
- movl $m_vers,%esi # Display BTX
- call putstr # version message
- movb 0x5(%ebx),%al # Get major version
- addb $'0',%al # Display
- call putchr # it
- movb $'.',%al # And a
- call putchr # dot
- movb 0x6(%ebx),%al # Get minor
- xorb %ah,%ah # version
- movb $0xa,%dl # Divide
- divb %dl,%al # by 10
- addb $'0',%al # Display
- call putchr # tens
- movb %ah,%al # Get units
- addb $'0',%al # Display
- call putchr # units
- call putstr # End message
- movl %ebx,%esi # BTX image
- movzwl 0x8(%ebx),%edi # Compute
- orl $PAG_SIZ/PAG_ENT-1,%edi # the
- incl %edi # BTX
- shll $0x2,%edi # load
- addl $MEM_TBL,%edi # address
- pushl %edi # Save load address
- movzwl 0xa(%ebx),%ecx # Image size
-#ifdef BTXLDR_VERBOSE
- pushl %ecx # Save image size
-#endif
- rep # Relocate
- movsb # BTX
- movl %esi,%ebx # Keep place
-#ifdef BTXLDR_VERBOSE
- movl $m_rel_btx,%esi # Restore
- popl %eax # parameters
- call hexout # and
-#endif
- popl %ebp # display
-#ifdef BTXLDR_VERBOSE
- movl %ebp,%eax # the
- call hexout # relocation
- call putstr # message
-#endif
- addl $PAG_SIZ,%ebp # Display
-#ifdef BTXLDR_VERBOSE
- movl $m_base,%esi # the
- movl %ebp,%eax # user
- call hexout # base
- call putstr # address
-#endif
-/*
- * Set up ELF-format client program.
- */
- cmpl $0x464c457f,(%ebx) # ELF magic number?
- je start.3 # Yes
- movl $e_fmt,%esi # Display error
- call putstr # message
-start.2: jmp start.2 # Hang
-start.3:
-#ifdef BTXLDR_VERBOSE
- movl $m_elf,%esi # Display ELF
- call putstr # message
- movl $m_segs,%esi # Format string
-#endif
- movl $0x2,%edi # Segment count
- movl 0x1c(%ebx),%edx # Get e_phoff
- addl %ebx,%edx # To pointer
- movzwl 0x2c(%ebx),%ecx # Get e_phnum
-start.4: cmpl $0x1,(%edx) # Is p_type PT_LOAD?
- jne start.6 # No
-#ifdef BTXLDR_VERBOSE
- movl 0x4(%edx),%eax # Display
- call hexout # p_offset
- movl 0x8(%edx),%eax # Display
- call hexout # p_vaddr
- movl 0x10(%edx),%eax # Display
- call hexout # p_filesz
- movl 0x14(%edx),%eax # Display
- call hexout # p_memsz
- call putstr # End message
-#endif
- pushl %esi # Save
- pushl %edi # working
- pushl %ecx # registers
- movl 0x4(%edx),%esi # Get p_offset
- addl %ebx,%esi # as pointer
- movl 0x8(%edx),%edi # Get p_vaddr
- addl %ebp,%edi # as pointer
- movl 0x10(%edx),%ecx # Get p_filesz
- rep # Set up
- movsb # segment
- movl 0x14(%edx),%ecx # Any bytes
- subl 0x10(%edx),%ecx # to zero?
- jz start.5 # No
- xorb %al,%al # Then
- rep # zero
- stosb # them
-start.5: popl %ecx # Restore
- popl %edi # working
- popl %esi # registers
- decl %edi # Segments to do
- je start.7 # If none
-start.6: addl $0x20,%edx # To next entry
- loop start.4 # Till done
-start.7:
-#ifdef BTXLDR_VERBOSE
- movl $m_done,%esi # Display done
- call putstr # message
-#endif
- movl $start.8,%esi # Real mode stub
- movl $MEM_STUB,%edi # Destination
- movl $start.9-start.8,%ecx # Size
- rep # Relocate
- movsb # it
- ljmp $SEL_RCODE,$MEM_STUB # To 16-bit code
- .code16
-start.8: xorw %ax,%ax # Data
- movb $SEL_RDATA,%al # selector
- movw %ax,%ss # Reload SS
- movw %ax,%ds # Reset
- movw %ax,%es # other
- movw %ax,%fs # segment
- movw %ax,%gs # limits
- movl %cr0,%eax # Switch to
- decw %ax # real
- movl %eax,%cr0 # mode
- ljmp $0,$MEM_ENTRY # Jump to BTX entry point
-start.9:
- .code32
-/*
- * Output message [ESI] followed by EAX in hex.
- */
-hexout: pushl %eax # Save
- call putstr # Display message
- popl %eax # Restore
- pushl %esi # Save
- pushl %edi # caller's
- movl $buf,%edi # Buffer
- pushl %edi # Save
- call hex32 # To hex
- xorb %al,%al # Terminate
- stosb # string
- popl %esi # Restore
-hexout.1: lodsb # Get a char
- cmpb $'0',%al # Leading zero?
- je hexout.1 # Yes
- testb %al,%al # End of string?
- jne hexout.2 # No
- decl %esi # Undo
-hexout.2: decl %esi # Adjust for inc
- call putstr # Display hex
- popl %edi # Restore
- popl %esi # caller's
- ret # To caller
-/*
- * Output zero-terminated string [ESI] to the console.
- */
-putstr.0: call putchr # Output char
-putstr: lodsb # Load char
- testb %al,%al # End of string?
- jne putstr.0 # No
- ret # To caller
-/*
- * Output character AL to the console.
- */
-putchr: pusha # Save
- xorl %ecx,%ecx # Zero for loops
- movb $SCR_MAT,%ah # Mode/attribute
- movl $BDA_POS,%ebx # BDA pointer
- movw (%ebx),%dx # Cursor position
- movl $0xa0000,%edi # Regen buffer (color)
-putchr.1: cmpb $0xa,%al # New line?
- je putchr.2 # Yes
- movw %dx,%cx
- movb %al,(%edi,%ecx,1) # Write char
- addl $0x2000,%ecx
- movb %ah,(%edi,%ecx,1) # Write attr
- addw $0x2,%dx
- jmp putchr.3
-putchr.2: movw %dx,%ax
- movb $SCR_COL*2,%dl
- div %dl
- incb %al
- mul %dl
- movw %ax,%dx
-putchr.3: cmpw $SCR_COL*SCR_ROW*2,%dx
- jb putchr.4 # No
- leal 2*SCR_COL(%edi),%esi # New top line
- movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move
- rep # Scroll
- movsl # screen
- movb $' ',%al # Space
- xorb %ah,%ah
- movb $SCR_COL,%cl # Columns to clear
- rep # Clear
- stosw # line
- movw $(SCR_ROW-1)*SCR_COL*2,%dx
-putchr.4: movw %dx,(%ebx) # Update position
- shrw $1,%dx
-gdcwait.3: inb $0x60,%al
- testb $0x04,%al
- jz gdcwait.3
- movb $0x49,%al
- outb %al,$0x62
- movb %dl,%al
- outb %al,$0x60
- movb %dh,%al
- outb %al,$0x60
- popa # Restore
- ret # To caller
-/*
- * Convert EAX, AX, or AL to hex, saving the result to [EDI].
- */
-hex32: pushl %eax # Save
- shrl $0x10,%eax # Do upper
- call hex16 # 16
- popl %eax # Restore
-hex16: call hex16.1 # Do upper 8
-hex16.1: xchgb %ah,%al # Save/restore
-hex8: pushl %eax # Save
- shrb $0x4,%al # Do upper
- call hex8.1 # 4
- popl %eax # Restore
-hex8.1: andb $0xf,%al # Get lower 4
- cmpb $0xa,%al # Convert
- sbbb $0x69,%al # to hex
- das # digit
- orb $0x20,%al # To lower case
- stosb # Save char
- ret # (Recursive)
-
- .data
- .p2align 4
-/*
- * Global descriptor table.
- */
-gdt: .word 0x0,0x0,0x0,0x0 # Null entry
- .word 0xffff,0x0,0x9a00,0xcf # SEL_SCODE
- .word 0xffff,0x0,0x9200,0xcf # SEL_SDATA
- .word 0xffff,0x0,0x9a00,0x0 # SEL_RCODE
- .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA
-gdt.1:
-gdtdesc: .word gdt.1-gdt-1 # Limit
- .long gdt # Base
-/*
- * Messages.
- */
-m_logo: .asciz " \nBTX loader 1.00 "
-m_vers: .asciz "BTX version is \0\n"
-e_fmt: .asciz "Error: Client format not supported\n"
-#ifdef BTXLDR_VERBOSE
-m_mem: .asciz "Starting in protected mode (base mem=\0)\n"
-m_esp: .asciz "Arguments passed (esp=\0):\n"
-m_args: .asciz"<howto="
- .asciz" bootdev="
- .asciz" junk="
- .asciz" "
- .asciz" "
- .asciz" bootinfo=\0>\n"
-m_rel_bi: .asciz "Relocated bootinfo (size=48) to \0\n"
-m_rel_args: .asciz "Relocated arguments (size=18) to \0\n"
-m_rel_btx: .asciz "Relocated kernel (size=\0) to \0\n"
-m_base: .asciz "Client base address is \0\n"
-m_elf: .asciz "Client format is ELF\n"
-m_segs: .asciz "text segment: offset="
- .asciz " vaddr="
- .asciz " filesz="
- .asciz " memsz=\0\n"
- .asciz "data segment: offset="
- .asciz " vaddr="
- .asciz " filesz="
- .asciz " memsz=\0\n"
-m_done: .asciz "Loading complete\n"
-#endif
-/*
- * Uninitialized data area.
- */
-buf: # Scratch buffer
diff --git a/sys/boot/pc98/btx/lib/Makefile b/sys/boot/pc98/btx/lib/Makefile
deleted file mode 100644
index e5876bc1371d..000000000000
--- a/sys/boot/pc98/btx/lib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-PROG= crt0.o
-INTERNALPROG=
-MAN=
-SRCS= btxcsu.S btxsys.s btxv86.s
-CFLAGS+=-I${.CURDIR}/../../../i386/common
-LDFLAGS=-Wl,-r
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/btx/lib/btxcsu.S b/sys/boot/pc98/btx/lib/btxcsu.S
deleted file mode 100644
index c46f8097dbe3..000000000000
--- a/sys/boot/pc98/btx/lib/btxcsu.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 1998 Robert Nordier
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are freely
-# permitted provided that the above copyright notice and this
-# paragraph and the following disclaimer are duplicated in all
-# such forms.
-#
-# This software is provided "AS IS" and without any express or
-# implied warranties, including, without limitation, the implied
-# warranties of merchantability and fitness for a particular
-# purpose.
-#
-
-# $FreeBSD$
-
-#include <bootargs.h>
-
-#
-# BTX C startup code (ELF).
-#
-
-#
-# Globals.
-#
- .global _start
-#
-# Client entry point.
-#
-_start: cld
- pushl %eax
- movl $_edata,%edi
- movl $_end,%ecx
- subl %edi, %ecx
- xorb %al, %al
- rep
- stosb
- popl __base
- movl %esp,%eax # Set
- addl $ARGADJ,%eax # argument
- movl %eax,__args # pointer
- call main # Invoke client main()
- call exit # Invoke client exit()
-#
-# Data.
-#
- .comm __base,4 # Client base address
- .comm __args,4 # Client arguments
diff --git a/sys/boot/pc98/btx/lib/btxsys.s b/sys/boot/pc98/btx/lib/btxsys.s
deleted file mode 100644
index 9c77b4295e7c..000000000000
--- a/sys/boot/pc98/btx/lib/btxsys.s
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (c) 1998 Robert Nordier
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are freely
-# permitted provided that the above copyright notice and this
-# paragraph and the following disclaimer are duplicated in all
-# such forms.
-#
-# This software is provided "AS IS" and without any express or
-# implied warranties, including, without limitation, the implied
-# warranties of merchantability and fitness for a particular
-# purpose.
-#
-
-# $FreeBSD$
-
-#
-# BTX system calls.
-#
-
-#
-# Globals.
-#
- .global __exit
- .global __exec
-#
-# Constants.
-#
- .set INT_SYS,0x30 # Interrupt number
-#
-# System call: exit
-#
-__exit: xorl %eax,%eax # BTX system
- int $INT_SYS # call 0x0
-#
-# System call: exec
-#
-__exec: movl $0x1,%eax # BTX system
- int $INT_SYS # call 0x1
diff --git a/sys/boot/pc98/btx/lib/btxv86.h b/sys/boot/pc98/btx/lib/btxv86.h
deleted file mode 100644
index 27f6b3404248..000000000000
--- a/sys/boot/pc98/btx/lib/btxv86.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1998 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- */
-
-/*
- * $FreeBSD$
- */
-
-#ifndef _BTXV86_H_
-#define _BTXV86_H_
-
-#include <sys/types.h>
-#include <machine/psl.h>
-
-#define V86_ADDR 0x10000 /* Segment:offset address */
-#define V86_CALLF 0x20000 /* Emulate far call */
-#define V86_FLAGS 0x40000 /* Return flags */
-
-struct __v86 {
- uint32_t ctl; /* Control flags */
- uint32_t addr; /* Interrupt number or address */
- uint32_t es; /* V86 ES register */
- uint32_t ds; /* V86 DS register */
- uint32_t fs; /* V86 FS register */
- uint32_t gs; /* V86 GS register */
- uint32_t eax; /* V86 EAX register */
- uint32_t ecx; /* V86 ECX register */
- uint32_t edx; /* V86 EDX register */
- uint32_t ebx; /* V86 EBX register */
- uint32_t efl; /* V86 eflags register */
- uint32_t ebp; /* V86 EBP register */
- uint32_t esi; /* V86 ESI register */
- uint32_t edi; /* V86 EDI register */
-};
-
-extern struct __v86 __v86; /* V86 interface structure */
-void __v86int(void);
-
-#define v86 __v86
-#define v86int __v86int
-
-extern u_int32_t __base;
-extern u_int32_t __args;
-
-#define PTOV(pa) ((caddr_t)(pa) - __base)
-#define VTOP(va) ((vm_offset_t)(va) + __base)
-#define VTOPSEG(va) (u_int16_t)(VTOP((caddr_t)va) >> 4)
-#define VTOPOFF(va) (u_int16_t)(VTOP((caddr_t)va) & 0xf)
-
-#define V86_CY(x) ((x) & PSL_C)
-#define V86_ZR(x) ((x) & PSL_Z)
-
-void __exit(int) __attribute__((__noreturn__));
-void __exec(caddr_t, ...);
-
-#endif /* !_BTXV86_H_ */
diff --git a/sys/boot/pc98/btx/lib/btxv86.s b/sys/boot/pc98/btx/lib/btxv86.s
deleted file mode 100644
index 0d7d1116322d..000000000000
--- a/sys/boot/pc98/btx/lib/btxv86.s
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# Copyright (c) 1998 Robert Nordier
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are freely
-# permitted provided that the above copyright notice and this
-# paragraph and the following disclaimer are duplicated in all
-# such forms.
-#
-# This software is provided "AS IS" and without any express or
-# implied warranties, including, without limitation, the implied
-# warranties of merchantability and fitness for a particular
-# purpose.
-#
-
-# $FreeBSD$
-
-#
-# BTX V86 interface.
-#
-
-#
-# Globals.
-#
- .global __v86int
-#
-# Fields in V86 interface structure.
-#
- .set V86_CTL,0x0 # Control flags
- .set V86_ADDR,0x4 # Int number/address
- .set V86_ES,0x8 # V86 ES
- .set V86_DS,0xc # V86 DS
- .set V86_FS,0x10 # V86 FS
- .set V86_GS,0x14 # V86 GS
- .set V86_EAX,0x18 # V86 EAX
- .set V86_ECX,0x1c # V86 ECX
- .set V86_EDX,0x20 # V86 EDX
- .set V86_EBX,0x24 # V86 EBX
- .set V86_EFL,0x28 # V86 eflags
- .set V86_EBP,0x2c # V86 EBP
- .set V86_ESI,0x30 # V86 ESI
- .set V86_EDI,0x34 # V86 EDI
-#
-# Other constants.
-#
- .set INT_V86,0x31 # Interrupt number
- .set SIZ_V86,0x38 # Size of V86 structure
-#
-# V86 interface function.
-#
-__v86int: popl __v86ret # Save return address
- pushl $__v86 # Push pointer
- call __v86_swap # Load V86 registers
- int $INT_V86 # To BTX
- call __v86_swap # Load user registers
- addl $0x4,%esp # Discard pointer
- pushl __v86ret # Restore return address
- ret # To user
-#
-# Swap V86 and user registers.
-#
-__v86_swap: xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP
- xchgl %eax,V86_EAX(%ebp) # Swap EAX
- xchgl %ecx,V86_ECX(%ebp) # Swap ECX
- xchgl %edx,V86_EDX(%ebp) # Swap EDX
- xchgl %ebx,V86_EBX(%ebp) # Swap EBX
- pushl %eax # Save
- pushf # Put eflags
- popl %eax # in EAX
- xchgl %eax,V86_EFL(%ebp) # Swap
- pushl %eax # Put EAX
- popf # in eflags
- movl 0x8(%esp,1),%eax # Load EBP
- xchgl %eax,V86_EBP(%ebp) # Swap
- movl %eax,0x8(%esp,1) # Save EBP
- popl %eax # Restore
- xchgl %esi,V86_ESI(%ebp) # Swap ESI
- xchgl %edi,V86_EDI(%ebp) # Swap EDI
- xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP
- ret # To caller
-#
-# V86 interface structure.
-#
- .comm __v86,SIZ_V86
- .comm __v86ret,4
diff --git a/sys/boot/pc98/cdboot/Makefile b/sys/boot/pc98/cdboot/Makefile
deleted file mode 100644
index ba94111362c5..000000000000
--- a/sys/boot/pc98/cdboot/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-
-PROG= cdboot
-STRIP=
-BINMODE=${NOBINMODE}
-MAN=
-SRCS= ${PROG}.S
-
-CFLAGS+=-I${.CURDIR}/../../i386/common
-
-ORG= 0x0000
-
-LDFLAGS=${LDFLAGS_BIN}
-
-.include <bsd.prog.mk>
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.cdboot.S= ${CLANG_NO_IAS}
diff --git a/sys/boot/pc98/cdboot/cdboot.S b/sys/boot/pc98/cdboot/cdboot.S
deleted file mode 100644
index c97c02bea31b..000000000000
--- a/sys/boot/pc98/cdboot/cdboot.S
+++ /dev/null
@@ -1,805 +0,0 @@
-#
-# Copyright (c) 2006 TAKAHASHI Yoshihiro <nyan@FreeBSD.org>
-# Copyright (c) 2001 John Baldwin <jhb@FreeBSD.org>
-# 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
-#
-
-# $FreeBSD$
-
-#
-# Basically, we first create a set of boot arguments to pass to the loaded
-# binary. Then we attempt to load /boot/loader from the CD we were booted
-# off of.
-#
-
-#include <bootargs.h>
-
-#
-# Memory locations.
-#
- .set STACK_OFF,0x6000 # Stack offset
- .set LOAD_SEG,0x0700 # Load segment
- .set LOAD_SIZE,2048 # Load size
- .set DAUA,0x0584 # DA/UA
-
- .set MEM_PAGE_SIZE,0x1000 # memory page size, 4k
- .set MEM_ARG,0x900 # Arguments at start
- .set MEM_ARG_BTX,0xa100 # Where we move them to so the
- # BTX client can see them
- .set MEM_ARG_SIZE,0x18 # Size of the arguments
- .set MEM_BTX_ADDRESS,0x9000 # where BTX lives
- .set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute
- .set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader
- .set MEM_BTX_CLIENT,0xa000 # where BTX clients live
-#
-# PC98 machine type from sys/pc98/pc98/pc98_machdep.h
-#
- .set MEM_SYS, 0xa100 # System common area segment
- .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type
- .set EPSON_ID, 0x0624 # EPSON machine id
-
- .set M_NEC_PC98, 0x0001
- .set M_EPSON_PC98, 0x0002
- .set M_NOT_H98, 0x0010
- .set M_H98, 0x0020
- .set M_NOTE, 0x0040
- .set M_NORMAL, 0x1000
- .set M_8M, 0x8000
-#
-# Signature Constants
-#
- .set SIG1_OFF,0x1fe # Signature offset
- .set SIG2_OFF,0x7fe # Signature offset
-#
-# a.out header fields
-#
- .set AOUT_TEXT,0x04 # text segment size
- .set AOUT_DATA,0x08 # data segment size
- .set AOUT_BSS,0x0c # zero'd BSS size
- .set AOUT_SYMBOLS,0x10 # symbol table
- .set AOUT_ENTRY,0x14 # entry point
- .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header
-#
-# Segment selectors.
-#
- .set SEL_SDATA,0x8 # Supervisor data
- .set SEL_RDATA,0x10 # Real mode data
- .set SEL_SCODE,0x18 # PM-32 code
- .set SEL_SCODE16,0x20 # PM-16 code
-#
-# BTX constants
-#
- .set INT_SYS,0x30 # BTX syscall interrupt
-#
-# Constants for reading from the CD.
-#
- .set ERROR_TIMEOUT,0x90 # BIOS timeout on read
- .set NUM_RETRIES,3 # Num times to retry
- .set SECTOR_SIZE,0x800 # size of a sector
- .set SECTOR_SHIFT,11 # number of place to shift
- .set BUFFER_LEN,0x100 # number of sectors in buffer
- .set MAX_READ,0xf800 # max we can read at a time
- .set MAX_READ_SEC,MAX_READ >> SECTOR_SHIFT
- .set MEM_READ_BUFFER,0x9000 # buffer to read from CD
- .set MEM_VOLDESC,MEM_READ_BUFFER # volume descriptor
- .set MEM_DIR,MEM_VOLDESC+SECTOR_SIZE # Lookup buffer
- .set VOLDESC_LBA,0x10 # LBA of vol descriptor
- .set VD_PRIMARY,1 # Primary VD
- .set VD_END,255 # VD Terminator
- .set VD_ROOTDIR,156 # Offset of Root Dir Record
- .set DIR_LEN,0 # Offset of Dir Record length
- .set DIR_EA_LEN,1 # Offset of EA length
- .set DIR_EXTENT,2 # Offset of 64-bit LBA
- .set DIR_SIZE,10 # Offset of 64-bit length
- .set DIR_NAMELEN,32 # Offset of 8-bit name len
- .set DIR_NAME,33 # Offset of dir name
-
-#
-# Program start.
-#
- .code16
- .globl start
-
-start: jmp main
-
- .org 4
- .ascii "IPL1 "
-
-main: cld
-
- /* Setup the stack */
- xor %ax,%ax
- mov %ax,%ss
- mov $STACK_OFF,%sp
-
- push %ecx
-
- /* Setup graphic screen */
- mov $0x42,%ah # 640x400
- mov $0xc0,%ch
- int $0x18
- mov $0x40,%ah # graph on
- int $0x18
-
- /* Setup text screen */
- mov $0x0a00,%ax # 80x25
- int $0x18
- mov $0x0c,%ah # text on
- int $0x18
- mov $0x13,%ah # cursor home
- xor %dx,%dx
- int $0x18
- mov $0x11,%ah # cursor on
- int $0x18
-
- /* Setup keyboard */
- mov $0x03,%ah
- int $0x18
-
- /* Transfer PC-9801 system common area */
- xor %ax,%ax
- mov %ax,%si
- mov %ax,%ds
- mov %ax,%di
- mov $MEM_SYS,%ax
- mov %ax,%es
- mov $0x0600,%cx
- rep
- movsb
-
- /* Transfer EPSON machine type */
- mov $0xfd00,%ax
- mov %ax,%ds
- mov (0x804),%eax
- and $0x00ffffff,%eax
- mov %eax,%es:(EPSON_ID)
-
- /* Set machine type to PC98_SYSTEM_PARAMETER */
- call machine_check
-
- /* Load cdboot */
- xor %ax,%ax
- mov %ax,%ds
- mov $0x06,%ah /* Read data */
- mov (DAUA),%al /* Read drive */
- pop %ecx /* cylinder */
- xor %dx,%dx /* head / sector */
- mov $LOAD_SEG,%bx /* Load address */
- mov %bx,%es
- xor %bp,%bp
- mov $LOAD_SIZE,%bx /* Load size */
- int $0x1b
- mov $msg_readerr,%si
- jc error
-
- /* Jump to cdboot */
- ljmp $LOAD_SEG,$cdboot
-
-#
-# Set machine type to PC98_SYSTEM_PARAMETER.
-#
-machine_check: xor %edx,%edx
- mov %dx,%ds
- mov $MEM_SYS,%ax
- mov %ax,%es
-
- /* Wait V-SYNC */
-vsync.1: inb $0x60,%al
- test $0x20,%al
- jnz vsync.1
-vsync.2: inb $0x60,%al
- test $0x20,%al
- jz vsync.2
-
- /* ANK 'A' font */
- xor %al,%al
- outb %al,$0xa1
- mov $0x41,%al
- outb %al,$0xa3
-
- /* Get 'A' font from CG window */
- push %ds
- mov $0xa400,%ax
- mov %ax,%ds
- xor %eax,%eax
- xor %bx,%bx
- mov $4,%cx
-font.1: add (%bx),%eax
- add $4,%bx
- loop font.1
- pop %ds
- cmp $0x6efc58fc,%eax
- jnz m_epson
-
-m_pc98: or $M_NEC_PC98,%edx
- mov $0x0458,%bx
- mov (%bx),%al
- test $0x80,%al
- jz m_not_h98
- or $M_H98,%edx
- jmp 1f
-m_epson: or $M_EPSON_PC98,%edx
-m_not_h98: or $M_NOT_H98,%edx
-
-1: inb $0x42,%al
- test $0x20,%al
- jz 1f
- or $M_8M,%edx
-
-1: mov $0x0400,%bx
- mov (%bx),%al
- test $0x80,%al
- jz 1f
- or $M_NOTE,%edx
-
-1: mov $PC98_MACHINE_TYPE,%bx
- mov %edx,%es:(%bx)
- ret
-
-#
-# Print out the error message at [SI], wait for a keypress, and then
-# reboot the machine.
-#
-error: call putstr
- mov $msg_keypress,%si
- call putstr
- xor %ax,%ax # Get keypress
- int $0x18
- xor %ax,%ax # CPU reset
- outb %al,$0xf0
-halt: hlt
- jmp halt # Spin
-
-#
-# Display a null-terminated string at [SI].
-#
-# Trashes: AX, BX, CX, DX, SI, DI
-#
-putstr: push %ds
- push %es
- mov %cs,%ax
- mov %ax,%ds
- mov $0xa000,%ax
- mov %ax,%es
- mov cursor,%di
- mov $0x00e1,%bx # Attribute
- mov $160,%cx
-putstr.0: lodsb
- testb %al,%al
- jz putstr.done
- cmp $0x0d,%al
- jz putstr.cr
- cmp $0x0a,%al
- jz putstr.lf
- mov %bl,%es:0x2000(%di)
- stosb
- inc %di
- jmp putstr.move
-putstr.cr: xor %dx,%dx
- mov %di,%ax
- div %cx
- sub %dx,%di
- jmp putstr.move
-putstr.lf: add %cx,%di
-putstr.move: mov %di,%dx
- mov $0x13,%ah # Move cursor
- int $0x18
- jmp putstr.0
-putstr.done: mov %di,cursor
- pop %es
- pop %ds
- ret
-
-#
-# Display a single char at [AL], but don't move a cursor.
-#
-putc: push %es
- push %di
- push %bx
- mov $0xa000,%bx
- mov %bx,%es
- mov cursor,%di
- mov $0xe1,%bl # Attribute
- mov %bl,%es:0x2000(%di)
- stosb
- pop %bx
- pop %di
- pop %es
- ret
-
-msg_readerr: .asciz "Read Error\r\n"
-msg_keypress: .asciz "\r\nPress any key to reboot\r\n"
-
-/* Boot signature */
-
- .org SIG1_OFF,0x90
-
- .word 0xaa55 # Magic number
-
-#
-# cdboot
-#
-cdboot: mov %cs,%ax
- mov %ax,%ds
- xor %ax,%ax
- mov %ax,%es
- mov %es:(DAUA),%al # Save BIOS boot device
- mov %al,drive
- mov %cx,cylinder # Save BIOS boot cylinder
-
- mov $msg_welcome,%si # %ds:(%si) -> welcome message
- call putstr # display the welcome message
-#
-# Setup the arguments that the loader is expecting from boot[12]
-#
- mov $msg_bootinfo,%si # %ds:(%si) -> boot args message
- call putstr # display the message
- mov $MEM_ARG,%bx # %ds:(%bx) -> boot args
- mov %bx,%di # %es:(%di) -> boot args
- xor %eax,%eax # zero %eax
- mov $(MEM_ARG_SIZE/4),%cx # Size of arguments in 32-bit
- # dwords
- rep # Clear the arguments
- stosl # to zero
- mov drive,%dl # Store BIOS boot device
- mov %dl,%es:0x4(%bx) # in kargs->bootdev
- or $KARGS_FLAGS_CD,%es:0x8(%bx) # kargs->bootflags |=
- # KARGS_FLAGS_CD
-#
-# Load Volume Descriptor
-#
- mov $VOLDESC_LBA,%eax # Set LBA of first VD
-load_vd: push %eax # Save %eax
- mov $1,%dh # One sector
- mov $MEM_VOLDESC,%ebx # Destination
- call read # Read it in
- cmpb $VD_PRIMARY,%es:(%bx) # Primary VD?
- je have_vd # Yes
- pop %eax # Prepare to
- inc %eax # try next
- cmpb $VD_END,%es:(%bx) # Last VD?
- jne load_vd # No, read next
- mov $msg_novd,%si # No VD
- jmp error # Halt
-have_vd: # Have Primary VD
-#
-# Try to look up the loader binary using the paths in the loader_paths
-# array.
-#
- mov $loader_paths,%si # Point to start of array
-lookup_path: push %si # Save file name pointer
- call lookup # Try to find file
- pop %di # Restore file name pointer
- jnc lookup_found # Found this file
- push %es
- mov %cs,%ax
- mov %ax,%es
- xor %al,%al # Look for next
- mov $0xffff,%cx # path name by
- repnz # scanning for
- scasb # nul char
- pop %es
- mov %di,%si # Point %si at next path
- mov (%si),%al # Get first char of next path
- or %al,%al # Is it double nul?
- jnz lookup_path # No, try it.
- mov $msg_failed,%si # Failed message
- jmp error # Halt
-lookup_found: # Found a loader file
-#
-# Load the binary into the buffer. Due to real mode addressing limitations
-# we have to read it in 64k chunks.
-#
- mov %es:DIR_SIZE(%bx),%eax # Read file length
- add $SECTOR_SIZE-1,%eax # Convert length to sectors
- shr $SECTOR_SHIFT,%eax
- cmp $BUFFER_LEN,%eax
- jbe load_sizeok
- mov $msg_load2big,%si # Error message
- jmp error
-load_sizeok: movzbw %al,%cx # Num sectors to read
- mov %es:DIR_EXTENT(%bx),%eax # Load extent
- xor %edx,%edx
- mov %es:DIR_EA_LEN(%bx),%dl
- add %edx,%eax # Skip extended
- mov $MEM_READ_BUFFER,%ebx # Read into the buffer
-load_loop: mov %cl,%dh
- cmp $MAX_READ_SEC,%cl # Truncate to max read size
- jbe load_notrunc
- mov $MAX_READ_SEC,%dh
-load_notrunc: sub %dh,%cl # Update count
- push %eax # Save
- call read # Read it in
- pop %eax # Restore
- add $MAX_READ_SEC,%eax # Update LBA
- add $MAX_READ,%ebx # Update dest addr
- jcxz load_done # Done?
- jmp load_loop # Keep going
-load_done:
-#
-# Turn on the A20 address line
-#
- xor %ax,%ax # Turn A20 on
- outb %al,$0xf2
- mov $0x02,%al
- outb %al,$0xf6
-#
-# Relocate the loader and BTX using a very lazy protected mode
-#
- mov $msg_relocate,%si # Display the
- call putstr # relocation message
- mov %es:(MEM_READ_BUFFER+AOUT_ENTRY),%edi # %edi is the destination
- mov $(MEM_READ_BUFFER+AOUT_HEADER),%esi # %esi is
- # the start of the text
- # segment
- mov %es:(MEM_READ_BUFFER+AOUT_TEXT),%ecx # %ecx = length of the text
- # segment
- push %edi # Save entry point for later
- lgdt gdtdesc # setup our own gdt
- cli # turn off interrupts
- mov %cr0,%eax # Turn on
- or $0x1,%al # protected
- mov %eax,%cr0 # mode
- ljmp $SEL_SCODE,$pm_start # long jump to clear the
- # instruction pre-fetch queue
- .code32
-pm_start: mov $SEL_SDATA,%ax # Initialize
- mov %ax,%ds # %ds and
- mov %ax,%es # %es to a flat selector
- rep # Relocate the
- movsb # text segment
- add $(MEM_PAGE_SIZE - 1),%edi # pad %edi out to a new page
- and $~(MEM_PAGE_SIZE - 1),%edi # for the data segment
- mov MEM_READ_BUFFER+AOUT_DATA,%ecx # size of the data segment
- rep # Relocate the
- movsb # data segment
- mov MEM_READ_BUFFER+AOUT_BSS,%ecx # size of the bss
- xor %eax,%eax # zero %eax
- add $3,%cl # round %ecx up to
- shr $2,%ecx # a multiple of 4
- rep # zero the
- stosl # bss
- mov MEM_READ_BUFFER+AOUT_ENTRY,%esi # %esi -> relocated loader
- add $MEM_BTX_OFFSET,%esi # %esi -> BTX in the loader
- mov $MEM_BTX_ADDRESS,%edi # %edi -> where BTX needs to go
- movzwl 0xa(%esi),%ecx # %ecx -> length of BTX
- rep # Relocate
- movsb # BTX
- ljmp $SEL_SCODE16,$pm_16 # Jump to 16-bit PM
- .code16
-pm_16: mov $SEL_RDATA,%ax # Initialize
- mov %ax,%ds # %ds and
- mov %ax,%es # %es to a real mode selector
- mov %cr0,%eax # Turn off
- and $~0x1,%al # protected
- mov %eax,%cr0 # mode
- ljmp $LOAD_SEG,$pm_end # Long jump to clear the
- # instruction pre-fetch queue
-pm_end: sti # Turn interrupts back on now
-#
-# Copy the BTX client to MEM_BTX_CLIENT
-#
- mov %cs,%ax
- mov %ax,%ds
- xor %ax,%ax
- mov %ax,%es
- mov $MEM_BTX_CLIENT,%di # Prepare to relocate
- mov $btx_client,%si # the simple btx client
- mov $(btx_client_end-btx_client),%cx # length of btx client
- rep # Relocate the
- movsb # simple BTX client
-#
-# Copy the boot[12] args to where the BTX client can see them
-#
- xor %ax,%ax
- mov %ax,%ds
- mov $MEM_ARG,%si # where the args are at now
- mov $MEM_ARG_BTX,%di # where the args are moving to
- mov $(MEM_ARG_SIZE/4),%cx # size of the arguments in longs
- rep # Relocate
- movsl # the words
-#
-# Save the entry point so the client can get to it later on
-#
- pop %eax # Restore saved entry point
- stosl # and add it to the end of
- # the arguments
-#
-# Now we just start up BTX and let it do the rest
-#
- mov $msg_jump,%si # Display the
- call putstr # jump message
- ljmp $0,$MEM_BTX_ENTRY # Jump to the BTX entry point
-
-#
-# Lookup the file in the path at [SI] from the root directory.
-#
-# Trashes: All but BX
-# Returns: CF = 0 (success), BX = pointer to record
-# CF = 1 (not found)
-#
-lookup: mov $VD_ROOTDIR+MEM_VOLDESC,%bx # Root directory record
- push %bx
- push %si
- mov $msg_lookup,%si # Display lookup message
- call putstr
- pop %si
- push %si
- call putstr
- mov $msg_lookup2,%si
- call putstr
- pop %si
- pop %bx
-lookup_dir: lodsb # Get first char of path
- cmp $0,%al # Are we done?
- je lookup_done # Yes
- cmp $'/',%al # Skip path separator.
- je lookup_dir
- dec %si # Undo lodsb side effect
- call find_file # Lookup first path item
- jnc lookup_dir # Try next component
- mov $msg_lookupfail,%si # Not found message
- push %bx
- call putstr
- pop %bx
- stc # Set carry
- ret
-lookup_done: mov $msg_lookupok,%si # Success message
- push %bx
- call putstr
- pop %bx
- clc # Clear carry
- ret
-
-#
-# Lookup file at [SI] in directory whose record is at [BX].
-#
-# Trashes: All but returns
-# Returns: CF = 0 (success), BX = pointer to record, SI = next path item
-# CF = 1 (not found), SI = preserved
-#
-find_file: mov %es:DIR_EXTENT(%bx),%eax # Load extent
- xor %edx,%edx
- mov %es:DIR_EA_LEN(%bx),%dl
- add %edx,%eax # Skip extended attributes
- mov %eax,rec_lba # Save LBA
- mov %es:DIR_SIZE(%bx),%eax # Save size
- mov %eax,rec_size
- xor %cl,%cl # Zero length
- push %si # Save
-ff.namelen: inc %cl # Update length
- lodsb # Read char
- cmp $0,%al # Nul?
- je ff.namedone # Yes
- cmp $'/',%al # Path separator?
- jnz ff.namelen # No, keep going
-ff.namedone: dec %cl # Adjust length and save
- mov %cl,name_len
- pop %si # Restore
-ff.load: mov rec_lba,%eax # Load LBA
- mov $MEM_DIR,%ebx # Address buffer
- mov $1,%dh # One sector
- call read # Read directory block
- incl rec_lba # Update LBA to next block
-ff.scan: mov %ebx,%edx # Check for EOF
- sub $MEM_DIR,%edx
- cmp %edx,rec_size
- ja ff.scan.1
- stc # EOF reached
- ret
-ff.scan.1: cmpb $0,%es:DIR_LEN(%bx) # Last record in block?
- je ff.nextblock
- push %si # Save
- movzbw %es:DIR_NAMELEN(%bx),%si # Find end of string
-ff.checkver: cmpb $'0',%es:DIR_NAME-1(%bx,%si) # Less than '0'?
- jb ff.checkver.1
- cmpb $'9',%es:DIR_NAME-1(%bx,%si) # Greater than '9'?
- ja ff.checkver.1
- dec %si # Next char
- jnz ff.checkver
- jmp ff.checklen # All numbers in name, so
- # no version
-ff.checkver.1: movzbw %es:DIR_NAMELEN(%bx),%cx
- cmp %cx,%si # Did we find any digits?
- je ff.checkdot # No
- cmpb $';',%es:DIR_NAME-1(%bx,%si) # Check for semicolon
- jne ff.checkver.2
- dec %si # Skip semicolon
- mov %si,%cx
- mov %cl,%es:DIR_NAMELEN(%bx) # Adjust length
- jmp ff.checkdot
-ff.checkver.2: mov %cx,%si # Restore %si to end of string
-ff.checkdot: cmpb $'.',%es:DIR_NAME-1(%bx,%si) # Trailing dot?
- jne ff.checklen # No
- decb %es:DIR_NAMELEN(%bx) # Adjust length
-ff.checklen: pop %si # Restore
- movzbw name_len,%cx # Load length of name
- cmp %cl,%es:DIR_NAMELEN(%bx) # Does length match?
- je ff.checkname # Yes, check name
-ff.nextrec: add %es:DIR_LEN(%bx),%bl # Next record
- adc $0,%bh
- jmp ff.scan
-ff.nextblock: subl $SECTOR_SIZE,rec_size # Adjust size
- jnc ff.load # If subtract ok, keep going
- ret # End of file, so not found
-ff.checkname: lea DIR_NAME(%bx),%di # Address name in record
- push %si # Save
- repe cmpsb # Compare name
- je ff.match # We have a winner!
- pop %si # Restore
- jmp ff.nextrec # Keep looking.
-ff.match: add $2,%sp # Discard saved %si
- clc # Clear carry
- ret
-
-#
-# Load DH sectors starting at LBA EAX into [EBX].
-#
-# Trashes: EAX
-#
-read: push %es # Save
- push %bp
- push %dx
- push %cx
- push %ebx
- mov %bx,%bp # Set destination address
- and $0x000f,%bp
- shr $4,%ebx
- mov %bx,%es
- xor %bx,%bx # Set read bytes
- mov %dh,%bl
- shl $SECTOR_SHIFT,%bx # 2048 bytes/sec
- mov %ax,%cx # Set LBA
- shr $16,%eax
- mov %ax,%dx
-read.retry: mov $0x06,%ah # BIOS device read
- mov drive,%al
- and $0x7f,%al
- call twiddle # Entertain the user
- int $0x1b # Call BIOS
- jc read.fail # Worked?
- pop %ebx # Restore
- pop %cx
- pop %dx
- pop %bp
- pop %es
- ret # Return
-read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout?
- je read.retry # Yes, Retry.
-read.error: mov %ah,%al # Save error
- mov $hex_error,%di # Format it
- call hex8 # as hex
- mov $msg_badread,%si # Display Read error message
- jmp error
-
-#
-# Output the "twiddle"
-#
-twiddle: push %ax # Save
- push %bx # Save
- mov twiddle_index,%al # Load index
- mov $twiddle_chars,%bx # Address table
- inc %al # Next
- and $3,%al # char
- mov %al,twiddle_index # Save index for next call
- xlat # Get char
- call putc # Output it
- pop %bx # Restore
- pop %ax # Restore
- ret
-
-#
-# Convert AL to hex, saving the result to [EDI].
-#
-hex8: pushl %eax # Save
- shrb $0x4,%al # Do upper
- call hex8.1 # 4
- popl %eax # Restore
-hex8.1: andb $0xf,%al # Get lower 4
- cmpb $0xa,%al # Convert
- sbbb $0x69,%al # to hex
- das # digit
- orb $0x20,%al # To lower case
- mov %al,(%di) # Save char
- inc %di
- ret # (Recursive)
-
-#
-# BTX client to start btxldr
-#
- .code32
-btx_client: mov $(MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE-4), %esi
- # %ds:(%esi) -> end
- # of boot[12] args
- mov $(MEM_ARG_SIZE/4),%ecx # Number of words to push
- std # Go backwards
-push_arg: lodsl # Read argument
- push %eax # Push it onto the stack
- loop push_arg # Push all of the arguments
- cld # In case anyone depends on this
- pushl MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE # Entry point of
- # the loader
- push %eax # Emulate a near call
- mov $0x1,%eax # 'exec' system call
- int $INT_SYS # BTX system call
-btx_client_end:
- .code16
-
- .p2align 4
-#
-# Global descriptor table.
-#
-gdt: .word 0x0,0x0,0x0,0x0 # Null entry
- .word 0xffff,0x0000,0x9200,0x00cf # SEL_SDATA
- .word 0xffff,0x0000,0x9200,0x0000 # SEL_RDATA
- .word 0xffff,LOAD_SEG<<4,0x9a00,0x00cf # SEL_SCODE (32-bit)
- .word 0xffff,LOAD_SEG<<4,0x9a00,0x008f # SEL_SCODE16 (16-bit)
-gdt.1:
-#
-# Pseudo-descriptors.
-#
-gdtdesc: .word gdt.1-gdt-1 # Limit
- .long LOAD_SEG<<4 + gdt # Base
-
-#
-# BOOT device
-#
-drive: .byte 0
-cylinder: .word 0
-
-#
-# State for searching dir
-#
-rec_lba: .long 0x0 # LBA (adjusted for EA)
-rec_size: .long 0x0 # File size
-name_len: .byte 0x0 # Length of current name
-
-cursor: .word 0
-twiddle_index: .byte 0x0
-
-msg_welcome: .asciz "CD Loader 1.2\r\n\n"
-msg_bootinfo: .asciz "Building the boot loader arguments\r\n"
-msg_relocate: .asciz "Relocating the loader and the BTX\r\n"
-msg_jump: .asciz "Starting the BTX loader\r\n"
-msg_badread: .ascii "Read Error: 0x"
-hex_error: .asciz "00\r\n"
-msg_novd: .asciz "Could not find Primary Volume Descriptor\r\n"
-msg_lookup: .asciz "Looking up "
-msg_lookup2: .asciz "... "
-msg_lookupok: .asciz "Found\r\n"
-msg_lookupfail: .asciz "File not found\r\n"
-msg_load2big: .asciz "File too big\r\n"
-msg_failed: .asciz "Boot failed\r\n"
-twiddle_chars: .ascii "|/-\\"
-loader_paths: .asciz "/BOOT.PC98/LOADER"
- .asciz "/boot.pc98/loader"
- .asciz "/BOOT/LOADER"
- .asciz "/boot/loader"
- .byte 0
-
-/* Boot signature */
-
- .org SIG2_OFF,0x90
-
- .word 0xaa55 # Magic number
diff --git a/sys/boot/pc98/kgzldr/Makefile b/sys/boot/pc98/kgzldr/Makefile
deleted file mode 100644
index 0070d70204a5..000000000000
--- a/sys/boot/pc98/kgzldr/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-PROG= kgzldr.o
-STRIP=
-BINMODE=${LIBMODE}
-BINDIR= ${LIBDIR}
-MAN=
-
-SRCS= start.s boot.c inflate.c lib.c crt.s sio.s
-CFLAGS= -Os
-CFLAGS+=-DKZIP
-NO_SHARED=
-LDFLAGS=-Wl,-r
-.PATH: ${.CURDIR}/../../../kern
-.PATH: ${.CURDIR}/../../i386/kgzldr
-
-BOOT_COMCONSOLE_PORT?= 0x238
-AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/kgzldr/crt.s b/sys/boot/pc98/kgzldr/crt.s
deleted file mode 100644
index 35c1fc2dfe73..000000000000
--- a/sys/boot/pc98/kgzldr/crt.s
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# Copyright (c) 1999 Global Technology Associates, Inc.
-# 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 AND CONTRIBUTORS``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 OR CONTRIBUTORS
-# 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: btx.s 1.10 1999/02/25 16:27:41 rnordier
-# $FreeBSD$
-#
-
-# Screen defaults and assumptions.
-
- .set SCR_MAT,0xe1 # Mode/attribute
- .set SCR_COL,0x50 # Columns per row
- .set SCR_ROW,0x19 # Rows per screen
-
-# BIOS Data Area locations.
-
- .set BDA_POS,0x53e # Cursor position
-
- .globl crt_putchr
-
-# void crt_putchr(int c)
-
-crt_putchr: movb 0x4(%esp,1),%al # Get character
- pusha # Save
- xorl %ecx,%ecx # Zero for loops
- movb $SCR_MAT,%ah # Mode/attribute
- movl $BDA_POS,%ebx # BDA pointer
- movw (%ebx),%dx # Cursor position
- movl $0xa0000,%edi
-crt_putchr.1: cmpb $0xa,%al # New line?
- je crt_putchr.2 # Yes
- movw %dx,%cx
- movb %al,(%edi,%ecx,1) # Write char
- addl $0x2000,%ecx
- movb %ah,(%edi,%ecx,1) # Write attr
- addw $0x02,%dx
- jmp crt_putchr.3
-crt_putchr.2: movw %dx,%ax
- movb $SCR_COL*2,%dl
- div %dl
- incb %al
- mul %dl
- movw %ax,%dx
-crt_putchr.3: cmpw $SCR_ROW*SCR_COL*2,%dx
- jb crt_putchr.4 # No
- leal 2*SCR_COL(%edi),%esi # New top line
- movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move
- rep # Scroll
- movsl # screen
- movb $' ',%al # Space
- xorb %ah,%ah
- movb $SCR_COL,%cl # Columns to clear
- rep # Clear
- stosw # line
- movw $(SCR_ROW-1)*SCR_COL*2,%dx
-crt_putchr.4: movw %dx,(%ebx) # Update position
- shrw $1,%dx
-crt_putchr.5: inb $0x60,%al # Move cursor
- testb $0x04,%al
- jz crt_putchr.5
- movb $0x49,%al
- outb %al,$0x62
- movb %dl,%al
- outb %al,$0x60
- movb %dh,%al
- outb %al,$0x60
- popa # Restore
- ret # To caller
diff --git a/sys/boot/pc98/libpc98/Makefile b/sys/boot/pc98/libpc98/Makefile
deleted file mode 100644
index f3e27a4c679d..000000000000
--- a/sys/boot/pc98/libpc98/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-# $FreeBSD$
-#
-LIB= pc98
-INTERNALLIB=
-
-.PATH: ${.CURDIR}/../../i386/libi386
-
-SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \
- biospci.c biossmap.c bootinfo.c bootinfo32.c \
- comconsole.c devicename.c elf32_freebsd.c \
- i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \
- time.c vidconsole.c
-.PATH: ${.CURDIR}/../../zfs
-SRCS+= devicename_stubs.c
-
-# Enable PXE TFTP or NFS support, not both.
-.if defined(LOADER_TFTP_SUPPORT)
-CFLAGS+= -DLOADER_TFTP_SUPPORT
-.else
-CFLAGS+= -DLOADER_NFS_SUPPORT
-.endif
-
-BOOT_COMCONSOLE_PORT?= 0x238
-CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT}
-
-BOOT_COMCONSOLE_SPEED?= 9600
-CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
-
-.ifdef(BOOT_BIOSDISK_DEBUG)
-# Make the disk code more talkative
-CFLAGS+= -DDISK_DEBUG
-.endif
-
-# Include simple terminal emulation (cons25-compatible)
-CFLAGS+= -DTERM_EMU
-
-# XXX: make alloca() useable
-CFLAGS+= -Dalloca=__builtin_alloca
-
-CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \
- -I${.CURDIR}/../../common \
- -I${.CURDIR}/../btx/lib \
- -I${.CURDIR}/../../i386/libi386 \
- -I${.CURDIR}/../../.. -I.
-# the location of libstand
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
-
-# Handle FreeBSD specific %b and %D printf format specifiers
-CFLAGS+= ${FORMAT_EXTENSIONS}
-
-.include <bsd.lib.mk>
diff --git a/sys/boot/pc98/libpc98/bioscd.c b/sys/boot/pc98/libpc98/bioscd.c
deleted file mode 100644
index f259701f91e0..000000000000
--- a/sys/boot/pc98/libpc98/bioscd.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 2001 John H. Baldwin <jhb@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * BIOS CD device handling for CD's that have been booted off of via no
- * emulation booting as defined in the El Torito standard.
- *
- * Ideas and algorithms from:
- *
- * - FreeBSD libi386/biosdisk.c
- *
- */
-
-#include <stand.h>
-
-#include <sys/param.h>
-#include <machine/bootinfo.h>
-
-#include <stdarg.h>
-
-#include <bootstrap.h>
-#include <btxv86.h>
-#include "libi386.h"
-
-#define BIOSCD_SECSIZE 2048
-#define BUFSIZE (1 * BIOSCD_SECSIZE)
-#define MAXBCDEV 1
-
-/* Major numbers for devices we frontend for. */
-#define ACDMAJOR 117
-#define CDMAJOR 15
-
-#ifdef DISK_DEBUG
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args)
-#else
-# define DEBUG(fmt, args...)
-#endif
-
-struct specification_packet {
- u_char sp_size;
- u_char sp_bootmedia;
- u_char sp_drive;
- u_char sp_controller;
- u_int sp_lba;
- u_short sp_devicespec;
- u_short sp_buffersegment;
- u_short sp_loadsegment;
- u_short sp_sectorcount;
- u_short sp_cylsec;
- u_char sp_head;
-};
-
-/*
- * List of BIOS devices, translation from disk unit number to
- * BIOS unit number.
- */
-static struct bcinfo {
- int bc_unit; /* BIOS unit number */
- struct specification_packet bc_sp;
- int bc_open; /* reference counter */
- void *bc_bcache; /* buffer cache data */
-} bcinfo [MAXBCDEV];
-static int nbcinfo = 0;
-
-#define BC(dev) (bcinfo[(dev)->d_unit])
-
-static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest);
-static int bc_init(void);
-static int bc_strategy(void *devdata, int flag, daddr_t dblk,
- size_t size, char *buf, size_t *rsize);
-static int bc_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t size, char *buf, size_t *rsize);
-static int bc_open(struct open_file *f, ...);
-static int bc_close(struct open_file *f);
-static int bc_print(int verbose);
-
-struct devsw bioscd = {
- "cd",
- DEVT_CD,
- bc_init,
- bc_strategy,
- bc_open,
- bc_close,
- noioctl,
- bc_print,
- NULL
-};
-
-/*
- * Translate between BIOS device numbers and our private unit numbers.
- */
-int
-bc_bios2unit(int biosdev)
-{
- int i;
-
- DEBUG("looking for bios device 0x%x", biosdev);
- for (i = 0; i < nbcinfo; i++) {
- DEBUG("bc unit %d is BIOS device 0x%x", i, bcinfo[i].bc_unit);
- if (bcinfo[i].bc_unit == biosdev)
- return(i);
- }
- return(-1);
-}
-
-int
-bc_unit2bios(int unit)
-{
- if ((unit >= 0) && (unit < nbcinfo))
- return(bcinfo[unit].bc_unit);
- return(-1);
-}
-
-/*
- * We can't quiz, we have to be told what device to use, so this functoin
- * doesn't do anything. Instead, the loader calls bc_add() with the BIOS
- * device number to add.
- */
-static int
-bc_init(void)
-{
-
- return (0);
-}
-
-int
-bc_add(int biosdev)
-{
-
- if (nbcinfo >= MAXBCDEV)
- return (-1);
- bcinfo[nbcinfo].bc_unit = biosdev;
-
- /* SCSI CD-ROM only */
- if ((biosdev & 0xf0) != 0xa0)
- return (-1);
- if ((((uint32_t *)PTOV(0xA1460))[biosdev & 0x0f] & 0x1f) != 5)
- return (-1);
-
- printf("BIOS CD is cd%d\n", nbcinfo);
- nbcinfo++;
- bcache_add_dev(nbcinfo); /* register cd device in bcache */
- return(0);
-}
-
-/*
- * Print information about disks
- */
-static int
-bc_print(int verbose)
-{
- char line[80];
- int i, ret = 0;
-
- if (nbcinfo == 0)
- return (0);
-
- printf("%s devices:", bioscd.dv_name);
- if ((ret = pager_output("\n")) != 0)
- return (ret);
-
- for (i = 0; i < nbcinfo; i++) {
- sprintf(line, " cd%d: Device 0x%x\n", i,
- bcinfo[i].bc_sp.sp_devicespec);
- if ((ret = pager_output(line)) != 0)
- break;
- }
- return (ret);
-}
-
-/*
- * Attempt to open the disk described by (dev) for use by (f).
- */
-static int
-bc_open(struct open_file *f, ...)
-{
- va_list ap;
- struct i386_devdesc *dev;
-
- va_start(ap, f);
- dev = va_arg(ap, struct i386_devdesc *);
- va_end(ap);
- if (dev->d_unit >= nbcinfo) {
- DEBUG("attempt to open nonexistent disk");
- return(ENXIO);
- }
-
- BC(dev).bc_open++;
- if (BC(dev).bc_bcache == NULL)
- BC(dev).bc_bcache = bcache_allocate();
- return(0);
-}
-
-static int
-bc_close(struct open_file *f)
-{
- struct i386_devdesc *dev;
-
- dev = (struct i386_devdesc *)f->f_devdata;
- BC(dev).bc_open--;
- if (BC(dev).bc_open == 0) {
- bcache_free(BC(dev).bc_bcache);
- BC(dev).bc_bcache = NULL;
- }
- return(0);
-}
-
-static int
-bc_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
- char *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
- struct i386_devdesc *dev;
-
- dev = (struct i386_devdesc *)devdata;
- bcd.dv_strategy = bc_realstrategy;
- bcd.dv_devdata = devdata;
- bcd.dv_cache = BC(dev).bc_bcache;
-
- return (bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
- char *buf, size_t *rsize)
-{
- struct i386_devdesc *dev;
- int unit;
- int blks;
-#ifdef BD_SUPPORT_FRAGS
- char fragbuf[BIOSCD_SECSIZE];
- size_t fragsize;
-
- fragsize = size % BIOSCD_SECSIZE;
-#else
- if (size % BIOSCD_SECSIZE)
- return (EINVAL);
-#endif
-
- if (rw != F_READ)
- return(EROFS);
- dev = (struct i386_devdesc *)devdata;
- unit = dev->d_unit;
- blks = size / BIOSCD_SECSIZE;
- if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0)
- return (EINVAL);
- dblk /= (BIOSCD_SECSIZE / DEV_BSIZE);
- DEBUG("read %d from %lld to %p", blks, dblk, buf);
-
- if (rsize)
- *rsize = 0;
- if (blks && bc_read(unit, dblk, blks, buf)) {
- DEBUG("read error");
- return (EIO);
- }
-#ifdef BD_SUPPORT_FRAGS
- DEBUG("frag read %d from %lld+%d to %p",
- fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE));
- if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) {
- DEBUG("frag read error");
- return(EIO);
- }
- bcopy(fragbuf, buf + (blks * BIOSCD_SECSIZE), fragsize);
-#endif
- if (rsize)
- *rsize = size;
- return (0);
-}
-
-/* Max number of sectors to bounce-buffer at a time. */
-#define CD_BOUNCEBUF 8
-
-static int
-bc_read(int unit, daddr_t dblk, int blks, caddr_t dest)
-{
- u_int maxfer, resid, result, retry, x;
- caddr_t bbuf, p, xp;
- int biosdev;
-#ifdef DISK_DEBUG
- int error;
-#endif
-
- /* Just in case some idiot actually tries to read -1 blocks... */
- if (blks < 0)
- return (-1);
-
- /* If nothing to do, just return succcess. */
- if (blks == 0)
- return (0);
-
- /* Decide whether we have to bounce */
- if (VTOP(dest) >> 20 != 0) {
- /*
- * The destination buffer is above first 1MB of
- * physical memory so we have to arrange a suitable
- * bounce buffer.
- */
- x = min(CD_BOUNCEBUF, (unsigned)blks);
- bbuf = alloca(x * BIOSCD_SECSIZE);
- maxfer = x;
- } else {
- bbuf = NULL;
- maxfer = 0;
- }
-
- biosdev = bc_unit2bios(unit);
- resid = blks;
- p = dest;
-
- while (resid > 0) {
- if (bbuf)
- xp = bbuf;
- else
- xp = p;
- x = resid;
- if (maxfer > 0)
- x = min(x, maxfer);
-
- /*
- * Loop retrying the operation a couple of times. The BIOS
- * may also retry.
- */
- for (retry = 0; retry < 3; retry++) {
- /* If retrying, reset the drive */
- if (retry > 0) {
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- v86.eax = 0x0300 | biosdev;
- v86int();
- }
-
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- v86.eax = 0x0600 | (biosdev & 0x7f);
- v86.ebx = x * BIOSCD_SECSIZE;
- v86.ecx = dblk & 0xffff;
- v86.edx = (dblk >> 16) & 0xffff;
- v86.ebp = VTOPOFF(xp);
- v86.es = VTOPSEG(xp);
- v86int();
- result = V86_CY(v86.efl);
- if (result == 0)
- break;
- }
-
-#ifdef DISK_DEBUG
- error = (v86.eax >> 8) & 0xff;
-#endif
- DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p,
- VTOP(p), result ? "failed" : "ok");
- DEBUG("unit %d status 0x%x", unit, error);
- if (bbuf != NULL)
- bcopy(bbuf, p, x * BIOSCD_SECSIZE);
- p += (x * BIOSCD_SECSIZE);
- dblk += x;
- resid -= x;
- }
-
-/* hexdump(dest, (blks * BIOSCD_SECSIZE)); */
- return(0);
-}
-
-/*
- * Return a suitable dev_t value for (dev).
- */
-int
-bc_getdev(struct i386_devdesc *dev)
-{
- int biosdev, unit, device;
- int major;
- int rootdev;
-
- unit = dev->d_unit;
- biosdev = bc_unit2bios(unit);
- DEBUG("unit %d BIOS device %d", unit, biosdev);
- if (biosdev == -1) /* not a BIOS device */
- return(-1);
-
- device = biosdev & 0xf0;
- if (device == 0x80)
- major = ACDMAJOR;
- else if (device == 0xa0)
- major = CDMAJOR;
- else
- return (-1);
-
- unit = 0; /* XXX */
-
- /* XXX: Assume partition 'a'. */
- rootdev = MAKEBOOTDEV(major, 0, unit, 0);
- DEBUG("dev is 0x%x\n", rootdev);
- return(rootdev);
-}
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
deleted file mode 100644
index 86a550deeac8..000000000000
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ /dev/null
@@ -1,1120 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * BIOS disk device handling.
- *
- * Ideas and algorithms from:
- *
- * - NetBSD libi386/biosdisk.c
- * - FreeBSD biosboot/disk.c
- *
- */
-
-#include <stand.h>
-
-#include <sys/disklabel.h>
-#include <sys/diskpc98.h>
-#include <machine/bootinfo.h>
-
-#include <stdarg.h>
-
-#include <bootstrap.h>
-#include <btxv86.h>
-#include "libi386.h"
-
-#define BIOS_NUMDRIVES 0x475
-#define BIOSDISK_SECSIZE 512
-#define BUFSIZE (1 * BIOSDISK_SECSIZE)
-
-#define DT_ATAPI 0x10 /* disk type for ATAPI floppies */
-#define WDMAJOR 0 /* major numbers for devices we frontend for */
-#define WFDMAJOR 1
-#define FDMAJOR 2
-#define DAMAJOR 4
-
-#ifdef DISK_DEBUG
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args)
-#else
-# define DEBUG(fmt, args...)
-#endif
-
-struct open_disk {
- int od_dkunit; /* disk unit number */
- int od_unit; /* BIOS unit number */
- int od_cyl; /* BIOS geometry */
- int od_hds;
- int od_sec;
- int od_boff; /* block offset from beginning of BIOS disk */
- int od_flags;
-#define BD_MODEINT13 0x0000
-#define BD_MODEEDD1 0x0001
-#define BD_MODEEDD3 0x0002
-#define BD_MODEMASK 0x0003
-#define BD_FLOPPY 0x0004
-#define BD_LABELOK 0x0008
-#define BD_PARTTABOK 0x0010
-#define BD_OPTICAL 0x0020
- struct disklabel od_disklabel;
- int od_nslices; /* slice count */
- struct pc98_partition od_slicetab[PC98_NPARTS];
-};
-
-/*
- * List of BIOS devices, translation from disk unit number to
- * BIOS unit number.
- */
-static struct bdinfo
-{
- int bd_unit; /* BIOS unit number */
- int bd_flags;
- int bd_type; /* BIOS 'drive type' (floppy only) */
- int bd_da_unit; /* kernel unit number for da */
- int bd_open; /* reference counter */
- void *bd_bcache; /* buffer cache data */
-} bdinfo [MAXBDDEV];
-static int nbdinfo = 0;
-
-#define BD(dev) (bdinfo[(dev)->d_unit])
-
-static int bd_getgeom(struct open_disk *od);
-static int bd_read(struct open_disk *od, daddr_t dblk, int blks,
- caddr_t dest);
-static int bd_write(struct open_disk *od, daddr_t dblk, int blks,
- caddr_t dest);
-
-static int bd_int13probe(struct bdinfo *bd);
-
-static int bd_printslice(struct open_disk *od, struct pc98_partition *dp,
- char *prefix, int verbose);
-static int bd_printbsdslice(struct open_disk *od, daddr_t offset,
- char *prefix, int verbose);
-
-static int bd_init(void);
-static int bd_strategy(void *devdata, int flag, daddr_t dblk,
- size_t size, char *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t size, char *buf, size_t *rsize);
-static int bd_open(struct open_file *f, ...);
-static int bd_close(struct open_file *f);
-static int bd_print(int verbose);
-
-struct devsw biosdisk = {
- "disk",
- DEVT_DISK,
- bd_init,
- bd_strategy,
- bd_open,
- bd_close,
- noioctl,
- bd_print,
- NULL
-};
-
-static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev);
-static void bd_closedisk(struct open_disk *od);
-static int bd_open_pc98(struct open_disk *od, struct i386_devdesc *dev);
-static int bd_bestslice(struct open_disk *od);
-static void bd_checkextended(struct open_disk *od, int slicenum);
-
-/*
- * Translate between BIOS device numbers and our private unit numbers.
- */
-int
-bd_bios2unit(int biosdev)
-{
- int i;
-
- DEBUG("looking for bios device 0x%x", biosdev);
- for (i = 0; i < nbdinfo; i++) {
- DEBUG("bd unit %d is BIOS device 0x%x", i, bdinfo[i].bd_unit);
- if (bdinfo[i].bd_unit == biosdev)
- return(i);
- }
- return(-1);
-}
-
-int
-bd_unit2bios(int unit)
-{
- if ((unit >= 0) && (unit < nbdinfo))
- return(bdinfo[unit].bd_unit);
- return(-1);
-}
-
-/*
- * Quiz the BIOS for disk devices, save a little info about them.
- */
-static int
-bd_init(void)
-{
- int base, unit;
- int da_drive=0, n=-0x10;
-
- /* sequence 0x90, 0x80, 0xa0 */
- for (base = 0x90; base <= 0xa0; base += n, n += 0x30) {
- for (unit = base; (nbdinfo < MAXBDDEV) || ((unit & 0x0f) < 4); unit++) {
- bdinfo[nbdinfo].bd_open = 0;
- bdinfo[nbdinfo].bd_bcache = NULL;
- bdinfo[nbdinfo].bd_unit = unit;
- bdinfo[nbdinfo].bd_flags = (unit & 0xf0) == 0x90 ? BD_FLOPPY : 0;
-
- if (!bd_int13probe(&bdinfo[nbdinfo])){
- if (((unit & 0xf0) == 0x90 && (unit & 0x0f) < 4) ||
- ((unit & 0xf0) == 0xa0 && (unit & 0x0f) < 6))
- continue; /* Target IDs are not contiguous. */
- else
- break;
- }
-
- if (bdinfo[nbdinfo].bd_flags & BD_FLOPPY){
- /* available 1.44MB access? */
- if (*(u_char *)PTOV(0xA15AE) & (1<<(unit & 0xf))) {
- /* boot media 1.2MB FD? */
- if ((*(u_char *)PTOV(0xA1584) & 0xf0) != 0x90)
- bdinfo[nbdinfo].bd_unit = 0x30 + (unit & 0xf);
- }
- }
- else {
- if ((unit & 0xF0) == 0xA0) /* SCSI HD or MO */
- bdinfo[nbdinfo].bd_da_unit = da_drive++;
- }
- /* XXX we need "disk aliases" to make this simpler */
- printf("BIOS drive %c: is disk%d\n",
- 'A' + nbdinfo, nbdinfo);
- nbdinfo++;
- }
- }
- bcache_add_dev(nbdinfo);
- return(0);
-}
-
-/*
- * Try to detect a device supported by the legacy int13 BIOS
- */
-static int
-bd_int13probe(struct bdinfo *bd)
-{
- int addr;
-
- if (bd->bd_flags & BD_FLOPPY) {
- addr = 0xa155c;
- } else {
- if ((bd->bd_unit & 0xf0) == 0x80)
- addr = 0xa155d;
- else
- addr = 0xa1482;
- }
- if ( *(u_char *)PTOV(addr) & (1<<(bd->bd_unit & 0x0f))) {
- bd->bd_flags |= BD_MODEINT13;
- return(1);
- }
- if ((bd->bd_unit & 0xF0) == 0xA0) {
- int media = ((unsigned *)PTOV(0xA1460))[bd->bd_unit & 0x0F] & 0x1F;
-
- if (media == 7) { /* MO */
- bd->bd_flags |= BD_MODEINT13 | BD_OPTICAL;
- return(1);
- }
- }
- return(0);
-}
-
-/*
- * Print information about disks
- */
-static int
-bd_print(int verbose)
-{
- int i, j, ret = 0;
- char line[80];
- struct i386_devdesc dev;
- struct open_disk *od;
- struct pc98_partition *dptr;
-
- if (nbdinfo == 0)
- return (0);
-
- printf("%s devices:", biosdisk.dv_name);
- if ((ret = pager_output("\n")) != 0)
- return (ret);
-
- for (i = 0; i < nbdinfo; i++) {
- snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n",
- i, 'A' + i);
- if ((ret = pager_output(line)) != 0)
- break;
-
- /* try to open the whole disk */
- dev.d_unit = i;
- dev.d_kind.biosdisk.slice = -1;
- dev.d_kind.biosdisk.partition = -1;
-
- if (!bd_opendisk(&od, &dev)) {
-
- /* Do we have a partition table? */
- if (od->od_flags & BD_PARTTABOK) {
- dptr = &od->od_slicetab[0];
-
- /* Check for a "dedicated" disk */
- for (j = 0; j < od->od_nslices; j++) {
- snprintf(line, sizeof(line), " disk%ds%d", i, j + 1);
- if ((ret = bd_printslice(od, &dptr[j], line, verbose)) != 0)
- break;
- }
- }
- bd_closedisk(od);
- if (ret != 0)
- break;
- }
- }
- return (ret);
-}
-
-/* Given a size in 512 byte sectors, convert it to a human-readable number. */
-static char *
-display_size(uint64_t size)
-{
- static char buf[80];
- char unit;
-
- size /= 2;
- unit = 'K';
- if (size >= 10485760000LL) {
- size /= 1073741824;
- unit = 'T';
- } else if (size >= 10240000) {
- size /= 1048576;
- unit = 'G';
- } else if (size >= 10000) {
- size /= 1024;
- unit = 'M';
- }
- sprintf(buf, "%6ld%cB", (long)size, unit);
- return (buf);
-}
-
-/*
- * Print information about slices on a disk. For the size calculations we
- * assume a 512 byte sector.
- */
-static int
-bd_printslice(struct open_disk *od, struct pc98_partition *dp, char *prefix,
- int verbose)
-{
- int cylsecs, start, size;
- char stats[80];
- char line[80];
-
- cylsecs = od->od_hds * od->od_sec;
- start = dp->dp_scyl * cylsecs + dp->dp_shd * od->od_sec + dp->dp_ssect;
- size = (dp->dp_ecyl - dp->dp_scyl + 1) * cylsecs;
-
- if (verbose)
- sprintf(stats, " %s (%d - %d)", display_size(size),
- start, start + size);
- else
- stats[0] = '\0';
-
- switch(dp->dp_mid & PC98_MID_MASK) {
- case PC98_MID_386BSD:
- return (bd_printbsdslice(od, start, prefix, verbose));
- case 0x00: /* unused partition */
- return (0);
- case 0x01:
- sprintf(line, "%s: FAT-12%s\n", prefix, stats);
- break;
- case 0x11:
- case 0x20:
- case 0x21:
- case 0x22:
- case 0x23:
- case 0x24:
- sprintf(line, "%s: FAT-16%s\n", prefix, stats);
- break;
- default:
- sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_mid,
- stats);
- }
- return (pager_output(line));
-}
-
-/*
- * Print out each valid partition in the disklabel of a FreeBSD slice.
- * For size calculations, we assume a 512 byte sector size.
- */
-static int
-bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix,
- int verbose)
-{
- char line[80];
- char buf[BIOSDISK_SECSIZE];
- struct disklabel *lp;
- int i;
-
- /* read disklabel */
- if (bd_read(od, offset + LABELSECTOR, 1, buf))
- return (0);
- lp =(struct disklabel *)(&buf[0]);
- if (lp->d_magic != DISKMAGIC) {
- sprintf(line, "%s: FFS bad disklabel\n", prefix);
- return (pager_output(line));
- }
-
- /* Print partitions */
- for (i = 0; i < lp->d_npartitions; i++) {
- /*
- * For each partition, make sure we know what type of fs it is. If
- * not, then skip it. However, since floppies often have bogus
- * fstypes, print the 'a' partition on a floppy even if it is marked
- * unused.
- */
- if ((lp->d_partitions[i].p_fstype == FS_BSDFFS) ||
- (lp->d_partitions[i].p_fstype == FS_SWAP) ||
- (lp->d_partitions[i].p_fstype == FS_VINUM) ||
- ((lp->d_partitions[i].p_fstype == FS_UNUSED) &&
- (od->od_flags & BD_FLOPPY) && (i == 0))) {
-
- /* Only print out statistics in verbose mode */
- if (verbose)
- sprintf(line, " %s%c: %s %s (%d - %d)\n", prefix, 'a' + i,
- (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap " :
- (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
- "FFS ",
- display_size(lp->d_partitions[i].p_size),
- lp->d_partitions[i].p_offset,
- lp->d_partitions[i].p_offset + lp->d_partitions[i].p_size);
- else
- sprintf(line, " %s%c: %s\n", prefix, 'a' + i,
- (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" :
- (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
- "FFS");
- if (pager_output(line))
- return (1);
- }
- }
- return (0);
-}
-
-
-/*
- * Attempt to open the disk described by (dev) for use by (f).
- *
- * Note that the philosophy here is "give them exactly what
- * they ask for". This is necessary because being too "smart"
- * about what the user might want leads to complications.
- * (eg. given no slice or partition value, with a disk that is
- * sliced - are they after the first BSD slice, or the DOS
- * slice before it?)
- */
-static int
-bd_open(struct open_file *f, ...)
-{
- va_list ap;
- struct i386_devdesc *dev;
- struct open_disk *od;
- int error;
-
- va_start(ap, f);
- dev = va_arg(ap, struct i386_devdesc *);
- va_end(ap);
- if ((error = bd_opendisk(&od, dev)))
- return(error);
-
- BD(dev).bd_open++;
- if (BD(dev).bd_bcache == NULL)
- BD(dev).bd_bcache = bcache_allocate();
-
- /*
- * Save our context
- */
- ((struct i386_devdesc *)(f->f_devdata))->d_kind.biosdisk.data = od;
- DEBUG("open_disk %p, partition at 0x%x", od, od->od_boff);
- return(0);
-}
-
-static int
-bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
-{
- struct open_disk *od;
- int error;
-
- if (dev->d_unit >= nbdinfo) {
- DEBUG("attempt to open nonexistent disk");
- return(ENXIO);
- }
-
- od = (struct open_disk *)malloc(sizeof(struct open_disk));
- if (!od) {
- DEBUG("no memory");
- return (ENOMEM);
- }
-
- /* Look up BIOS unit number, intialise open_disk structure */
- od->od_dkunit = dev->d_unit;
- od->od_unit = bdinfo[od->od_dkunit].bd_unit;
- od->od_flags = bdinfo[od->od_dkunit].bd_flags;
- od->od_boff = 0;
- error = 0;
- DEBUG("open '%s', unit 0x%x slice %d partition %d",
- i386_fmtdev(dev), dev->d_unit,
- dev->d_kind.biosdisk.slice, dev->d_kind.biosdisk.partition);
-
- /* Get geometry for this open (removable device may have changed) */
- if (bd_getgeom(od)) {
- DEBUG("can't get geometry");
- error = ENXIO;
- goto out;
- }
-
- /* Determine disk layout. */
- error = bd_open_pc98(od, dev);
-
- out:
- if (error) {
- free(od);
- } else {
- *odp = od; /* return the open disk */
- }
- return(error);
-}
-
-static int
-bd_open_pc98(struct open_disk *od, struct i386_devdesc *dev)
-{
- struct pc98_partition *dptr;
- struct disklabel *lp;
- int sector, slice, i;
- char buf[BUFSIZE];
-
- /*
- * Following calculations attempt to determine the correct value
- * for d->od_boff by looking for the slice and partition specified,
- * or searching for reasonable defaults.
- */
-
- /*
- * Find the slice in the DOS slice table.
- */
- od->od_nslices = 0;
- if (od->od_flags & BD_FLOPPY) {
- sector = 0;
- goto unsliced;
- }
- if (bd_read(od, 0, 1, buf)) {
- DEBUG("error reading MBR");
- return (EIO);
- }
-
- /*
- * Check the slice table magic.
- */
- if (((u_char)buf[0x1fe] != 0x55) || ((u_char)buf[0x1ff] != 0xaa)) {
- /* If a slice number was explicitly supplied, this is an error */
- if (dev->d_kind.biosdisk.slice > 0) {
- DEBUG("no slice table/MBR (no magic)");
- return (ENOENT);
- }
- sector = 0;
- goto unsliced; /* may be a floppy */
- }
- if (bd_read(od, 1, 1, buf)) {
- DEBUG("error reading MBR");
- return (EIO);
- }
-
- /*
- * copy the partition table, then pick up any extended partitions.
- */
- bcopy(buf + PC98_PARTOFF, &od->od_slicetab,
- sizeof(struct pc98_partition) * PC98_NPARTS);
- od->od_nslices = PC98_NPARTS; /* extended slices start here */
- od->od_flags |= BD_PARTTABOK;
- dptr = &od->od_slicetab[0];
-
- /* Is this a request for the whole disk? */
- if (dev->d_kind.biosdisk.slice == -1) {
- sector = 0;
- goto unsliced;
- }
-
- /*
- * if a slice number was supplied but not found, this is an error.
- */
- if (dev->d_kind.biosdisk.slice > 0) {
- slice = dev->d_kind.biosdisk.slice - 1;
- if (slice >= od->od_nslices) {
- DEBUG("slice %d not found", slice);
- return (ENOENT);
- }
- }
-
- /* Try to auto-detect the best slice; this should always give a slice number */
- if (dev->d_kind.biosdisk.slice == 0) {
- slice = bd_bestslice(od);
- if (slice == -1) {
- return (ENOENT);
- }
- dev->d_kind.biosdisk.slice = slice;
- }
-
- dptr = &od->od_slicetab[0];
- /*
- * Accept the supplied slice number unequivocally (we may be looking
- * at a DOS partition).
- */
- dptr += (dev->d_kind.biosdisk.slice - 1); /* we number 1-4, offsets are 0-3 */
- sector = dptr->dp_scyl * od->od_hds * od->od_sec +
- dptr->dp_shd * od->od_sec + dptr->dp_ssect;
- {
- int end = dptr->dp_ecyl * od->od_hds * od->od_sec +
- dptr->dp_ehd * od->od_sec + dptr->dp_esect;
- DEBUG("slice entry %d at %d, %d sectors",
- dev->d_kind.biosdisk.slice - 1, sector, end-sector);
- }
-
- /*
- * If we are looking at a BSD slice, and the partition is < 0, assume the 'a' partition
- */
- if ((dptr->dp_mid == DOSMID_386BSD) && (dev->d_kind.biosdisk.partition < 0))
- dev->d_kind.biosdisk.partition = 0;
-
- unsliced:
- /*
- * Now we have the slice offset, look for the partition in the disklabel if we have
- * a partition to start with.
- *
- * XXX we might want to check the label checksum.
- */
- if (dev->d_kind.biosdisk.partition < 0) {
- od->od_boff = sector; /* no partition, must be after the slice */
- DEBUG("opening raw slice");
- } else {
-
- if (bd_read(od, sector + LABELSECTOR, 1, buf)) {
- DEBUG("error reading disklabel");
- return (EIO);
- }
- DEBUG("copy %d bytes of label from %p to %p", sizeof(struct disklabel), buf + LABELOFFSET, &od->od_disklabel);
- bcopy(buf + LABELOFFSET, &od->od_disklabel, sizeof(struct disklabel));
- lp = &od->od_disklabel;
- od->od_flags |= BD_LABELOK;
-
- if (lp->d_magic != DISKMAGIC) {
- DEBUG("no disklabel");
- return (ENOENT);
- }
- if (dev->d_kind.biosdisk.partition >= lp->d_npartitions) {
- DEBUG("partition '%c' exceeds partitions in table (a-'%c')",
- 'a' + dev->d_kind.biosdisk.partition, 'a' + lp->d_npartitions);
- return (EPART);
- }
-
-#ifdef DISK_DEBUG
- /* Complain if the partition is unused unless this is a floppy. */
- if ((lp->d_partitions[dev->d_kind.biosdisk.partition].p_fstype == FS_UNUSED) &&
- !(od->od_flags & BD_FLOPPY))
- DEBUG("warning, partition marked as unused");
-#endif
-
- od->od_boff =
- lp->d_partitions[dev->d_kind.biosdisk.partition].p_offset -
- lp->d_partitions[RAW_PART].p_offset +
- sector;
- }
- return (0);
-}
-
-/*
- * Search for a slice with the following preferences:
- *
- * 1: Active FreeBSD slice
- * 2: Non-active FreeBSD slice
- * 3: Active Linux slice
- * 4: non-active Linux slice
- * 5: Active FAT/FAT32 slice
- * 6: non-active FAT/FAT32 slice
- */
-#define PREF_RAWDISK 0
-#define PREF_FBSD_ACT 1
-#define PREF_FBSD 2
-#define PREF_LINUX_ACT 3
-#define PREF_LINUX 4
-#define PREF_DOS_ACT 5
-#define PREF_DOS 6
-#define PREF_NONE 7
-
-/*
- * slicelimit is in the range 0 .. PC98_NPARTS
- */
-static int
-bd_bestslice(struct open_disk *od)
-{
- struct pc98_partition *dp;
- int pref, preflevel;
- int i, prefslice;
-
- prefslice = 0;
- preflevel = PREF_NONE;
-
- dp = &od->od_slicetab[0];
- for (i = 0; i < od->od_nslices; i++, dp++) {
- switch(dp->dp_mid & PC98_MID_MASK) {
- case PC98_MID_386BSD: /* FreeBSD */
- if ((dp->dp_mid & PC98_MID_BOOTABLE) &&
- (preflevel > PREF_FBSD_ACT)) {
- pref = i;
- preflevel = PREF_FBSD_ACT;
- } else if (preflevel > PREF_FBSD) {
- pref = i;
- preflevel = PREF_FBSD;
- }
- break;
-
- case 0x11: /* DOS/Windows */
- case 0x20:
- case 0x21:
- case 0x22:
- case 0x23:
- case 0x63:
- if ((dp->dp_mid & PC98_MID_BOOTABLE) &&
- (preflevel > PREF_DOS_ACT)) {
- pref = i;
- preflevel = PREF_DOS_ACT;
- } else if (preflevel > PREF_DOS) {
- pref = i;
- preflevel = PREF_DOS;
- }
- break;
- }
- }
- return (prefslice);
-}
-
-static int
-bd_close(struct open_file *f)
-{
- struct i386_devdesc *dev = f->f_devdata;
- struct open_disk *od = (struct open_disk *)(dev->d_kind.biosdisk.data);
-
- BD(dev).bd_open--;
- if (BD(dev).bd_open == 0) {
- bcache_free(BD(dev).bd_bcache);
- BD(dev).bd_bcache = NULL;
- }
-
- bd_closedisk(od);
- return(0);
-}
-
-static void
-bd_closedisk(struct open_disk *od)
-{
- DEBUG("open_disk %p", od);
-#if 0
- /* XXX is this required? (especially if disk already open...) */
- if (od->od_flags & BD_FLOPPY)
- delay(3000000);
-#endif
- free(od);
-}
-
-static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
- char *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
- struct i386_devdesc *dev = devdata;
- struct open_disk *od = (struct open_disk *)(dev->d_kind.biosdisk.data);
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- bcd.dv_cache = BD(dev).bd_bcache;
- return(bcache_strategy(&bcd, rw, dblk+od->od_boff, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int rw, daddr_t dblk,
- size_t size, char *buf, size_t *rsize)
-{
- struct open_disk *od = (struct open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data);
- int blks;
-#ifdef BD_SUPPORT_FRAGS
- char fragbuf[BIOSDISK_SECSIZE];
- size_t fragsize;
-
- fragsize = size % BIOSDISK_SECSIZE;
-#else
- if (size % BIOSDISK_SECSIZE)
- panic("bd_strategy: %d bytes I/O not multiple of block size", size);
-#endif
-
- DEBUG("open_disk %p", od);
- blks = size / BIOSDISK_SECSIZE;
- if (rsize)
- *rsize = 0;
-
- switch(rw){
- case F_READ:
- DEBUG("read %d from %d to %p", blks, dblk, buf);
-
- if (blks && bd_read(od, dblk, blks, buf)) {
- DEBUG("read error");
- return (EIO);
- }
-#ifdef BD_SUPPORT_FRAGS
- DEBUG("bd_strategy: frag read %d from %d+%d to %p",
- fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE));
- if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) {
- DEBUG("frag read error");
- return(EIO);
- }
- bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize);
-#endif
- break;
- case F_WRITE :
- DEBUG("write %d from %d to %p", blks, dblk, buf);
-
- if (blks && bd_write(od, dblk, blks, buf)) {
- DEBUG("write error");
- return (EIO);
- }
-#ifdef BD_SUPPORT_FRAGS
- if(fragsize) {
- DEBUG("Attempted to write a frag");
- return (EIO);
- }
-#endif
- break;
- default:
- /* DO NOTHING */
- return (EROFS);
- }
-
- if (rsize)
- *rsize = size;
- return (0);
-}
-
-/* Max number of sectors to bounce-buffer if the request crosses a 64k boundary */
-#define FLOPPY_BOUNCEBUF 18
-
-static int
-bd_chs_io(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest, int write)
-{
- u_int x, bpc, cyl, hd, sec;
-
- bpc = (od->od_sec * od->od_hds); /* blocks per cylinder */
- x = dblk;
- cyl = x / bpc; /* block # / blocks per cylinder */
- x %= bpc; /* block offset into cylinder */
- hd = x / od->od_sec; /* offset / blocks per track */
- sec = x % od->od_sec; /* offset into track */
-
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- if (write)
- v86.eax = 0x0500 | od->od_unit;
- else
- v86.eax = 0x0600 | od->od_unit;
- if (od->od_flags & BD_FLOPPY) {
- v86.eax |= 0xd000;
- v86.ecx = 0x0200 | (cyl & 0xff);
- v86.edx = (hd << 8) | (sec + 1);
- } else if (od->od_flags & BD_OPTICAL) {
- v86.eax &= 0xFF7F;
- v86.ecx = dblk & 0xFFFF;
- v86.edx = dblk >> 16;
- } else {
- v86.ecx = cyl;
- v86.edx = (hd << 8) | sec;
- }
- v86.ebx = blks * BIOSDISK_SECSIZE;
- v86.es = VTOPSEG(dest);
- v86.ebp = VTOPOFF(dest);
- v86int();
- return (V86_CY(v86.efl));
-}
-
-static int
-bd_io(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest, int write)
-{
- u_int x, sec, result, resid, retry, maxfer;
- caddr_t p, xp, bbuf, breg;
-
- /* Just in case some idiot actually tries to read/write -1 blocks... */
- if (blks < 0)
- return (-1);
-
- resid = blks;
- p = dest;
-
- /* Decide whether we have to bounce */
- if (VTOP(dest) >> 20 != 0 ||
- ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) {
-
- /*
- * There is a 64k physical boundary somewhere in the
- * destination buffer, or the destination buffer is above
- * first 1MB of physical memory so we have to arrange a
- * suitable bounce buffer. Allocate a buffer twice as large
- * as we need to. Use the bottom half unless there is a break
- * there, in which case we use the top half.
- */
- x = min(od->od_sec, (unsigned)blks);
- bbuf = alloca(x * 2 * BIOSDISK_SECSIZE);
- if (((u_int32_t)VTOP(bbuf) & 0xffff0000) ==
- ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) {
- breg = bbuf;
- } else {
- breg = bbuf + x * BIOSDISK_SECSIZE;
- }
- maxfer = x; /* limit transfers to bounce region size */
- } else {
- breg = bbuf = NULL;
- maxfer = 0;
- }
-
- while (resid > 0) {
- /*
- * Play it safe and don't cross track boundaries.
- * (XXX this is probably unnecessary)
- */
- sec = dblk % od->od_sec; /* offset into track */
- x = min(od->od_sec - sec, resid);
- if (maxfer > 0)
- x = min(x, maxfer); /* fit bounce buffer */
-
- /* where do we transfer to? */
- xp = bbuf == NULL ? p : breg;
-
- /*
- * Put your Data In, Put your Data out,
- * Put your Data In, and shake it all about
- */
- if (write && bbuf != NULL)
- bcopy(p, breg, x * BIOSDISK_SECSIZE);
-
- /*
- * Loop retrying the operation a couple of times. The BIOS
- * may also retry.
- */
- for (retry = 0; retry < 3; retry++) {
- /* if retrying, reset the drive */
- if (retry > 0) {
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- v86.eax = 0x0300 | od->od_unit;
- v86int();
- }
-
- result = bd_chs_io(od, dblk, x, xp, write);
- if (result == 0)
- break;
- }
-
- if (write)
- DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x,
- p, VTOP(p), dblk, result ? "failed" : "ok");
- else
- DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x,
- dblk, p, VTOP(p), result ? "failed" : "ok");
- if (result) {
- return(-1);
- }
- if (!write && bbuf != NULL)
- bcopy(breg, p, x * BIOSDISK_SECSIZE);
- p += (x * BIOSDISK_SECSIZE);
- dblk += x;
- resid -= x;
- }
-
-/* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */
- return(0);
-}
-
-static int
-bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest)
-{
-
- return (bd_io(od, dblk, blks, dest, 0));
-}
-
-static int
-bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest)
-{
-
- return (bd_io(od, dblk, blks, dest, 1));
-}
-
-static int
-bd_getgeom(struct open_disk *od)
-{
-
- if (od->od_flags & BD_FLOPPY) {
- od->od_cyl = 79;
- od->od_hds = 2;
- od->od_sec = (od->od_unit & 0xf0) == 0x30 ? 18 : 15;
- } else if (od->od_flags & BD_OPTICAL) {
- od->od_cyl = 0xFFFE;
- od->od_hds = 8;
- od->od_sec = 32;
- } else {
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- v86.eax = 0x8400 | od->od_unit;
- v86int();
-
- od->od_cyl = v86.ecx;
- od->od_hds = (v86.edx >> 8) & 0xff;
- od->od_sec = v86.edx & 0xff;
- if (V86_CY(v86.efl))
- return(1);
- }
-
- DEBUG("unit 0x%x geometry %d/%d/%d", od->od_unit, od->od_cyl, od->od_hds, od->od_sec);
- return(0);
-}
-
-/*
- * Return the BIOS geometry of a given "fixed drive" in a format
- * suitable for the legacy bootinfo structure. Since the kernel is
- * expecting raw int 0x13/0x8 values for N_BIOS_GEOM drives, we
- * prefer to get the information directly, rather than rely on being
- * able to put it together from information already maintained for
- * different purposes and for a probably different number of drives.
- *
- * For valid drives, the geometry is expected in the format (31..0)
- * "000000cc cccccccc hhhhhhhh 00ssssss"; and invalid drives are
- * indicated by returning the geometry of a "1.2M" PC-format floppy
- * disk. And, incidentally, what is returned is not the geometry as
- * such but the highest valid cylinder, head, and sector numbers.
- */
-u_int32_t
-bd_getbigeom(int bunit)
-{
- int hds = 0;
- int unit = 0x80; /* IDE HDD */
- u_int addr = 0xA155d;
-
- while (unit < 0xa7) {
- if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f)))
- if (hds++ == bunit)
- break;
-
- if (unit >= 0xA0) {
- int media = ((unsigned *)PTOV(0xA1460))[unit & 0x0F] & 0x1F;
-
- if (media == 7 && hds++ == bunit) /* SCSI MO */
- return(0xFFFE0820); /* C:65535 H:8 S:32 */
- }
- if (++unit == 0x84) {
- unit = 0xA0; /* SCSI HDD */
- addr = 0xA1482;
- }
- }
- if (unit == 0xa7)
- return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1b;
- v86.eax = 0x8400 | unit;
- v86int();
- if (V86_CY(v86.efl))
- return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
- return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff);
-}
-
-/*
- * Return a suitable dev_t value for (dev).
- *
- * In the case where it looks like (dev) is a SCSI disk, we allow the number of
- * IDE disks to be specified in $num_ide_disks. There should be a Better Way.
- */
-int
-bd_getdev(struct i386_devdesc *dev)
-{
- struct open_disk *od;
- int biosdev;
- int major;
- int rootdev;
- char *nip, *cp;
- int unitofs = 0, i, unit;
-
- biosdev = bd_unit2bios(dev->d_unit);
- DEBUG("unit %d BIOS device %d", dev->d_unit, biosdev);
- if (biosdev == -1) /* not a BIOS device */
- return(-1);
- if (bd_opendisk(&od, dev) != 0) /* oops, not a viable device */
- return(-1);
-
- if ((biosdev & 0xf0) == 0x90 || (biosdev & 0xf0) == 0x30) {
- /* floppy (or emulated floppy) or ATAPI device */
- if (bdinfo[dev->d_unit].bd_type == DT_ATAPI) {
- /* is an ATAPI disk */
- major = WFDMAJOR;
- } else {
- /* is a floppy disk */
- major = FDMAJOR;
- }
- } else {
- /* harddisk */
- if ((od->od_flags & BD_LABELOK) && (od->od_disklabel.d_type == DTYPE_SCSI)) {
- /* label OK, disk labelled as SCSI */
- major = DAMAJOR;
- /* check for unit number correction hint, now deprecated */
- if ((nip = getenv("num_ide_disks")) != NULL) {
- i = strtol(nip, &cp, 0);
- /* check for parse error */
- if ((cp != nip) && (*cp == 0))
- unitofs = i;
- }
- } else {
- /* assume an IDE disk */
- major = WDMAJOR;
- }
- }
- /* default root disk unit number */
- if ((biosdev & 0xf0) == 0xa0)
- unit = bdinfo[dev->d_unit].bd_da_unit;
- else
- unit = biosdev & 0xf;
-
- /* XXX a better kludge to set the root disk unit number */
- if ((nip = getenv("root_disk_unit")) != NULL) {
- i = strtol(nip, &cp, 0);
- /* check for parse error */
- if ((cp != nip) && (*cp == 0))
- unit = i;
- }
-
- rootdev = MAKEBOOTDEV(major, dev->d_kind.biosdisk.slice + 1, unit,
- dev->d_kind.biosdisk.partition);
- DEBUG("dev is 0x%x\n", rootdev);
- return(rootdev);
-}
diff --git a/sys/boot/pc98/libpc98/biosmem.c b/sys/boot/pc98/libpc98/biosmem.c
deleted file mode 100644
index c5a9b302b02f..000000000000
--- a/sys/boot/pc98/libpc98/biosmem.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * Obtain memory configuration information from the BIOS
- */
-#include <stand.h>
-#include "libi386.h"
-#include "btxv86.h"
-
-vm_offset_t memtop, memtop_copyin, high_heap_base;
-uint32_t bios_basemem, bios_extmem, high_heap_size;
-
-/*
- * The minimum amount of memory to reserve in bios_extmem for the heap.
- */
-#define HEAP_MIN (64 * 1024 * 1024)
-
-void
-bios_getmem(void)
-{
-
- bios_basemem = ((*(u_char *)PTOV(0xA1501) & 0x07) + 1) * 128 * 1024;
- bios_extmem = *(u_char *)PTOV(0xA1401) * 128 * 1024 +
- *(u_int16_t *)PTOV(0xA1594) * 1024 * 1024;
-
- /* Set memtop to actual top of memory */
- memtop = memtop_copyin = 0x100000 + bios_extmem;
-
- /*
- * If we have extended memory, use the last 3MB of 'extended' memory
- * as a high heap candidate.
- */
- if (bios_extmem >= HEAP_MIN) {
- high_heap_size = HEAP_MIN;
- high_heap_base = memtop - HEAP_MIN;
- }
-}
diff --git a/sys/boot/pc98/libpc98/biossmap.c b/sys/boot/pc98/libpc98/biossmap.c
deleted file mode 100644
index 5a7a89fd3efb..000000000000
--- a/sys/boot/pc98/libpc98/biossmap.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * Copyright (c) 2006 TAKAHASHI Yoshihiro <nyan@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <sys/param.h>
-#include "libi386.h"
-
-void
-bios_addsmapdata(struct preloaded_file *kfp)
-{
-
-}
diff --git a/sys/boot/pc98/libpc98/comconsole.c b/sys/boot/pc98/libpc98/comconsole.c
deleted file mode 100644
index 1bf2d6a2ccb7..000000000000
--- a/sys/boot/pc98/libpc98/comconsole.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith (msmith@freebsd.org)
- *
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <bootstrap.h>
-#include <machine/cpufunc.h>
-#include <dev/ic/ns16550.h>
-#include <dev/pci/pcireg.h>
-#include "libi386.h"
-
-#define COMC_FMT 0x3 /* 8N1 */
-#define COMC_TXWAIT 0x40000 /* transmit timeout */
-#define COMC_BPS(x) (115200 / (x)) /* speed to DLAB divisor */
-#define COMC_DIV2BPS(x) (115200 / (x)) /* DLAB divisor to speed */
-
-#ifndef COMPORT
-#define COMPORT 0x238
-#endif
-#ifndef COMSPEED
-#define COMSPEED 9600
-#endif
-
-static void comc_probe(struct console *cp);
-static int comc_init(int arg);
-static void comc_putchar(int c);
-static int comc_getchar(void);
-static int comc_getspeed(void);
-static int comc_ischar(void);
-static int comc_parseint(const char *string);
-static uint32_t comc_parse_pcidev(const char *string);
-static int comc_pcidev_set(struct env_var *ev, int flags,
- const void *value);
-static int comc_pcidev_handle(uint32_t locator);
-static int comc_port_set(struct env_var *ev, int flags,
- const void *value);
-static void comc_setup(int speed, int port);
-static int comc_speed_set(struct env_var *ev, int flags,
- const void *value);
-
-static int comc_curspeed;
-static int comc_port = COMPORT;
-static uint32_t comc_locator;
-
-struct console comconsole = {
- "comconsole",
- "serial port",
- 0,
- comc_probe,
- comc_init,
- comc_putchar,
- comc_getchar,
- comc_ischar
-};
-
-static void
-comc_probe(struct console *cp)
-{
- char intbuf[16];
- char *cons, *env;
- int speed, port;
- uint32_t locator;
-
- if (comc_curspeed == 0) {
- comc_curspeed = COMSPEED;
- /*
- * Assume that the speed was set by an earlier boot loader if
- * comconsole is already the preferred console.
- */
- cons = getenv("console");
- if ((cons != NULL && strcmp(cons, comconsole.c_name) == 0) ||
- getenv("boot_multicons") != NULL) {
- comc_curspeed = comc_getspeed();
- }
-
- env = getenv("comconsole_speed");
- if (env != NULL) {
- speed = comc_parseint(env);
- if (speed > 0)
- comc_curspeed = speed;
- }
-
- sprintf(intbuf, "%d", comc_curspeed);
- unsetenv("comconsole_speed");
- env_setenv("comconsole_speed", EV_VOLATILE, intbuf, comc_speed_set,
- env_nounset);
-
- env = getenv("comconsole_port");
- if (env != NULL) {
- port = comc_parseint(env);
- if (port > 0)
- comc_port = port;
- }
-
- sprintf(intbuf, "%d", comc_port);
- unsetenv("comconsole_port");
- env_setenv("comconsole_port", EV_VOLATILE, intbuf, comc_port_set,
- env_nounset);
-
- env = getenv("comconsole_pcidev");
- if (env != NULL) {
- locator = comc_parse_pcidev(env);
- if (locator != 0)
- comc_pcidev_handle(locator);
- }
-
- unsetenv("comconsole_pcidev");
- env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set,
- env_nounset);
- }
- comc_setup(comc_curspeed, comc_port);
-}
-
-static int
-comc_init(int arg)
-{
-
- comc_setup(comc_curspeed, comc_port);
-
- if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) ==
- (C_PRESENTIN | C_PRESENTOUT))
- return (CMD_OK);
- return (CMD_ERROR);
-}
-
-static void
-comc_putchar(int c)
-{
- int wait;
-
- for (wait = COMC_TXWAIT; wait > 0; wait--)
- if (inb(comc_port + com_lsr) & LSR_TXRDY) {
- outb(comc_port + com_data, (u_char)c);
- break;
- }
-}
-
-static int
-comc_getchar(void)
-{
- return (comc_ischar() ? inb(comc_port + com_data) : -1);
-}
-
-static int
-comc_ischar(void)
-{
- return (inb(comc_port + com_lsr) & LSR_RXRDY);
-}
-
-static int
-comc_speed_set(struct env_var *ev, int flags, const void *value)
-{
- int speed;
-
- if (value == NULL || (speed = comc_parseint(value)) <= 0) {
- printf("Invalid speed\n");
- return (CMD_ERROR);
- }
-
- if (comc_curspeed != speed)
- comc_setup(speed, comc_port);
-
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
-
- return (CMD_OK);
-}
-
-static int
-comc_port_set(struct env_var *ev, int flags, const void *value)
-{
- int port;
-
- if (value == NULL || (port = comc_parseint(value)) <= 0) {
- printf("Invalid port\n");
- return (CMD_ERROR);
- }
-
- if (comc_port != port)
- comc_setup(comc_curspeed, port);
-
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
-
- return (CMD_OK);
-}
-
-/*
- * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10.
- * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0]
- */
-static uint32_t
-comc_parse_pcidev(const char *string)
-{
- char *p, *p1;
- uint8_t bus, dev, func, bar;
- uint32_t locator;
- int pres;
-
- pres = strtol(string, &p, 0);
- if (p == string || *p != ':' || pres < 0 )
- return (0);
- bus = pres;
- p1 = ++p;
-
- pres = strtol(p1, &p, 0);
- if (p == string || *p != ':' || pres < 0 )
- return (0);
- dev = pres;
- p1 = ++p;
-
- pres = strtol(p1, &p, 0);
- if (p == string || (*p != ':' && *p != '\0') || pres < 0 )
- return (0);
- func = pres;
-
- if (*p == ':') {
- p1 = ++p;
- pres = strtol(p1, &p, 0);
- if (p == string || *p != '\0' || pres <= 0 )
- return (0);
- bar = pres;
- } else
- bar = 0x10;
-
- locator = (bar << 16) | biospci_locator(bus, dev, func);
- return (locator);
-}
-
-static int
-comc_pcidev_handle(uint32_t locator)
-{
- char intbuf[64];
- uint32_t port;
-
- if (biospci_read_config(locator & 0xffff,
- (locator & 0xff0000) >> 16, 2, &port) == -1) {
- printf("Cannot read bar at 0x%x\n", locator);
- return (CMD_ERROR);
- }
- if (!PCI_BAR_IO(port)) {
- printf("Memory bar at 0x%x\n", locator);
- return (CMD_ERROR);
- }
- port &= PCIM_BAR_IO_BASE;
-
- sprintf(intbuf, "%d", port);
- unsetenv("comconsole_port");
- env_setenv("comconsole_port", EV_VOLATILE, intbuf,
- comc_port_set, env_nounset);
-
- comc_setup(comc_curspeed, port);
- comc_locator = locator;
-
- return (CMD_OK);
-}
-
-static int
-comc_pcidev_set(struct env_var *ev, int flags, const void *value)
-{
- uint32_t locator;
- int error;
-
- if (value == NULL || (locator = comc_parse_pcidev(value)) <= 0) {
- printf("Invalid pcidev\n");
- return (CMD_ERROR);
- }
- if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 &&
- comc_locator != locator) {
- error = comc_pcidev_handle(locator);
- if (error != CMD_OK)
- return (error);
- }
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
- return (CMD_OK);
-}
-
-static void
-comc_setup(int speed, int port)
-{
- static int TRY_COUNT = 1000000;
- char intbuf[64];
- int tries;
-
- unsetenv("hw.uart.console");
- comc_curspeed = speed;
- comc_port = port;
- if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0)
- return;
-
- outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT);
- outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff);
- outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8);
- outb(comc_port + com_cfcr, COMC_FMT);
- outb(comc_port + com_mcr, MCR_RTS | MCR_DTR);
-
- tries = 0;
- do
- inb(comc_port + com_data);
- while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT);
-
- if (tries < TRY_COUNT) {
- comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT);
- sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed);
- env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL);
- } else
- comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT);
-}
-
-static int
-comc_parseint(const char *speedstr)
-{
- char *p;
- int speed;
-
- speed = strtol(speedstr, &p, 0);
- if (p == speedstr || *p != '\0' || speed <= 0)
- return (-1);
-
- return (speed);
-}
-
-static int
-comc_getspeed(void)
-{
- u_int divisor;
- u_char dlbh;
- u_char dlbl;
- u_char cfcr;
-
- cfcr = inb(comc_port + com_cfcr);
- outb(comc_port + com_cfcr, CFCR_DLAB | cfcr);
-
- dlbl = inb(comc_port + com_dlbl);
- dlbh = inb(comc_port + com_dlbh);
-
- outb(comc_port + com_cfcr, cfcr);
-
- divisor = dlbh << 8 | dlbl;
-
- /* XXX there should be more sanity checking. */
- if (divisor == 0)
- return (COMSPEED);
- return (COMC_DIV2BPS(divisor));
-}
diff --git a/sys/boot/pc98/libpc98/libpc98.h b/sys/boot/pc98/libpc98/libpc98.h
deleted file mode 100644
index 78b07a10ffa3..000000000000
--- a/sys/boot/pc98/libpc98/libpc98.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-
- * Copyright (c) 2009 TAKAHASHI Yoshihiro <nyan@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- *
- * $FreeBSD$
- */
-
-void set_machine_type(void);
diff --git a/sys/boot/pc98/libpc98/pc98_sys.c b/sys/boot/pc98/libpc98/pc98_sys.c
deleted file mode 100644
index 7f66d02c630f..000000000000
--- a/sys/boot/pc98/libpc98/pc98_sys.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * Copyright (c) 2009 TAKAHASHI Yoshihiro <nyan@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- *
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <btxv86.h>
-#include <machine/cpufunc.h>
-#define _KERNEL
-#include <pc98/pc98/pc98_machdep.h>
-
-/*
- * Set machine type to PC98_SYSTEM_PARAMETER.
- */
-void
-set_machine_type(void)
-{
- int i;
- u_long ret, data;
-
- /* PC98_SYSTEM_PARAMETER (0x501) */
- ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3;
-
- /* Wait V-SYNC */
- while (inb(0x60) & 0x20) {}
- while (!(inb(0x60) & 0x20)) {}
-
- /* ANK 'A' font */
- outb(0xa1, 0x00);
- outb(0xa3, 0x41);
-
- /* M_NORMAL, use CG window (all NEC OK) */
- for (i = data = 0; i < 4; i++)
- data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */
- if (data == 0x6efc58fc) /* DA data */
- ret |= M_NEC_PC98;
- else
- ret |= M_EPSON_PC98;
- ret |= (inb(0x42) & 0x20) ? M_8M : 0;
-
- /* PC98_SYSTEM_PARAMETER(0x400) */
- if ((*(u_char *)PTOV(0xA1400)) & 0x80)
- ret |= M_NOTE;
- if (ret & M_NEC_PC98) {
- /* PC98_SYSTEM_PARAMETER(0x458) */
- if ((*(u_char *)PTOV(0xA1458)) & 0x80)
- ret |= M_H98;
- else
- ret |= M_NOT_H98;
- } else
- ret |= M_NOT_H98;
-
- (*(u_long *)PTOV(0xA1620)) = ret;
-}
diff --git a/sys/boot/pc98/libpc98/time.c b/sys/boot/pc98/libpc98/time.c
deleted file mode 100644
index 5d832bb45b7e..000000000000
--- a/sys/boot/pc98/libpc98/time.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <btxv86.h>
-#include <machine/cpufunc.h>
-#include "bootstrap.h"
-#include "libi386.h"
-
-static int bios_seconds(void);
-
-/*
- * Return the BIOS time-of-day value.
- *
- * XXX uses undocumented BCD support from libstand.
- */
-static int
-bios_seconds(void)
-{
- int hr, minute, sec;
- unsigned char bios_time[6];
-
- v86.ctl = 0;
- v86.addr = 0x1c; /* int 0x1c, function 0 */
- v86.eax = 0x0000;
- v86.es = VTOPSEG(bios_time);
- v86.ebx = VTOPOFF(bios_time);
- v86int();
-
- hr = bcd2bin(bios_time[3]);
- minute = bcd2bin(bios_time[4]);
- sec = bcd2bin(bios_time[5]);
-
- return (hr * 3600 + minute * 60 + sec);
-}
-
-/*
- * Return the time in seconds since the beginning of the day.
- */
-time_t
-time(time_t *t)
-{
- static time_t lasttime;
- time_t now;
-
- now = bios_seconds();
-
- if (now < lasttime)
- now += 24 * 3600;
- lasttime = now;
-
- if (t != NULL)
- *t = now;
- return(now);
-}
-
-/*
- * Use the BIOS Wait function to pause for (period) microseconds.
- *
- * Resolution of this function is variable, but typically around
- * 1ms.
- */
-void
-delay(int period)
-{
- int i;
-
- period = (period + 500) / 1000;
- for( ; period != 0 ; period--)
- for(i=800;i != 0; i--)
- outb(0x5f,0); /* wait 600ns */
-}
diff --git a/sys/boot/pc98/libpc98/vidconsole.c b/sys/boot/pc98/libpc98/vidconsole.c
deleted file mode 100644
index 7cf81e81a371..000000000000
--- a/sys/boot/pc98/libpc98/vidconsole.c
+++ /dev/null
@@ -1,596 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith (msmith@freebsd.org)
- * Copyright (c) 1997 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- *
- * Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <bootstrap.h>
-#include <btxv86.h>
-#include <machine/cpufunc.h>
-#include "libi386.h"
-
-#if KEYBOARD_PROBE
-#include <machine/cpufunc.h>
-
-static int probe_keyboard(void);
-#endif
-static void vidc_probe(struct console *cp);
-static int vidc_init(int arg);
-static void vidc_putchar(int c);
-static int vidc_getchar(void);
-static int vidc_ischar(void);
-
-static int vidc_started;
-
-#ifdef TERM_EMU
-#define MAXARGS 8
-#define DEFAULT_FGCOLOR 7
-#define DEFAULT_BGCOLOR 0
-
-void end_term(void);
-void bail_out(int c);
-void vidc_term_emu(int c);
-void get_pos(void);
-void curs_move(int x, int y);
-void write_char(int c, int fg, int bg);
-void scroll_up(int rows, int fg, int bg);
-void CD(void);
-void CM(void);
-void HO(void);
-
-static int args[MAXARGS], argc;
-static int fg_c, bg_c, curx, cury;
-static int esc;
-#endif
-
-static unsigned short *crtat, *Crtat;
-static int row = 25, col = 80;
-#ifdef TERM_EMU
-static u_int8_t ibmpc_to_pc98[256] = {
- 0x01, 0x21, 0x81, 0xa1, 0x41, 0x61, 0xc1, 0xe1,
- 0x09, 0x29, 0x89, 0xa9, 0x49, 0x69, 0xc9, 0xe9,
- 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
- 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
- 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
- 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
- 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
- 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
- 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45,
- 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45,
- 0x65, 0x65, 0x65, 0x65, 0x65, 0x65, 0x65, 0x65,
- 0x65, 0x65, 0x65, 0x65, 0x65, 0x65, 0x65, 0x65,
- 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5,
- 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5,
- 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5,
- 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5,
-
- 0x03, 0x23, 0x83, 0xa3, 0x43, 0x63, 0xc3, 0xe3,
- 0x0b, 0x2b, 0x8b, 0xab, 0x4b, 0x6b, 0xcb, 0xeb,
- 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
- 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
- 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f,
- 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f,
- 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf,
- 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf,
- 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
- 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
- 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f,
- 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f,
- 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf,
- 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf,
- 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef,
- 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef,
-};
-#define at2pc98(fg_at, bg_at) ibmpc_to_pc98[((bg_at) << 4) | (fg_at)]
-#endif /* TERM_EMU */
-
-struct console vidconsole = {
- "vidconsole",
- "internal video/keyboard",
- 0,
- vidc_probe,
- vidc_init,
- vidc_putchar,
- vidc_getchar,
- vidc_ischar
-};
-
-static void
-vidc_probe(struct console *cp)
-{
-
- /* look for a keyboard */
-#if KEYBOARD_PROBE
- if (probe_keyboard())
-#endif
- {
-
- cp->c_flags |= C_PRESENTIN;
- }
-
- /* XXX for now, always assume we can do BIOS screen output */
- cp->c_flags |= C_PRESENTOUT;
-}
-
-static int
-vidc_init(int arg)
-{
- int i, hw_cursor;
-
- if (vidc_started && arg == 0)
- return (0);
- vidc_started = 1;
- Crtat = (unsigned short *)PTOV(0xA0000);
- while ((inb(0x60) & 0x04) == 0)
- ;
- outb(0x62, 0xe0);
- while ((inb(0x60) & 0x01) == 0)
- ;
- hw_cursor = inb(0x62);
- hw_cursor |= (inb(0x62) << 8);
- inb(0x62);
- inb(0x62);
- inb(0x62);
- crtat = Crtat + hw_cursor;
-#ifdef TERM_EMU
- /* Init terminal emulator */
- end_term();
- get_pos();
- curs_move(curx, cury);
- fg_c = DEFAULT_FGCOLOR;
- bg_c = DEFAULT_BGCOLOR;
-#endif
- for (i = 0; i < 10 && vidc_ischar(); i++)
- (void)vidc_getchar();
- return (0); /* XXX reinit? */
-}
-
-static void
-beep(void)
-{
-
- outb(0x37, 6);
- delay(40000);
- outb(0x37, 7);
-}
-
-#if 0
-static void
-vidc_biosputchar(int c)
-{
- unsigned short *cp;
- int i, pos;
-
-#ifdef TERM_EMU
- *crtat = (c == 0x5c ? 0xfc : c);
- *(crtat + 0x1000) = at2pc98(fg, bg);
-#else
- switch(c) {
- case '\b':
- crtat--;
- break;
- case '\r':
- crtat -= (crtat - Crtat) % col;
- break;
- case '\n':
- crtat += col;
- break;
- default:
- *crtat = (c == 0x5c ? 0xfc : c);
- *(crtat++ + 0x1000) = 0xe1;
- break;
- }
-
- if (crtat >= Crtat + col * row) {
- cp = Crtat;
- for (i = 1; i < row; i++) {
- bcopy((void *)(cp + col), (void *)cp, col * 2);
- cp += col;
- }
- for (i = 0; i < col; i++) {
- *cp++ = ' ';
- }
- crtat -= col;
- }
- pos = crtat - Crtat;
- while ((inb(0x60) & 0x04) == 0) {}
- outb(0x62, 0x49);
- outb(0x60, pos & 0xff);
- outb(0x60, pos >> 8);
-#endif
-}
-#endif
-
-static void
-vidc_rawputchar(int c)
-{
- int i;
-
- if (c == '\t')
- /* lame tab expansion */
- for (i = 0; i < 8; i++)
- vidc_rawputchar(' ');
- else {
- /* Emulate AH=0eh (teletype output) */
- switch(c) {
- case '\a':
- beep();
- return;
- case '\r':
- curx = 0;
- curs_move(curx, cury);
- return;
- case '\n':
- cury++;
- if (cury > 24) {
- scroll_up(1, fg_c, bg_c);
- cury--;
- } else {
- curs_move(curx, cury);
- }
- return;
- case '\b':
- if (curx > 0) {
- curx--;
- curs_move(curx, cury);
- /* write_char(' ', fg_c, bg_c); XXX destructive(!) */
- return;
- }
- return;
- default:
- write_char(c, fg_c, bg_c);
- curx++;
- if (curx > 79) {
- curx = 0;
- cury++;
- }
- if (cury > 24) {
- curx = 0;
- scroll_up(1, fg_c, bg_c);
- cury--;
- }
- }
- curs_move(curx, cury);
- }
-}
-
-#ifdef TERM_EMU
-
-/* Get cursor position on the screen. Result is in edx. Sets
- * curx and cury appropriately.
- */
-void
-get_pos(void)
-{
- int pos = crtat - Crtat;
-
- curx = pos % col;
- cury = pos / col;
-}
-
-/* Move cursor to x rows and y cols (0-based). */
-void
-curs_move(int x, int y)
-{
- int pos;
-
- pos = x + y * col;
- crtat = Crtat + pos;
- pos = crtat - Crtat;
- while((inb(0x60) & 0x04) == 0) {}
- outb(0x62, 0x49);
- outb(0x60, pos & 0xff);
- outb(0x60, pos >> 8);
- curx = x;
- cury = y;
-#define isvisible(c) (((c) >= 32) && ((c) < 255))
- if (!isvisible(*crtat & 0x00ff)) {
- write_char(' ', fg_c, bg_c);
- }
-}
-
-/* Scroll up the whole window by a number of rows. If rows==0,
- * clear the window. fg and bg are attributes for the new lines
- * inserted in the window.
- */
-void
-scroll_up(int rows, int fgcol, int bgcol)
-{
- unsigned short *cp;
- int i;
-
- if (rows == 0)
- rows = 25;
- cp = Crtat;
- for (i = rows; i < row; i++) {
- bcopy((void *)(cp + col), (void *)cp, col * 2);
- cp += col;
- }
- for (i = 0; i < col; i++) {
- *(cp + 0x1000) = at2pc98(fgcol, bgcol);
- *cp++ = ' ';
- }
-}
-
-/* Write character and attribute at cursor position. */
-void
-write_char(int c, int fgcol, int bgcol)
-{
-
- *crtat = (c == 0x5c ? 0xfc : (c & 0xff));
- *(crtat + 0x1000) = at2pc98(fgcol, bgcol);
-}
-
-/**************************************************************/
-/*
- * Screen manipulation functions. They use accumulated data in
- * args[] and argc variables.
- *
- */
-
-/* Clear display from current position to end of screen */
-void
-CD(void)
-{
- int pos;
-
- get_pos();
- for (pos = 0; crtat + pos <= Crtat + col * row; pos++) {
- *(crtat + pos) = ' ';
- *(crtat + pos + 0x1000) = at2pc98(fg_c, bg_c);
- }
- end_term();
-}
-
-/* Absolute cursor move to args[0] rows and args[1] columns
- * (the coordinates are 1-based).
- */
-void
-CM(void)
-{
-
- if (args[0] > 0)
- args[0]--;
- if (args[1] > 0)
- args[1]--;
- curs_move(args[1], args[0]);
- end_term();
-}
-
-/* Home cursor (left top corner) */
-void
-HO(void)
-{
-
- argc = 1;
- args[0] = args[1] = 1;
- CM();
-}
-
-/* Clear internal state of the terminal emulation code */
-void
-end_term(void)
-{
-
- esc = 0;
- argc = -1;
-}
-
-/* Gracefully exit ESC-sequence processing in case of misunderstanding */
-void
-bail_out(int c)
-{
- char buf[16], *ch;
- int i;
-
- if (esc) {
- vidc_rawputchar('\033');
- if (esc != '\033')
- vidc_rawputchar(esc);
- for (i = 0; i <= argc; ++i) {
- sprintf(buf, "%d", args[i]);
- ch = buf;
- while (*ch)
- vidc_rawputchar(*ch++);
- }
- }
- vidc_rawputchar(c);
- end_term();
-}
-
-static void
-get_arg(int c)
-{
-
- if (argc < 0)
- argc = 0;
- args[argc] *= 10;
- args[argc] += c - '0';
-}
-
-/* Emulate basic capabilities of cons25 terminal */
-void
-vidc_term_emu(int c)
-{
- static int ansi_col[] = {
- 0, 4, 2, 6, 1, 5, 3, 7,
- };
- int t;
- int i;
-
- switch (esc) {
- case 0:
- switch (c) {
- case '\033':
- esc = c;
- break;
- default:
- vidc_rawputchar(c);
- break;
- }
- break;
-
- case '\033':
- switch (c) {
- case '[':
- esc = c;
- args[0] = 0;
- argc = -1;
- break;
- default:
- bail_out(c);
- break;
- }
- break;
-
- case '[':
- switch (c) {
- case ';':
- if (argc < 0) /* XXX */
- argc = 0;
- else if (argc + 1 >= MAXARGS)
- bail_out(c);
- else
- args[++argc] = 0;
- break;
- case 'H':
- if (argc < 0)
- HO();
- else if (argc == 1)
- CM();
- else
- bail_out(c);
- break;
- case 'J':
- if (argc < 0)
- CD();
- else
- bail_out(c);
- break;
- case 'm':
- if (argc < 0) {
- fg_c = DEFAULT_FGCOLOR;
- bg_c = DEFAULT_BGCOLOR;
- }
- for (i = 0; i <= argc; ++i) {
- switch (args[i]) {
- case 0: /* back to normal */
- fg_c = DEFAULT_FGCOLOR;
- bg_c = DEFAULT_BGCOLOR;
- break;
- case 1: /* bold */
- fg_c |= 0x8;
- break;
- case 4: /* underline */
- case 5: /* blink */
- bg_c |= 0x8;
- break;
- case 7: /* reverse */
- t = fg_c;
- fg_c = bg_c;
- bg_c = t;
- break;
- case 30: case 31: case 32: case 33:
- case 34: case 35: case 36: case 37:
- fg_c = ansi_col[args[i] - 30];
- break;
- case 39: /* normal */
- fg_c = DEFAULT_FGCOLOR;
- break;
- case 40: case 41: case 42: case 43:
- case 44: case 45: case 46: case 47:
- bg_c = ansi_col[args[i] - 40];
- break;
- case 49: /* normal */
- bg_c = DEFAULT_BGCOLOR;
- break;
- }
- }
- end_term();
- break;
- default:
- if (isdigit(c))
- get_arg(c);
- else
- bail_out(c);
- break;
- }
- break;
-
- default:
- bail_out(c);
- break;
- }
-}
-#endif
-
-static void
-vidc_putchar(int c)
-{
-#ifdef TERM_EMU
- vidc_term_emu(c);
-#else
- vidc_rawputchar(c);
-#endif
-}
-
-static int
-vidc_getchar(void)
-{
-
- if (vidc_ischar()) {
- v86.ctl = 0;
- v86.addr = 0x18;
- v86.eax = 0x0;
- v86int();
- return (v86.eax & 0xff);
- } else {
- return (-1);
- }
-}
-
-static int
-vidc_ischar(void)
-{
-
- v86.ctl = 0;
- v86.addr = 0x18;
- v86.eax = 0x100;
- v86int();
- return ((v86.ebx >> 8) & 0x1);
-}
-
-#if KEYBOARD_PROBE
-static int
-probe_keyboard(void)
-{
- return (*(u_char *)PTOV(0xA1481) & 0x48);
-}
-#endif /* KEYBOARD_PROBE */
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
deleted file mode 100644
index d75e8d04e284..000000000000
--- a/sys/boot/pc98/loader/Makefile
+++ /dev/null
@@ -1,99 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-MK_SSP= no
-MAN=
-
-LOADER?= loader
-PROG= ${LOADER}.sym
-INTERNALPROG=
-NEWVERSWHAT= "bootstrap loader" pc98
-VERSION_FILE= ${.CURDIR}/../../i386/loader/version
-
-# architecture-specific loader code
-SRCS= main.c conf.c vers.c
-.PATH: ${.CURDIR}/../../i386/loader
-
-# Enable PXE TFTP or NFS support, not both.
-.if defined(LOADER_TFTP_SUPPORT)
-CFLAGS+= -DLOADER_TFTP_SUPPORT
-.else
-CFLAGS+= -DLOADER_NFS_SUPPORT
-.endif
-
-# Include bcache code.
-HAVE_BCACHE= yes
-
-# Enable PnP and ISA-PnP code.
-HAVE_PNP= yes
-HAVE_ISABUS= yes
-
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
-.if defined(LOADER_BZIP2_SUPPORT)
-CFLAGS+= -DLOADER_BZIP2_SUPPORT
-.endif
-.if !defined(LOADER_NO_GZIP_SUPPORT)
-CFLAGS+= -DLOADER_GZIP_SUPPORT
-.endif
-
-# Always add MI sources
-.PATH: ${.CURDIR}/../../common
-.include "${.CURDIR}/../../common/Makefile.inc"
-CFLAGS+= -I${.CURDIR}/../../common
-CFLAGS+= -I${.CURDIR}/../../i386
-CFLAGS+= -I.
-
-CLEANFILES= ${LOADER} ${LOADER}.bin loader.help
-
-CFLAGS+= -Wall
-LDFLAGS= -static -Ttext 0x0
-
-# pc98 standalone support library
-LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
-CFLAGS+= -I${.CURDIR}/..
-
-LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
-
-# BTX components
-CFLAGS+= -I${.CURDIR}/../btx/lib
-
-# Debug me!
-#CFLAGS+= -g
-#LDFLAGS+= -g
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
-
-${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
- btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
- -b ${BTXKERN} ${LOADER}.bin
-
-${LOADER}.bin: ${LOADER}.sym
- cp ${.ALLSRC} ${.TARGET}
- strip -R .comment -R .note ${.TARGET}
-
-loader.help: help.common help.pc98
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-FILES= ${LOADER}
-# XXX INSTALLFLAGS_loader= -b
-FILESMODE_${LOADER}= ${BINMODE} -b
-
-.PATH: ${.CURDIR}/../../forth
-.include "${.CURDIR}/../../forth/Makefile.inc"
-
-FILES+= ${.CURDIR}/../../i386/loader/loader.rc menu.rc
-
-# XXX crt0.o needs to be first for pxeboot(8) to work
-OBJS= ${BTXCRT}
-
-DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND}
-LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND}
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/loader/conf.c b/sys/boot/pc98/loader/conf.c
deleted file mode 100644
index 695c2604c03a..000000000000
--- a/sys/boot/pc98/loader/conf.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <bootstrap.h>
-#include "libi386/libi386.h"
-
-/*
- * We could use linker sets for some or all of these, but
- * then we would have to control what ended up linked into
- * the bootstrap. So it's easier to conditionalise things
- * here.
- *
- * XXX rename these arrays to be consistent and less namespace-hostile
- *
- * XXX as libi386 and biosboot merge, some of these can become linker sets.
- */
-
-/* Exported for libstand */
-struct devsw *devsw[] = {
- &bioscd,
- &biosdisk,
-#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
- &pxedisk,
-#endif
- NULL
-};
-
-struct fs_ops *file_system[] = {
- &ufs_fsops,
- &ext2fs_fsops,
- &dosfs_fsops,
- &cd9660_fsops,
-#ifdef LOADER_NFS_SUPPORT
- &nfs_fsops,
-#endif
-#ifdef LOADER_TFTP_SUPPORT
- &tftp_fsops,
-#endif
-#ifdef LOADER_GZIP_SUPPORT
- &gzipfs_fsops,
-#endif
-#ifdef LOADER_BZIP2_SUPPORT
- &bzipfs_fsops,
-#endif
- &splitfs_fsops,
- NULL
-};
-
-/* Exported for i386 only */
-/*
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format i386_elf;
-extern struct file_format i386_elf_obj;
-
-struct file_format *file_formats[] = {
- &i386_elf,
- &i386_elf_obj,
- NULL
-};
-
-/*
- * Consoles
- *
- * We don't prototype these in libi386.h because they require
- * data structures from bootstrap.h as well.
- */
-extern struct console vidconsole;
-extern struct console comconsole;
-extern struct console nullconsole;
-
-struct console *consoles[] = {
- &vidconsole,
- &comconsole,
- &nullconsole,
- NULL
-};
-
-extern struct pnphandler isapnphandler;
-extern struct pnphandler biospnphandler;
-extern struct pnphandler biospcihandler;
-
-struct pnphandler *pnphandlers[] = {
- &biospnphandler, /* should go first, as it may set isapnp_readport */
- &isapnphandler,
- &biospcihandler,
- NULL
-};
diff --git a/sys/boot/pc98/loader/help.pc98 b/sys/boot/pc98/loader/help.pc98
deleted file mode 100644
index 4b9197ce5074..000000000000
--- a/sys/boot/pc98/loader/help.pc98
+++ /dev/null
@@ -1,38 +0,0 @@
-################################################################################
-# Treboot DReboot the system
-
- reboot
-
- Causes the system to immediately reboot.
-
-################################################################################
-# Theap DDisplay memory management statistics
-
- heap
-
- Requests debugging output from the heap manager. For debugging use
- only.
-
-################################################################################
-# Tset Snum_ide_disks DSet the number of IDE disks
-
- NOTE: this variable is deprecated, use root_disk_unit instead.
-
- set num_ide_disks=<value>
-
- When booting from a SCSI disk on a system with one or more IDE disks,
- and where the IDE disks are the default boot device, it is necessary
- to tell the kernel how many IDE disks there are in order to have it
- correctly locate the SCSI disk you are booting from.
-
-################################################################################
-# Tset Sroot_disk_unit DForce the root disk unit number.
-
- set root_disk_unit=<value>
-
- If the code which detects the disk unit number for the root disk is
- confused, eg. by a mix of SCSI and IDE disks, or IDE disks with
- gaps in the sequence (eg. no primary slave), the unit number can be
- forced by setting this variable.
-
-################################################################################
diff --git a/sys/boot/pc98/loader/main.c b/sys/boot/pc98/loader/main.c
deleted file mode 100644
index c31cc842a035..000000000000
--- a/sys/boot/pc98/loader/main.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * MD bootstrap main() and assorted miscellaneous
- * commands.
- */
-
-#include <stand.h>
-#include <stddef.h>
-#include <string.h>
-#include <machine/bootinfo.h>
-#include <machine/cpufunc.h>
-#include <sys/param.h>
-#include <sys/reboot.h>
-
-#include "bootstrap.h"
-#include "common/bootargs.h"
-#include "libi386/libi386.h"
-#include "libpc98/libpc98.h"
-#include "btxv86.h"
-
-CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE);
-CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO);
-CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS);
-CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE);
-
-/* Arguments passed in from the boot1/boot2 loader */
-static struct bootargs *kargs;
-
-static u_int32_t initial_howto;
-static u_int32_t initial_bootdev;
-static struct bootinfo *initial_bootinfo;
-
-struct arch_switch archsw; /* MI/MD interface boundary */
-
-static void extract_currdev(void);
-static int isa_inb(int port);
-static void isa_outb(int port, int value);
-void exit(int code);
-
-/* from vers.c */
-extern char bootprog_info[];
-
-/* XXX debugging */
-extern char end[];
-
-static void *heap_top;
-static void *heap_bottom;
-
-static uint64_t
-pc98_loadaddr(u_int type, void *data, uint64_t addr)
-{
- struct stat st;
-
- if (type == LOAD_ELF)
- return (roundup(addr, PAGE_SIZE));
-
- /* We cannot use 15M-16M area on pc98. */
- if (type == LOAD_RAW && addr < 0x1000000 && stat(data, &st) == 0 &&
- (st.st_size == -1 || addr + st.st_size > 0xf00000))
- addr = 0x1000000;
- return (addr);
-}
-
-int
-main(void)
-{
- int i;
-
- /* Set machine type to PC98_SYSTEM_PARAMETER. */
- set_machine_type();
-
- /* Pick up arguments */
- kargs = (void *)__args;
- initial_howto = kargs->howto;
- initial_bootdev = kargs->bootdev;
- initial_bootinfo = kargs->bootinfo ? (struct bootinfo *)PTOV(kargs->bootinfo) : NULL;
-
- /* Initialize the v86 register set to a known-good state. */
- bzero(&v86, sizeof(v86));
- v86.efl = PSL_RESERVED_DEFAULT | PSL_I;
-
- /*
- * Initialise the heap as early as possible. Once this is done, malloc() is usable.
- */
- bios_getmem();
-
-#if defined(LOADER_BZIP2_SUPPORT)
- if (high_heap_size > 0) {
- heap_top = PTOV(high_heap_base + high_heap_size);
- heap_bottom = PTOV(high_heap_base);
- if (high_heap_base < memtop_copyin)
- memtop_copyin = high_heap_base;
- } else
-#endif
- {
- heap_top = (void *)PTOV(bios_basemem);
- heap_bottom = (void *)end;
- }
- setheap(heap_bottom, heap_top);
-
- /*
- * XXX Chicken-and-egg problem; we want to have console output early, but some
- * console attributes may depend on reading from eg. the boot device, which we
- * can't do yet.
- *
- * We can use printf() etc. once this is done.
- * If the previous boot stage has requested a serial console, prefer that.
- */
- bi_setboothowto(initial_howto);
- if (initial_howto & RB_MULTIPLE) {
- if (initial_howto & RB_SERIAL)
- setenv("console", "comconsole vidconsole", 1);
- else
- setenv("console", "vidconsole comconsole", 1);
- } else if (initial_howto & RB_SERIAL)
- setenv("console", "comconsole", 1);
- else if (initial_howto & RB_MUTE)
- setenv("console", "nullconsole", 1);
- cons_probe();
-
- /*
- * Initialise the block cache. Set the upper limit.
- */
- bcache_init(32768, 512);
-
- /*
- * Special handling for PXE and CD booting.
- */
- if (kargs->bootinfo == 0) {
- /*
- * We only want the PXE disk to try to init itself in the below
- * walk through devsw if we actually booted off of PXE.
- */
- if (kargs->bootflags & KARGS_FLAGS_PXE)
- pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL);
- else if (kargs->bootflags & KARGS_FLAGS_CD)
- bc_add(initial_bootdev);
- }
-
- archsw.arch_autoload = i386_autoload;
- archsw.arch_getdev = i386_getdev;
- archsw.arch_copyin = i386_copyin;
- archsw.arch_copyout = i386_copyout;
- archsw.arch_readin = i386_readin;
- archsw.arch_isainb = isa_inb;
- archsw.arch_isaoutb = isa_outb;
- archsw.arch_loadaddr = pc98_loadaddr;
-
- /*
- * March through the device switch probing for things.
- */
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
- printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024);
- if (initial_bootinfo != NULL) {
- initial_bootinfo->bi_basemem = bios_basemem / 1024;
- initial_bootinfo->bi_extmem = bios_extmem / 1024;
- }
-
- printf("\n%s", bootprog_info);
-
- extract_currdev(); /* set $currdev and $loaddev */
- setenv("LINES", "24", 1); /* optional */
-
- interact(NULL); /* doesn't return */
-
- /* if we ever get here, it is an error */
- return (1);
-}
-
-/*
- * Set the 'current device' by (if possible) recovering the boot device as
- * supplied by the initial bootstrap.
- *
- * XXX should be extended for netbooting.
- */
-static void
-extract_currdev(void)
-{
- struct i386_devdesc new_currdev;
- int major;
- int biosdev = -1;
-
- /* Assume we are booting from a BIOS disk by default */
- new_currdev.d_dev = &biosdisk;
-
- /* new-style boot loaders such as pxeldr and cdldr */
- if (kargs->bootinfo == 0) {
- if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) {
- /* we are booting from a CD with cdboot */
- new_currdev.d_dev = &bioscd;
- new_currdev.d_unit = bc_bios2unit(initial_bootdev);
- } else if ((kargs->bootflags & KARGS_FLAGS_PXE) != 0) {
- /* we are booting from pxeldr */
- new_currdev.d_dev = &pxedisk;
- new_currdev.d_unit = 0;
- } else {
- /* we don't know what our boot device is */
- new_currdev.d_kind.biosdisk.slice = -1;
- new_currdev.d_kind.biosdisk.partition = 0;
- biosdev = -1;
- }
- } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) {
- /* The passed-in boot device is bad */
- new_currdev.d_kind.biosdisk.slice = -1;
- new_currdev.d_kind.biosdisk.partition = 0;
- biosdev = -1;
- } else {
- new_currdev.d_kind.biosdisk.slice = B_SLICE(initial_bootdev) - 1;
- new_currdev.d_kind.biosdisk.partition = B_PARTITION(initial_bootdev);
- biosdev = initial_bootinfo->bi_bios_dev;
- major = B_TYPE(initial_bootdev);
-
- /*
- * If we are booted by an old bootstrap, we have to guess at the BIOS
- * unit number. We will lose if there is more than one disk type
- * and we are not booting from the lowest-numbered disk type
- * (ie. SCSI when IDE also exists).
- */
- if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) { /* biosdev doesn't match major */
- if (B_TYPE(initial_bootdev) == 6)
- biosdev = 0x30 + B_UNIT(initial_bootdev);
- else
- biosdev = (major << 3) + 0x80 + B_UNIT(initial_bootdev);
- }
- }
- new_currdev.d_type = new_currdev.d_dev->dv_type;
-
- /*
- * If we are booting off of a BIOS disk and we didn't succeed in determining
- * which one we booted off of, just use disk0: as a reasonable default.
- */
- if ((new_currdev.d_type == biosdisk.dv_type) &&
- ((new_currdev.d_unit = bd_bios2unit(biosdev)) == -1)) {
- printf("Can't work out which disk we are booting from.\n"
- "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev);
- new_currdev.d_unit = 0;
- }
-
- env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
- i386_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset,
- env_nounset);
-}
-
-COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
-
-static int
-command_reboot(int argc, char *argv[])
-{
- int i;
-
- for (i = 0; devsw[i] != NULL; ++i)
- if (devsw[i]->dv_cleanup != NULL)
- (devsw[i]->dv_cleanup)();
-
- printf("Rebooting...\n");
- delay(1000000);
- __exit(0);
-}
-
-/* provide this for panic, as it's not in the startup code */
-void
-exit(int code)
-{
- __exit(code);
-}
-
-COMMAND_SET(heap, "heap", "show heap usage", command_heap);
-
-static int
-command_heap(int argc, char *argv[])
-{
- mallocstats();
- printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom,
- sbrk(0), heap_top);
- return(CMD_OK);
-}
-
-/* ISA bus access functions for PnP. */
-static int
-isa_inb(int port)
-{
-
- return (inb(port));
-}
-
-static void
-isa_outb(int port, int value)
-{
-
- outb(port, value);
-}
diff --git a/sys/boot/pc98/pc98boot/Makefile b/sys/boot/pc98/pc98boot/Makefile
deleted file mode 100644
index f33b15f5db84..000000000000
--- a/sys/boot/pc98/pc98boot/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# $FreeBSD$
-
-FILES= ${BOOT}
-CLEANFILES= ${BOOT} ${BOOT}.part
-
-BOOT= pc98boot
-
-.if exists(${.OBJDIR}/../boot0)
-BOOT0= ${.OBJDIR}/../boot0/boot0
-.else
-BOOT0= ${.CURDIR}/../boot0/boot0
-.endif
-.if exists(${.OBJDIR}/../boot0.5)
-BOOT05= ${.OBJDIR}/../boot0.5/boot0.5
-.else
-BOOT05= ${.CURDIR}/../boot0.5/boot0.5
-.endif
-
-${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part
- cat ${BOOT0} ${BOOT}.part ${BOOT05} > ${.TARGET}
-
-${BOOT}.part:
- ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1
-
-.include <bsd.prog.mk>
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index f6cab5b81124..ff08560e6428 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -2585,15 +2585,8 @@ xpt_action_default(union ccb *start_ccb)
start_ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
-#if defined(PC98) || defined(__sparc64__)
+#if defined(__sparc64__)
/*
- * In a PC-98 system, geometry translation depens on
- * the "real" device geometry obtained from mode page 4.
- * SCSI geometry translation is performed in the
- * initialization routine of the SCSI BIOS and the result
- * stored in host memory. If the translation is available
- * in host memory, use it. If not, rely on the default
- * translation the device driver performs.
* For sparc64, we may need adjust the geometry of large
* disks in order to fit the limitations of the 16-bit
* fields of the VTOC8 disk label.
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98
deleted file mode 100644
index 1bd5bae805f7..000000000000
--- a/sys/conf/Makefile.pc98
+++ /dev/null
@@ -1,52 +0,0 @@
-# Makefile for FreeBSD(98) after:
-#
-# Makefile.i386 -- with config changes.
-# Copyright 1990 W. Jolitz
-# from: @(#)Makefile.i386 7.1 5/10/91
-# $FreeBSD$
-#
-# Makefile for FreeBSD
-#
-# This makefile is constructed from a machine description:
-# config machineid
-# Most changes should be made in the machine description
-# /sys/pc98/conf/``machineid''
-# after which you should do
-# config machineid
-# Generic makefile changes should be made in
-# /sys/conf/Makefile.pc98
-# after which config should be rerun for all machines.
-#
-
-# Which version of config(8) is required.
-%VERSREQ= 600012
-
-.if !defined(S)
-.if exists(./@/.)
-S= ./@
-.else
-S= ../../..
-.endif
-.endif
-
-LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH}
-
-.include "$S/conf/kern.pre.mk"
-
-ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS34}
-
-%BEFORE_DEPEND
-
-%OBJS
-
-%FILES.c
-
-%FILES.s
-
-%FILES.m
-
-%CLEAN
-
-%RULES
-
-.include "$S/conf/kern.post.mk"
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index c8ac5de69ae5..ed8566acacea 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -169,9 +169,7 @@ options GEOM_PART_EBR_COMPAT # Backward compatible partition names
options GEOM_PART_GPT # GPT partitioning
options GEOM_PART_LDM # Logical Disk Manager
options GEOM_PART_MBR # MBR partitioning
-options GEOM_PART_PC98 # PC-9800 disk partitioning
options GEOM_PART_VTOC8 # SMI VTOC8 disk label
-options GEOM_PC98 # NEC PC9800 partitioning
options GEOM_RAID # Soft RAID functionality.
options GEOM_RAID3 # RAID3 functionality.
options GEOM_SHSEC # Shared secret.
@@ -1535,7 +1533,7 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)
# ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/
# 19160x/29160x, aic7770/aic78xx
# ahd: Adaptec 29320/39320 Controllers.
-# aic: Adaptec 6260/6360, APA-1460 (PC Card), NEC PC9801-100 (C-BUS)
+# aic: Adaptec 6260/6360, APA-1460 (PC Card)
# bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x,
# BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F
# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers
@@ -1759,7 +1757,6 @@ device ata
# Modular ATA
#device atacore # Core ATA functionality
#device atacard # CARDBUS support
-#device atabus # PC98 cbus support
#device ataisa # ISA bus support
#device atapci # PCI bus support; only generic chipset support
@@ -2838,7 +2835,7 @@ options U3G_DEBUG
# options for ukbd:
options UKBD_DFLT_KEYMAP # specify the built-in keymap
-makeoptions UKBD_DFLT_KEYMAP=jp.pc98
+makeoptions UKBD_DFLT_KEYMAP=jp
# options for uplcom:
options UPLCOM_INTR_INTERVAL=100 # interrupt pipe interval
diff --git a/sys/conf/config.mk b/sys/conf/config.mk
index 50294961ca12..c519980d088e 100644
--- a/sys/conf/config.mk
+++ b/sys/conf/config.mk
@@ -38,7 +38,6 @@ opt_wlan.h:
echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET}
echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
KERN_OPTS.i386=NEW_PCIB DEV_PCI
-KERN_OPTS.pc98=NEW_PCIB DEV_PCI
KERN_OPTS.amd64=NEW_PCIB DEV_PCI
KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
KERN_OPTS=MROUTING NATM IEEE80211_DEBUG \
diff --git a/sys/conf/files b/sys/conf/files
index 3f01e9d4eee6..a6eee9547178 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -789,7 +789,6 @@ dev/ata/ata-dma.c optional ata | atacore
dev/ata/ata-lowlevel.c optional ata | atacore
dev/ata/ata-sata.c optional ata | atacore
dev/ata/ata-card.c optional ata pccard | atapccard
-dev/ata/ata-cbus.c optional ata pc98 | atapc98
dev/ata/ata-isa.c optional ata isa | ataisa
dev/ata/ata-pci.c optional ata pci | atapci
dev/ata/chipsets/ata-acard.c optional ata pci | ataacard
@@ -3458,8 +3457,6 @@ geom/geom_kern.c standard
geom/geom_map.c optional geom_map
geom/geom_mbr.c optional geom_mbr
geom/geom_mbr_enc.c optional geom_mbr
-geom/geom_pc98.c optional geom_pc98
-geom/geom_pc98_enc.c optional geom_pc98
geom/geom_redboot.c optional geom_redboot
geom/geom_slice.c standard
geom/geom_subr.c standard
@@ -3493,7 +3490,6 @@ geom/part/g_part_ebr.c optional geom_part_ebr
geom/part/g_part_gpt.c optional geom_part_gpt
geom/part/g_part_ldm.c optional geom_part_ldm
geom/part/g_part_mbr.c optional geom_part_mbr
-geom/part/g_part_pc98.c optional geom_part_pc98
geom/part/g_part_vtoc8.c optional geom_part_vtoc8
geom/raid/g_raid.c optional geom_raid
geom/raid/g_raid_ctl.c optional geom_raid
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index bb6d2db54e20..a2a68a19cb01 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -606,7 +606,7 @@ contrib/x86emu/x86emu.c optional x86bios | dpms | pci | vesa
dev/bvm/bvm_console.c optional bvmconsole
dev/bvm/bvm_dbg.c optional bvmdebug
#
-# x86 shared code between IA32, AMD64 and PC98 architectures
+# x86 shared code between IA32 and AMD64 architectures
#
x86/acpica/OsdEnvironment.c optional acpi
x86/acpica/acpi_apm.c optional acpi
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 1add0b800871..c0b75d7e1894 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -578,7 +578,7 @@ compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa
dev/bvm/bvm_console.c optional bvmconsole
dev/bvm/bvm_dbg.c optional bvmdebug
#
-# x86 shared code between IA32, AMD64 and PC98 architectures
+# x86 shared code between IA32 and AMD64 architectures
#
x86/acpica/OsdEnvironment.c optional acpi
x86/acpica/acpi_apm.c optional acpi
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
deleted file mode 100644
index 8a7dc98689e5..000000000000
--- a/sys/conf/files.pc98
+++ /dev/null
@@ -1,279 +0,0 @@
-# This file tells config what files go into building a kernel,
-# files marked standard are always included.
-#
-# modified for PC-9801/PC-9821
-#
-# $FreeBSD$
-#
-# The long compile-with and dependency lines are required because of
-# limitations in config: backslash-newline doesn't work in strings, and
-# dependency lines other than the first are silently ignored.
-#
-linux_genassym.o optional compat_linux \
- dependency "$S/i386/linux/linux_genassym.c" \
- compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \
- no-obj no-implicit-rule \
- clean "linux_genassym.o"
-#
-linux_assym.h optional compat_linux \
- dependency "$S/kern/genassym.sh linux_genassym.o" \
- compile-with "sh $S/kern/genassym.sh linux_genassym.o > ${.TARGET}" \
- no-obj no-implicit-rule before-depend \
- clean "linux_assym.h"
-#
-linux_locore.o optional compat_linux \
- dependency "linux_assym.h $S/i386/linux/linux_locore.s" \
- compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
- no-obj no-implicit-rule \
- clean "linux_locore.o"
-#
-linux_vdso.so optional compat_linux \
- dependency "linux_locore.o" \
- compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \
- no-implicit-rule \
- clean "linux_vdso.so"
-#
-svr4_genassym.o optional compat_svr4 \
- dependency "$S/i386/svr4/svr4_genassym.c" \
- compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \
- no-obj no-implicit-rule \
- clean "svr4_genassym.o"
-#
-svr4_assym.h optional compat_svr4 \
- dependency "$S/kern/genassym.sh svr4_genassym.o" \
- compile-with "sh $S/kern/genassym.sh svr4_genassym.o > ${.TARGET}" \
- no-obj no-implicit-rule before-depend \
- clean "svr4_assym.h"
-#
-ukbdmap.h optional ukbd_dflt_keymap \
- compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \
- no-obj no-implicit-rule before-depend \
- clean "ukbdmap.h"
-#
-cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
-compat/linprocfs/linprocfs.c optional linprocfs
-compat/linsysfs/linsysfs.c optional linsysfs
-compat/linux/linux_event.c optional compat_linux
-compat/linux/linux_emul.c optional compat_linux
-compat/linux/linux_file.c optional compat_linux
-compat/linux/linux_fork.c optional compat_linux
-compat/linux/linux_futex.c optional compat_linux
-compat/linux/linux_getcwd.c optional compat_linux
-compat/linux/linux_ioctl.c optional compat_linux
-compat/linux/linux_ipc.c optional compat_linux
-compat/linux/linux_mib.c optional compat_linux
-compat/linux/linux_misc.c optional compat_linux
-compat/linux/linux_mmap.c optional compat_linux
-compat/linux/linux_signal.c optional compat_linux
-compat/linux/linux_socket.c optional compat_linux
-compat/linux/linux_stats.c optional compat_linux
-compat/linux/linux_sysctl.c optional compat_linux
-compat/linux/linux_time.c optional compat_linux
-compat/linux/linux_timer.c optional compat_linux
-compat/linux/linux_uid16.c optional compat_linux
-compat/linux/linux_util.c optional compat_linux
-compat/linux/linux_vdso.c optional compat_linux
-compat/linux/linux.c optional compat_linux
-compat/svr4/imgact_svr4.c optional compat_svr4
-compat/svr4/svr4_fcntl.c optional compat_svr4
-compat/svr4/svr4_filio.c optional compat_svr4
-compat/svr4/svr4_ioctl.c optional compat_svr4
-compat/svr4/svr4_ipc.c optional compat_svr4
-compat/svr4/svr4_misc.c optional compat_svr4
-compat/svr4/svr4_resource.c optional compat_svr4
-compat/svr4/svr4_signal.c optional compat_svr4
-compat/svr4/svr4_socket.c optional compat_svr4
-compat/svr4/svr4_sockio.c optional compat_svr4
-compat/svr4/svr4_stat.c optional compat_svr4
-compat/svr4/svr4_stream.c optional compat_svr4
-compat/svr4/svr4_syscallnames.c optional compat_svr4
-compat/svr4/svr4_sysent.c optional compat_svr4
-compat/svr4/svr4_sysvec.c optional compat_svr4
-compat/svr4/svr4_termios.c optional compat_svr4
-bf_enc.o optional crypto | ipsec \
- dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \
- compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
- no-implicit-rule
-crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb
-dev/agp/agp_ali.c optional agp
-dev/agp/agp_amd.c optional agp
-dev/agp/agp_i810.c optional agp
-dev/agp/agp_intel.c optional agp
-dev/agp/agp_nvidia.c optional agp
-dev/agp/agp_sis.c optional agp
-dev/agp/agp_via.c optional agp
-dev/aic/aic_cbus.c optional aic isa
-dev/ce/ceddk.c optional ce
-dev/ce/if_ce.c optional ce
-dev/ce/tau32-ddk.c optional ce \
- compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"
-dev/cp/cpddk.c optional cp
-dev/cp/if_cp.c optional cp
-dev/ct/bshw_machdep.c optional ct
-dev/ct/ct.c optional ct
-dev/ct/ct_isa.c optional ct isa
-dev/ed/if_ed_cbus.c optional ed isa
-dev/ed/if_ed_wd80x3.c optional ed isa
-dev/fb/fb.c optional fb | gdc
-dev/fdc/fdc.c optional fdc
-dev/fdc/fdc_cbus.c optional fdc isa
-dev/fe/if_fe_cbus.c optional fe isa
-dev/hwpmc/hwpmc_amd.c optional hwpmc
-dev/hwpmc/hwpmc_intel.c optional hwpmc
-dev/hwpmc/hwpmc_core.c optional hwpmc
-dev/hwpmc/hwpmc_uncore.c optional hwpmc
-dev/hwpmc/hwpmc_pentium.c optional hwpmc
-dev/hwpmc/hwpmc_piv.c optional hwpmc
-dev/hwpmc/hwpmc_ppro.c optional hwpmc
-dev/hwpmc/hwpmc_tsc.c optional hwpmc
-dev/hwpmc/hwpmc_x86.c optional hwpmc
-dev/io/iodev.c optional io
-dev/le/if_le_cbus.c optional le isa
-dev/mse/mse.c optional mse
-dev/mse/mse_cbus.c optional mse isa
-dev/sbni/if_sbni.c optional sbni
-dev/sbni/if_sbni_pci.c optional sbni pci
-dev/sio/sio_pccard.c optional sio pccard
-dev/sio/sio_pci.c optional sio pci
-dev/sio/sio_puc.c optional sio puc
-dev/snc/dp83932.c optional snc
-dev/snc/dp83932subr.c optional snc
-dev/snc/if_snc.c optional snc
-dev/snc/if_snc_cbus.c optional snc isa
-dev/snc/if_snc_pccard.c optional snc pccard
-dev/speaker/spkr.c optional speaker
-dev/syscons/apm/apm_saver.c optional apm_saver apm
-dev/uart/uart_cpu_pc98.c optional uart
-i386/bios/apm.c optional apm
-#i386/i386/apic_vector.s optional apic
-i386/i386/atomic.c standard \
- compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
-i386/i386/bios.c standard
-i386/i386/bioscall.s standard
-i386/i386/bpf_jit_machdep.c optional bpf_jitter
-i386/i386/db_disasm.c optional ddb
-i386/i386/db_interface.c optional ddb
-i386/i386/db_trace.c optional ddb
-i386/i386/elf_machdep.c standard
-i386/i386/exception.s standard
-i386/i386/gdb_machdep.c optional gdb
-i386/i386/i686_mem.c optional mem
-i386/i386/in_cksum.c optional inet | inet6
-i386/i386/initcpu.c standard
-i386/i386/io.c optional io
-i386/i386/k6_mem.c optional mem
-i386/i386/locore.s standard no-obj
-i386/i386/machdep.c standard
-i386/i386/mem.c optional mem
-i386/i386/minidump_machdep.c standard
-i386/i386/mp_clock.c optional smp
-i386/i386/mp_machdep.c optional smp
-i386/i386/mpboot.s optional smp
-i386/i386/perfmon.c optional perfmon
-i386/i386/pmap.c standard
-i386/i386/ptrace_machdep.c standard
-i386/i386/support.s standard
-i386/i386/swtch.s standard
-i386/i386/sys_machdep.c standard
-i386/i386/trap.c standard
-i386/i386/uio_machdep.c standard
-i386/i386/vm86.c standard
-i386/i386/vm_machdep.c standard
-i386/ibcs2/ibcs2_errno.c optional ibcs2
-i386/ibcs2/ibcs2_fcntl.c optional ibcs2
-i386/ibcs2/ibcs2_ioctl.c optional ibcs2
-i386/ibcs2/ibcs2_ipc.c optional ibcs2
-i386/ibcs2/ibcs2_isc.c optional ibcs2
-i386/ibcs2/ibcs2_isc_sysent.c optional ibcs2
-i386/ibcs2/ibcs2_misc.c optional ibcs2
-i386/ibcs2/ibcs2_msg.c optional ibcs2
-i386/ibcs2/ibcs2_other.c optional ibcs2
-i386/ibcs2/ibcs2_signal.c optional ibcs2
-i386/ibcs2/ibcs2_socksys.c optional ibcs2
-i386/ibcs2/ibcs2_stat.c optional ibcs2
-i386/ibcs2/ibcs2_sysent.c optional ibcs2
-i386/ibcs2/ibcs2_sysi86.c optional ibcs2
-i386/ibcs2/ibcs2_sysvec.c optional ibcs2
-i386/ibcs2/ibcs2_util.c optional ibcs2
-i386/ibcs2/ibcs2_xenix.c optional ibcs2
-i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2
-i386/ibcs2/imgact_coff.c optional ibcs2
-i386/isa/elink.c optional ep | ie
-i386/isa/npx.c optional npx
-i386/isa/pmtimer.c optional pmtimer
-i386/isa/prof_machdep.c optional profiling-routine
-i386/linux/imgact_linux.c optional compat_linux
-i386/linux/linux_dummy.c optional compat_linux
-i386/linux/linux_machdep.c optional compat_linux
-i386/linux/linux_ptrace.c optional compat_linux
-i386/linux/linux_support.s optional compat_linux \
- dependency "linux_assym.h"
-i386/linux/linux_sysent.c optional compat_linux
-i386/linux/linux_sysvec.c optional compat_linux
-i386/pci/pci_cfgreg.c optional pci
-i386/pci/pci_pir.c optional pci
-i386/svr4/svr4_locore.s optional compat_svr4 \
- dependency "svr4_assym.h" \
- warning "COMPAT_SVR4 is broken and should be avoided"
-i386/svr4/svr4_machdep.c optional compat_svr4
-kern/kern_clocksource.c standard
-kern/imgact_aout.c optional compat_aout
-kern/imgact_gzip.c optional gzip
-kern/subr_sfbuf.c standard
-libkern/divdi3.c standard
-libkern/ffsll.c standard
-libkern/flsll.c standard
-libkern/memmove.c standard
-libkern/memset.c standard
-libkern/moddi3.c standard
-libkern/qdivrem.c standard
-libkern/ucmpdi2.c standard
-libkern/udivdi3.c standard
-libkern/umoddi3.c standard
-pc98/apm/apm_bioscall.S optional apm
-pc98/cbus/cbus_dma.c optional isa
-pc98/cbus/gdc.c optional gdc
-pc98/cbus/nmi.c standard
-pc98/cbus/olpt.c optional olpt
-pc98/cbus/pckbd.c optional pckbd
-pc98/cbus/pcrtc.c standard
-pc98/cbus/pmc.c optional pmc
-pc98/cbus/scgdcrndr.c optional sc gdc
-pc98/cbus/scterm-sck.c optional sc
-pc98/cbus/scvtb.c optional sc
-pc98/cbus/sio.c optional sio
-pc98/cbus/sio_cbus.c optional sio isa
-pc98/cbus/syscons_cbus.c optional sc
-pc98/pc98/busio.s standard
-pc98/pc98/busiosubr.c standard
-pc98/pc98/canbepm.c optional canbepm
-pc98/pc98/canbus.c optional canbus
-pc98/pc98/canbus_if.m optional canbus
-pc98/pc98/pc98_machdep.c standard
-#
-# x86 shared code between IA32, AMD64 and PC98 architectures
-#
-x86/isa/atpic.c optional atpic
-x86/isa/clock.c standard
-x86/isa/isa.c optional isa
-x86/pci/pci_bus.c optional pci
-x86/x86/autoconf.c standard
-x86/x86/busdma_bounce.c standard
-x86/x86/busdma_machdep.c standard
-x86/x86/cpu_machdep.c standard
-x86/x86/dump_machdep.c standard
-x86/x86/identcpu.c standard
-x86/x86/intr_machdep.c standard
-x86/x86/io_apic.c optional apic
-x86/x86/legacy.c standard
-x86/x86/local_apic.c optional apic
-x86/x86/mca.c standard
-x86/x86/mptable.c optional apic
-x86/x86/mptable_pci.c optional apic pci
-x86/x86/mp_x86.c optional smp
-x86/x86/mp_watchdog.c optional mp_watchdog smp
-x86/x86/msi.c optional apic pci
-x86/x86/nexus.c standard
-x86/x86/stack_machdep.c optional ddb | stack
-x86/x86/tsc.c standard
-x86/x86/delay.c standard
diff --git a/sys/conf/options b/sys/conf/options
index beea9bd507d3..e59f0c76a822 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -130,9 +130,7 @@ GEOM_PART_EBR_COMPAT opt_geom.h
GEOM_PART_GPT opt_geom.h
GEOM_PART_LDM opt_geom.h
GEOM_PART_MBR opt_geom.h
-GEOM_PART_PC98 opt_geom.h
GEOM_PART_VTOC8 opt_geom.h
-GEOM_PC98 opt_geom.h
GEOM_RAID opt_geom.h
GEOM_RAID3 opt_geom.h
GEOM_SHSEC opt_geom.h
diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98
deleted file mode 100644
index a19ebd11271b..000000000000
--- a/sys/conf/options.pc98
+++ /dev/null
@@ -1,104 +0,0 @@
-# $FreeBSD$
-# Options specific to the pc98 platform kernels
-
-AUTO_EOI_1 opt_auto_eoi.h
-BROKEN_KEYBOARD_RESET opt_reset.h
-COUNT_XINVLTLB_HITS opt_smp.h
-COUNT_IPIS opt_smp.h
-DISABLE_PG_G opt_pmap.h
-DISABLE_PSE opt_pmap.h
-I586_PMC_GUPROF opt_i586_guprof.h
-MAXMEM
-MPTABLE_FORCE_HTT
-MP_WATCHDOG
-PERFMON
-PMAP_SHPGPERPROC opt_pmap.h
-POWERFAIL_NMI opt_trap.h
-
-# Options for emulators. These should only be used at config time, so
-# they are handled like options for static filesystems
-# (see src/sys/conf/options), except for broken debugging options.
-COMPAT_AOUT opt_dontuse.h
-IBCS2 opt_dontuse.h
-COMPAT_LINUX opt_dontuse.h
-COMPAT_SVR4 opt_dontuse.h
-DEBUG_SVR4 opt_svr4.h
-LINPROCFS opt_dontuse.h
-LINSYSFS opt_dontuse.h
-
-# Change KVM size. Changes things all over the kernel.
-KVA_PAGES opt_global.h
-
-TIMER_FREQ opt_clock.h
-
-CPU_BLUELIGHTNING_3X opt_cpu.h
-CPU_BLUELIGHTNING_FPU_OP_CACHE opt_cpu.h
-CPU_BTB_EN opt_cpu.h
-CPU_CYRIX_NO_LOCK opt_cpu.h
-CPU_DIRECT_MAPPED_CACHE opt_cpu.h
-CPU_DISABLE_5X86_LSSER opt_cpu.h
-CPU_DISABLE_CMPXCHG opt_global.h # XXX global, unlike other CPU_*
-CPU_DISABLE_SSE opt_cpu.h
-CPU_FASTER_5X86_FPU opt_cpu.h
-CPU_GEODE opt_cpu.h
-CPU_I486_ON_386 opt_cpu.h
-CPU_IORT opt_cpu.h
-CPU_L2_LATENCY opt_cpu.h
-CPU_LOOP_EN opt_cpu.h
-CPU_PPRO2CELERON opt_cpu.h
-CPU_RSTK_EN opt_cpu.h
-CPU_SOEKRIS opt_cpu.h
-CPU_SUSP_HLT opt_cpu.h
-CPU_UPGRADE_HW_CACHE opt_cpu.h
-CPU_WT_ALLOC opt_cpu.h
-CYRIX_CACHE_REALLY_WORKS opt_cpu.h
-CYRIX_CACHE_WORKS opt_cpu.h
-NO_F00F_HACK opt_cpu.h
-NO_MEMORY_HOLE opt_cpu.h
-
-# The CPU type affects the endian conversion functions all over the kernel.
-I486_CPU opt_global.h
-I586_CPU opt_global.h
-I686_CPU opt_global.h
-
-# options for serial support
-COM_ESP opt_sio.h
-COM_MULTIPORT opt_sio.h
-CONSPEED opt_sio.h
-GDBSPEED opt_sio.h
-
-GDC
-
-# AGP debugging support
-AGP_DEBUG opt_agp.h
-
-# Video spigot
-SPIGOT_UNSECURE opt_spigot.h
-
-# Enables NETGRAPH support for Cronyx adapters
-NETGRAPH_CRONYX opt_ng_cronyx.h
-
-# ct driver options
-CT_BUS_WEIGHT opt_ct.h
-CT_USE_RELOCATE_OFFSET opt_ct.h
-
-# npx options
-FPU_ERROR_BROKEN opt_npx.h
-
-# PC98 options
-EPSON_BOUNCEDMA opt_pc98.h
-EPSON_MEMWIN opt_pc98.h
-LINE30 opt_syscons.h
-PC98 opt_global.h
-
-# Device options
-DEV_APIC opt_apic.h
-DEV_ATPIC opt_atpic.h
-DEV_MECIA opt_mecia.h
-DEV_NPX opt_npx.h
-
-# Debugging
-NPX_DEBUG opt_npx.h
-
-# BPF just-in-time compiler
-BPF_JITTER opt_bpf.h
diff --git a/sys/crypto/aesni/aesni.h b/sys/crypto/aesni/aesni.h
index c3e113d12001..8b40e1ab0fec 100644
--- a/sys/crypto/aesni/aesni.h
+++ b/sys/crypto/aesni/aesni.h
@@ -35,7 +35,7 @@
#include <opencrypto/cryptodev.h>
-#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
+#if defined(__amd64__) || defined(__i386__)
#include <machine/cpufunc.h>
#include <machine/cputypes.h>
#include <machine/md_var.h>
diff --git a/sys/crypto/via/padlock.c b/sys/crypto/via/padlock.c
index 65a7b5dd9fb5..f6c6d77f6cb7 100644
--- a/sys/crypto/via/padlock.c
+++ b/sys/crypto/via/padlock.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rwlock.h>
#include <sys/malloc.h>
#include <sys/libkern.h>
-#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
+#if defined(__amd64__) || defined(__i386__)
#include <machine/cpufunc.h>
#include <machine/cputypes.h>
#include <machine/md_var.h>
@@ -85,7 +85,7 @@ padlock_probe(device_t dev)
{
char capp[256];
-#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
+#if defined(__amd64__) || defined(__i386__)
/* If there is no AES support, we has nothing to do here. */
if (!(via_feature_xcrypt & VIA_HAS_AES)) {
device_printf(dev, "No ACE support.\n");
diff --git a/sys/crypto/via/padlock_hash.c b/sys/crypto/via/padlock_hash.c
index c952b63503ea..658043b4946a 100644
--- a/sys/crypto/via/padlock_hash.c
+++ b/sys/crypto/via/padlock_hash.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/libkern.h>
#include <sys/endian.h>
#include <sys/pcpu.h>
-#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
+#if defined(__amd64__) || defined(__i386__)
#include <machine/cpufunc.h>
#include <machine/cputypes.h>
#include <machine/md_var.h>
diff --git a/sys/dev/aic/aic_cbus.c b/sys/dev/aic/aic_cbus.c
deleted file mode 100644
index 84e7f7bf4e9d..000000000000
--- a/sys/dev/aic/aic_cbus.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*-
- * Copyright (c) 1999 Luoqi Chen.
- * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/callout.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/module.h>
-#include <sys/mutex.h>
-#include <sys/bus.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/rman.h>
-
-#include <isa/isavar.h>
-#include <dev/aic/aic6360reg.h>
-#include <dev/aic/aicvar.h>
-
-struct aic_isa_softc {
- struct aic_softc sc_aic;
- struct resource *sc_port;
- struct resource *sc_irq;
- struct resource *sc_drq;
- void *sc_ih;
-};
-
-static int aic_isa_alloc_resources(device_t);
-static void aic_isa_release_resources(device_t);
-static int aic_isa_probe(device_t);
-static int aic_isa_attach(device_t);
-
-static u_int aic_isa_ports[] = { 0x1840 };
-
-#define AIC_ISA_NUMPORTS nitems(aic_isa_ports)
-#define AIC_ISA_PORTSIZE 0x20
-
-#define AIC98_GENERIC 0x00
-#define AIC98_NEC100 0x01
-#define AIC_TYPE98(x) (((x) >> 16) & 0x01)
-
-static bus_addr_t aicport_generic[AIC_ISA_PORTSIZE] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-};
-static bus_addr_t aicport_100[AIC_ISA_PORTSIZE] = {
- 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
- 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
- 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
- 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e,
-};
-
-static struct isa_pnp_id aic_ids[] = {
- { 0xa180a3b8, "NEC PC9801-100" },
- { 0 }
-};
-
-static int
-aic_isa_alloc_resources(device_t dev)
-{
- struct aic_isa_softc *sc = device_get_softc(dev);
- int rid;
- bus_addr_t *bs_iat;
-
- if ((isa_get_logicalid(dev) == 0xa180a3b8) ||
- (AIC_TYPE98(device_get_flags(dev)) == AIC98_NEC100))
- bs_iat = aicport_100;
- else
- bs_iat = aicport_generic;
-
- sc->sc_port = sc->sc_irq = sc->sc_drq = NULL;
-
- rid = 0;
- sc->sc_port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid,
- bs_iat, AIC_ISA_PORTSIZE, RF_ACTIVE);
- if (!sc->sc_port) {
- device_printf(dev, "I/O port allocation failed\n");
- return (ENOMEM);
- }
- isa_load_resourcev(sc->sc_port, bs_iat, AIC_ISA_PORTSIZE);
- mtx_init(&sc->sc_aic.lock, "aic", NULL, MTX_DEF);
-
- if (isa_get_irq(dev) != -1) {
- rid = 0;
- sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
- RF_ACTIVE);
- if (!sc->sc_irq) {
- device_printf(dev, "IRQ allocation failed\n");
- aic_isa_release_resources(dev);
- return (ENOMEM);
- }
- }
-
- if (isa_get_drq(dev) != -1) {
- rid = 0;
- sc->sc_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid,
- RF_ACTIVE);
- if (!sc->sc_drq) {
- device_printf(dev, "DRQ allocation failed\n");
- aic_isa_release_resources(dev);
- return (ENOMEM);
- }
- }
-
- sc->sc_aic.dev = dev;
- sc->sc_aic.res = sc->sc_port;
- return (0);
-}
-
-static void
-aic_isa_release_resources(device_t dev)
-{
- struct aic_isa_softc *sc = device_get_softc(dev);
-
- if (sc->sc_port)
- bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port);
- if (sc->sc_irq)
- bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq);
- if (sc->sc_drq)
- bus_release_resource(dev, SYS_RES_DRQ, 0, sc->sc_drq);
- sc->sc_port = sc->sc_irq = sc->sc_drq = NULL;
- mtx_destroy(&sc->sc_aic.lock);
-}
-
-static int
-aic_isa_probe(device_t dev)
-{
- struct aic_isa_softc *sc = device_get_softc(dev);
- struct aic_softc *aic = &sc->sc_aic;
- int numports, i;
- u_int port, *ports;
- u_int8_t porta;
-
- if (ISA_PNP_PROBE(device_get_parent(dev), dev, aic_ids) == ENXIO)
- return (ENXIO);
-
- port = isa_get_port(dev);
- if (port != -1) {
- ports = &port;
- numports = 1;
- } else {
- ports = aic_isa_ports;
- numports = AIC_ISA_NUMPORTS;
- }
-
- for (i = 0; i < numports; i++) {
- if (bus_set_resource(dev, SYS_RES_IOPORT, 0, ports[i], 1))
- continue;
- if (aic_isa_alloc_resources(dev))
- continue;
- if (aic_probe(aic) == 0)
- break;
- aic_isa_release_resources(dev);
- }
-
- if (i == numports)
- return (ENXIO);
-
- porta = aic_inb(aic, PORTA);
- aic_isa_release_resources(dev);
- if (isa_get_irq(dev) == -1)
- bus_set_resource(dev, SYS_RES_IRQ, 0, PORTA_IRQ(porta), 1);
- if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1)
- bus_set_resource(dev, SYS_RES_DRQ, 0, PORTA_DRQ(porta), 1);
- device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");
- return (0);
-}
-
-static int
-aic_isa_attach(device_t dev)
-{
- struct aic_isa_softc *sc = device_get_softc(dev);
- struct aic_softc *aic = &sc->sc_aic;
- int error;
-
- error = aic_isa_alloc_resources(dev);
- if (error) {
- device_printf(dev, "resource allocation failed\n");
- return (error);
- }
-
- error = aic_attach(aic);
- if (error) {
- device_printf(dev, "attach failed\n");
- aic_isa_release_resources(dev);
- return (error);
- }
-
- error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY |
- INTR_MPSAFE, NULL, aic_intr, aic, &sc->sc_ih);
- if (error) {
- device_printf(dev, "failed to register interrupt handler\n");
- aic_isa_release_resources(dev);
- return (error);
- }
- return (0);
-}
-
-static int
-aic_isa_detach(device_t dev)
-{
- struct aic_isa_softc *sc = device_get_softc(dev);
- struct aic_softc *aic = &sc->sc_aic;
- int error;
-
- error = aic_detach(aic);
- if (error) {
- device_printf(dev, "detach failed\n");
- return (error);
- }
-
- error = bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih);
- if (error) {
- device_printf(dev, "failed to unregister interrupt handler\n");
- }
-
- aic_isa_release_resources(dev);
- return (0);
-}
-
-static device_method_t aic_isa_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, aic_isa_probe),
- DEVMETHOD(device_attach, aic_isa_attach),
- DEVMETHOD(device_detach, aic_isa_detach),
- { 0, 0 }
-};
-
-static driver_t aic_isa_driver = {
- "aic",
- aic_isa_methods, sizeof(struct aic_isa_softc),
-};
-
-extern devclass_t aic_devclass;
-
-MODULE_DEPEND(aic, cam, 1,1,1);
-DRIVER_MODULE(aic, isa, aic_isa_driver, aic_devclass, 0, 0);
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index cf8ed784e7b8..8ef4191eca8c 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -83,7 +83,6 @@
#define ATA_CTLOFFSET 0x206 /* control register offset */
#define ATA_PCCARD_CTLOFFSET 0x0e /* do for PCCARD devices */
-#define ATA_PC98_CTLOFFSET 0x10c /* do for PC98 devices */
#define ATA_A_IDS 0x02 /* disable interrupts */
#define ATA_A_RESET 0x04 /* RESET controller */
#ifdef ATA_LEGACY_SUPPORT
@@ -178,17 +177,12 @@
/* misc defines */
#define ATA_PRIMARY 0x1f0
#define ATA_SECONDARY 0x170
-#define ATA_PC98_BANK 0x432
#define ATA_IOSIZE 0x08
-#define ATA_PC98_IOSIZE 0x10
#define ATA_CTLIOSIZE 0x01
#define ATA_BMIOSIZE 0x08
-#define ATA_PC98_BANKIOSIZE 0x01
#define ATA_IOADDR_RID 0
#define ATA_CTLADDR_RID 1
#define ATA_BMADDR_RID 0x20
-#define ATA_PC98_CTLADDR_RID 8
-#define ATA_PC98_BANKADDR_RID 9
#define ATA_IRQ_RID 0
#define ATA_DEV(unit) ((unit > 0) ? 0x10 : 0)
#define ATA_CFA_MAGIC1 0x844A
diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c
deleted file mode 100644
index 4165ea6a947a..000000000000
--- a/sys/dev/ata/ata-cbus.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*-
- * Copyright (c) 2002 - 2008 Søren Schmidt <sos@FreeBSD.org>
- * 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,
- * without modification, immediately at the beginning of the file.
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/ata.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-#include <sys/module.h>
-#include <sys/conf.h>
-#include <sys/sema.h>
-#include <sys/taskqueue.h>
-#include <vm/uma.h>
-#include <machine/resource.h>
-#include <machine/bus.h>
-#include <sys/rman.h>
-#include <isa/isavar.h>
-#include <dev/ata/ata-all.h>
-#include <ata_if.h>
-
-/* local vars */
-struct ata_cbus_controller {
- struct resource *io;
- struct resource *ctlio;
- struct resource *bankio;
- struct resource *irq;
- void *ih;
- int channels;
- struct {
- void (*function)(void *);
- void *argument;
- } interrupt[2];
-};
-
-/* local prototypes */
-static void ata_cbus_intr(void *);
-
-static int
-ata_cbus_probe(device_t dev)
-{
- struct resource *io;
- int rid;
- rman_res_t tmp;
-
- /* dont probe PnP devices */
- if (isa_get_vendorid(dev))
- return (ENXIO);
-
- /* allocate the ioport range */
- rid = ATA_IOADDR_RID;
- if (!(io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid,
- ATA_PC98_IOSIZE, RF_ACTIVE)))
- return ENOMEM;
-
- /* calculate & set the altport range */
- rid = ATA_PC98_CTLADDR_RID;
- if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &tmp, &tmp)) {
- bus_set_resource(dev, SYS_RES_IOPORT, rid,
- rman_get_start(io)+ATA_PC98_CTLOFFSET, ATA_CTLIOSIZE);
- }
-
- /* calculate & set the bank range */
- rid = ATA_PC98_BANKADDR_RID;
- if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &tmp, &tmp)) {
- bus_set_resource(dev, SYS_RES_IOPORT, rid,
- ATA_PC98_BANK, ATA_PC98_BANKIOSIZE);
- }
-
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
- return 0;
-}
-
-static int
-ata_cbus_attach(device_t dev)
-{
- struct ata_cbus_controller *ctlr = device_get_softc(dev);
- device_t child;
- int rid, unit;
-
- /* allocate resources */
- rid = ATA_IOADDR_RID;
- if (!(ctlr->io = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid,
- ATA_PC98_IOSIZE, RF_ACTIVE)))
- return ENOMEM;
-
- rid = ATA_PC98_CTLADDR_RID;
- if (!(ctlr->ctlio =
- bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
- rman_get_start(ctlr->io) + ATA_PC98_CTLOFFSET, ~0,
- ATA_CTLIOSIZE, RF_ACTIVE))) {
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
- return ENOMEM;
- }
-
- rid = ATA_PC98_BANKADDR_RID;
- if (!(ctlr->bankio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
- ATA_PC98_BANK, ~0,
- ATA_PC98_BANKIOSIZE, RF_ACTIVE))) {
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlr->ctlio);
- return ENOMEM;
- }
-
- rid = ATA_IRQ_RID;
- if (!(ctlr->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
- RF_ACTIVE | RF_SHAREABLE))) {
- device_printf(dev, "unable to alloc interrupt\n");
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlr->ctlio);
- bus_release_resource(dev, SYS_RES_IOPORT,
- ATA_PC98_BANKADDR_RID, ctlr->bankio);
- return ENXIO;
- }
-
- if ((bus_setup_intr(dev, ctlr->irq, ATA_INTR_FLAGS,
- NULL, ata_cbus_intr, ctlr, &ctlr->ih))) {
- device_printf(dev, "unable to setup interrupt\n");
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlr->ctlio);
- bus_release_resource(dev, SYS_RES_IOPORT,
- ATA_PC98_BANKADDR_RID, ctlr->bankio);
- bus_release_resource(dev, SYS_RES_IOPORT, ATA_IRQ_RID, ctlr->irq);
- return ENXIO;
- }
-
- /* Work around the lack of channel serialization in ATA_CAM. */
- ctlr->channels = 1;
- device_printf(dev, "second channel ignored\n");
-
- for (unit = 0; unit < ctlr->channels; unit++) {
- child = device_add_child(dev, "ata", unit);
- if (child == NULL)
- device_printf(dev, "failed to add ata child device\n");
- else
- device_set_ivars(child, (void *)(intptr_t)unit);
- }
-
- bus_generic_attach(dev);
- return (0);
-}
-
-static struct resource *
-ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
- rman_res_t start, rman_res_t end, rman_res_t count,
- u_int flags)
-{
- struct ata_cbus_controller *ctlr = device_get_softc(dev);
-
- if (type == SYS_RES_IOPORT) {
- switch (*rid) {
- case ATA_IOADDR_RID:
- return ctlr->io;
- case ATA_CTLADDR_RID:
- return ctlr->ctlio;
- }
- }
- if (type == SYS_RES_IRQ)
- return ctlr->irq;
- return 0;
-}
-
-static int
-ata_cbus_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_filter_t *filter, driver_intr_t *intr,
- void *arg, void **cookiep)
-{
- struct ata_cbus_controller *controller = device_get_softc(dev);
- int unit = ((struct ata_channel *)device_get_softc(child))->unit;
-
- if (filter != NULL) {
- printf("ata-cbus.c: we cannot use a filter here\n");
- return (EINVAL);
- }
- controller->interrupt[unit].function = intr;
- controller->interrupt[unit].argument = arg;
- *cookiep = controller;
-
- return 0;
-}
-
-static int
-ata_cbus_print_child(device_t dev, device_t child)
-{
- struct ata_channel *ch = device_get_softc(child);
- int retval = 0;
-
- retval += bus_print_child_header(dev, child);
- retval += printf(" at bank %d", ch->unit);
- retval += bus_print_child_footer(dev, child);
- return retval;
-}
-
-static void
-ata_cbus_intr(void *data)
-{
- struct ata_cbus_controller *ctlr = data;
- struct ata_channel *ch;
- int unit;
-
- for (unit = 0; unit < ctlr->channels; unit++) {
- if (!(ch = ctlr->interrupt[unit].argument))
- continue;
- ctlr->interrupt[unit].function(ch);
- }
-}
-
-static device_method_t ata_cbus_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, ata_cbus_probe),
- DEVMETHOD(device_attach, ata_cbus_attach),
-// DEVMETHOD(device_detach, ata_cbus_detach),
-
- /* bus methods */
- DEVMETHOD(bus_alloc_resource, ata_cbus_alloc_resource),
- DEVMETHOD(bus_setup_intr, ata_cbus_setup_intr),
- DEVMETHOD(bus_print_child, ata_cbus_print_child),
-
- DEVMETHOD_END
-};
-
-static driver_t ata_cbus_driver = {
- "atacbus",
- ata_cbus_methods,
- sizeof(struct ata_cbus_controller),
-};
-
-static devclass_t ata_cbus_devclass;
-
-DRIVER_MODULE(atacbus, isa, ata_cbus_driver, ata_cbus_devclass, NULL, NULL);
-
-static int
-ata_cbuschannel_probe(device_t dev)
-{
- char buffer[32];
-
- sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev));
- device_set_desc_copy(dev, buffer);
-
- return ata_probe(dev);
-}
-
-static int
-ata_cbuschannel_attach(device_t dev)
-{
- struct ata_cbus_controller *ctlr = device_get_softc(device_get_parent(dev));
- struct ata_channel *ch = device_get_softc(dev);
- int i;
-
- if (ch->attached)
- return (0);
- ch->attached = 1;
-
- ch->unit = (intptr_t)device_get_ivars(dev);
- /* setup the resource vectors */
- for (i = ATA_DATA; i <= ATA_COMMAND; i ++) {
- ch->r_io[i].res = ctlr->io;
- ch->r_io[i].offset = i << 1;
- }
- ch->r_io[ATA_CONTROL].res = ctlr->ctlio;
- ch->r_io[ATA_CONTROL].offset = 0;
- ch->r_io[ATA_IDX_ADDR].res = ctlr->io;
- ata_default_registers(dev);
-
- /* initialize softc for this channel */
- ch->flags |= ATA_USE_16BIT;
- ata_generic_hw(dev);
-
- return ata_attach(dev);
-}
-
-static int
-ata_cbuschannel_detach(device_t dev)
-{
- struct ata_channel *ch = device_get_softc(dev);
-
- if (!ch->attached)
- return (0);
- ch->attached = 0;
-
- return ata_detach(dev);
-}
-
-static int
-ata_cbuschannel_suspend(device_t dev)
-{
- struct ata_channel *ch = device_get_softc(dev);
-
- if (!ch->attached)
- return (0);
-
- return ata_suspend(dev);
-}
-
-static int
-ata_cbuschannel_resume(device_t dev)
-{
- struct ata_channel *ch = device_get_softc(dev);
-
- if (!ch->attached)
- return (0);
-
- return ata_resume(dev);
-}
-
-static device_method_t ata_cbuschannel_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, ata_cbuschannel_probe),
- DEVMETHOD(device_attach, ata_cbuschannel_attach),
- DEVMETHOD(device_detach, ata_cbuschannel_detach),
- DEVMETHOD(device_suspend, ata_cbuschannel_suspend),
- DEVMETHOD(device_resume, ata_cbuschannel_resume),
- DEVMETHOD_END
-};
-
-static driver_t ata_cbuschannel_driver = {
- "ata",
- ata_cbuschannel_methods,
- sizeof(struct ata_channel),
-};
-
-DRIVER_MODULE(ata, atacbus, ata_cbuschannel_driver, ata_devclass, NULL, NULL);
-MODULE_DEPEND(ata, ata, 1, 1, 1);
diff --git a/sys/dev/ct/bshw_machdep.c b/sys/dev/ct/bshw_machdep.c
deleted file mode 100644
index 046aa7d9430c..000000000000
--- a/sys/dev/ct/bshw_machdep.c
+++ /dev/null
@@ -1,743 +0,0 @@
-/* $NecBSD: bshw_machdep.c,v 1.8.12.6 2001/06/29 06:28:05 honda Exp $ */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-/* $NetBSD$ */
-
-/*-
- * [NetBSD for NEC PC-98 series]
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- * NetBSD/pc98 porting staff. All rights reserved.
- *
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- * Naofumi HONDA. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include "opt_ddb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/rman.h>
-
-#include <vm/vm.h>
-
-#include <machine/bus.h>
-#include <machine/md_var.h>
-
-#include <compat/netbsd/dvcfg.h>
-
-#include <cam/scsi/scsi_low.h>
-
-#include <dev/ic/wd33c93reg.h>
-#include <dev/ct/ctvar.h>
-#include <dev/ct/ct_machdep.h>
-#include <dev/ct/bshwvar.h>
-
-#include <vm/pmap.h>
-
-#define BSHW_IO_CONTROL_FLAGS 0
-
-u_int bshw_io_control = BSHW_IO_CONTROL_FLAGS;
-int bshw_data_read_bytes = 4096;
-int bshw_data_write_bytes = 4096;
-
-/*********************************************************
- * OS dep part
- *********************************************************/
-typedef unsigned long vaddr_t;
-
-/*********************************************************
- * GENERIC MACHDEP FUNCTIONS
- *********************************************************/
-void
-bshw_synch_setup(struct ct_softc *ct, struct targ_info *ti)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct ct_targ_info *cti = (void *) ti;
- struct bshw_softc *bs = ct->ct_hw;
- struct bshw *hw = bs->sc_hw;
-
- if (hw->hw_sregaddr == 0)
- return;
-
- ct_cr_write_1(chp, hw->hw_sregaddr + ti->ti_id, cti->cti_syncreg);
- if (hw->hw_flags & BSHW_DOUBLE_DMACHAN)
- {
- ct_cr_write_1(chp, hw->hw_sregaddr + ti->ti_id + 8,
- cti->cti_syncreg);
- }
-}
-
-void
-bshw_bus_reset(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct bshw_softc *bs = ct->ct_hw;
- struct bshw *hw = bs->sc_hw;
- bus_addr_t offs;
- u_int8_t regv;
- int i;
-
- /* open hardware busmaster mode */
- if (hw->hw_dma_init != NULL && ((*hw->hw_dma_init)(ct)) != 0)
- {
- device_printf(slp->sl_dev,
- "change mode using external DMA (%x)\n",
- (u_int)ct_cr_read_1(chp, 0x37));
- }
-
- /* clear hardware synch registers */
- offs = hw->hw_sregaddr;
- if (offs != 0)
- {
- for (i = 0; i < 8; i ++, offs ++)
- {
- ct_cr_write_1(chp, offs, 0);
- if ((hw->hw_flags & BSHW_DOUBLE_DMACHAN) != 0)
- ct_cr_write_1(chp, offs + 8, 0);
- }
- }
-
- /* disable interrupt & assert reset */
- regv = ct_cr_read_1(chp, wd3s_mbank);
- regv |= MBR_RST;
- regv &= ~MBR_IEN;
- ct_cr_write_1(chp, wd3s_mbank, regv);
-
- DELAY(500000);
-
- /* reset signal off */
- regv &= ~MBR_RST;
- ct_cr_write_1(chp, wd3s_mbank, regv);
-
- /* interrupt enable */
- regv |= MBR_IEN;
- ct_cr_write_1(chp, wd3s_mbank, regv);
-}
-
-/* probe */
-int
-bshw_read_settings(struct ct_bus_access_handle *chp, struct bshw_softc *bs)
-{
- static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 };
-
- bs->sc_hostid = (ct_cr_read_1(chp, wd3s_auxc) & AUXCR_HIDM);
- bs->sc_irq = irq_tbl[(ct_cr_read_1(chp, wd3s_auxc) >> 3) & 7];
- bs->sc_drq = ct_cmdp_read_1(chp) & 3;
- return 0;
-}
-
-/*********************************************************
- * DMA PIO TRANSFER (SMIT)
- *********************************************************/
-#define LC_SMIT_TIMEOUT 2 /* 2 sec: timeout for a fifo status ready */
-#define LC_SMIT_OFFSET 0x1000
-#define LC_FSZ DEV_BSIZE
-#define LC_SFSZ 0x0c
-#define LC_REST (LC_FSZ - LC_SFSZ)
-
-#define BSHW_LC_FSET 0x36
-#define BSHW_LC_FCTRL 0x44
-#define FCTRL_EN 0x01
-#define FCTRL_WRITE 0x02
-
-#define SF_ABORT 0x08
-#define SF_RDY 0x10
-
-static __inline void bshw_lc_smit_start(struct ct_softc *, int, u_int);
-static __inline void bshw_lc_smit_stop(struct ct_softc *);
-static int bshw_lc_smit_fstat(struct ct_softc *, int, int);
-
-static __inline void
-bshw_lc_smit_stop(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- ct_cr_write_1(chp, BSHW_LC_FCTRL, 0);
- ct_cmdp_write_1(chp, CMDP_DMER);
-}
-
-static __inline void
-bshw_lc_smit_start(struct ct_softc *ct, int count, u_int direction)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- u_int8_t pval, val;
-
- val = ct_cr_read_1(chp, BSHW_LC_FSET);
- cthw_set_count(chp, count);
-
- pval = FCTRL_EN;
- if (direction == SCSI_LOW_WRITE)
- pval |= (val & 0xe0) | FCTRL_WRITE;
- ct_cr_write_1(chp, BSHW_LC_FCTRL, pval);
- ct_cr_write_1(chp, wd3s_cmd, WD3S_TFR_INFO);
-}
-
-static int
-bshw_lc_smit_fstat(struct ct_softc *ct, int wc, int read)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- u_int8_t stat;
-
- while (wc -- > 0)
- {
- chp->ch_bus_weight(chp);
- stat = ct_cmdp_read_1(chp);
- if (read == SCSI_LOW_READ)
- {
- if ((stat & SF_RDY) != 0)
- return 0;
- if ((stat & SF_ABORT) != 0)
- return EIO;
- }
- else
- {
- if ((stat & SF_ABORT) != 0)
- return EIO;
- if ((stat & SF_RDY) != 0)
- return 0;
- }
- }
-
- device_printf(ct->sc_sclow.sl_dev, "SMIT fifo status timeout\n");
- return EIO;
-}
-
-void
-bshw_smit_xfer_stop(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct bshw_softc *bs = ct->ct_hw;
- struct targ_info *ti;
- struct sc_p *sp = &slp->sl_scp;
- u_int count;
-
- bshw_lc_smit_stop(ct);
-
- ti = slp->sl_Tnexus;
- if (ti == NULL)
- return;
-
- if (ti->ti_phase == PH_DATA)
- {
- count = cthw_get_count(&ct->sc_ch);
- if (count < bs->sc_sdatalen)
- {
- if (sp->scp_direction == SCSI_LOW_READ &&
- count != bs->sc_edatalen)
- goto bad;
-
- count = bs->sc_sdatalen - count;
- if (count > (u_int) sp->scp_datalen)
- goto bad;
-
- sp->scp_data += count;
- sp->scp_datalen -= count;
- }
- else if (count > bs->sc_sdatalen)
- {
-bad:
- device_printf(slp->sl_dev,
- "smit_xfer_end: cnt error\n");
- slp->sl_error |= PDMAERR;
- }
- scsi_low_data_finish(slp);
- }
- else
- {
- device_printf(slp->sl_dev, "smit_xfer_end: phase miss\n");
- slp->sl_error |= PDMAERR;
- }
-}
-
-int
-bshw_smit_xfer_start(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct bshw_softc *bs = ct->ct_hw;
- struct sc_p *sp = &slp->sl_scp;
- struct targ_info *ti = slp->sl_Tnexus;
- struct ct_targ_info *cti = (void *) ti;
- u_int datalen, count, io_control;
- int wc;
- u_int8_t *data;
-
- io_control = bs->sc_io_control | bshw_io_control;
- if ((io_control & BSHW_SMIT_BLOCK) != 0)
- return EINVAL;
-
- if ((slp->sl_scp.scp_datalen % DEV_BSIZE) != 0)
- return EINVAL;
-
- datalen = sp->scp_datalen;
- if (slp->sl_scp.scp_direction == SCSI_LOW_READ)
- {
- if ((io_control & BSHW_READ_INTERRUPT_DRIVEN) != 0 &&
- datalen > bshw_data_read_bytes)
- datalen = bshw_data_read_bytes;
- }
- else
- {
- if ((io_control & BSHW_WRITE_INTERRUPT_DRIVEN) != 0 &&
- datalen > bshw_data_write_bytes)
- datalen = bshw_data_write_bytes;
- }
-
- bs->sc_sdatalen = datalen;
- data = sp->scp_data;
- wc = LC_SMIT_TIMEOUT * 1024 * 1024;
-
- ct_cr_write_1(chp, wd3s_ctrl, ct->sc_creg | CR_DMA);
- bshw_lc_smit_start(ct, datalen, sp->scp_direction);
-
- if (sp->scp_direction == SCSI_LOW_READ)
- {
- do
- {
- if (bshw_lc_smit_fstat(ct, wc, SCSI_LOW_READ))
- break;
-
- count = (datalen > LC_FSZ ? LC_FSZ : datalen);
- bus_read_region_4(chp->ch_mem,
- LC_SMIT_OFFSET, (u_int32_t *) data, count >> 2);
- data += count;
- datalen -= count;
- }
- while (datalen > 0);
-
- bs->sc_edatalen = datalen;
- }
- else
- {
- do
- {
- if (bshw_lc_smit_fstat(ct, wc, SCSI_LOW_WRITE))
- break;
- if (cti->cti_syncreg == 0)
- {
- /* XXX:
- * If async transfer, reconfirm a scsi phase
- * again. Unless C bus might hang up.
- */
- if (bshw_lc_smit_fstat(ct, wc, SCSI_LOW_WRITE))
- break;
- }
-
- count = (datalen > LC_SFSZ ? LC_SFSZ : datalen);
- bus_write_region_4(chp->ch_mem,
- LC_SMIT_OFFSET, (u_int32_t *) data, count >> 2);
- data += count;
- datalen -= count;
-
- if (bshw_lc_smit_fstat(ct, wc, SCSI_LOW_WRITE))
- break;
-
- count = (datalen > LC_REST ? LC_REST : datalen);
- bus_write_region_4(chp->ch_mem,
- LC_SMIT_OFFSET + LC_SFSZ,
- (u_int32_t *) data, count >> 2);
- data += count;
- datalen -= count;
- }
- while (datalen > 0);
- }
- return 0;
-}
-
-/*********************************************************
- * DMA TRANSFER (BS)
- *********************************************************/
-static __inline void bshw_dma_write_1 \
- (struct ct_bus_access_handle *, bus_addr_t, u_int8_t);
-static void bshw_dmastart(struct ct_softc *);
-static void bshw_dmadone(struct ct_softc *);
-
-int
-bshw_dma_xfer_start(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct sc_p *sp = &slp->sl_scp;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct bshw_softc *bs = ct->ct_hw;
- vaddr_t va, endva, phys, nphys;
- u_int io_control;
-
- io_control = bs->sc_io_control | bshw_io_control;
- if ((io_control & BSHW_DMA_BLOCK) != 0 && sp->scp_datalen < 256)
- return EINVAL;
-
- ct_cr_write_1(chp, wd3s_ctrl, ct->sc_creg | CR_DMA);
- phys = vtophys((vaddr_t) sp->scp_data);
- if (phys >= bs->sc_minphys)
- {
- /* setup segaddr */
- bs->sc_segaddr = bs->sc_bounce_phys;
- /* setup seglen */
- bs->sc_seglen = sp->scp_datalen;
- if (bs->sc_seglen > bs->sc_bounce_size)
- bs->sc_seglen = bs->sc_bounce_size;
- /* setup bufp */
- bs->sc_bufp = bs->sc_bounce_addr;
- if (sp->scp_direction == SCSI_LOW_WRITE)
- bcopy(sp->scp_data, bs->sc_bufp, bs->sc_seglen);
- }
- else
- {
- /* setup segaddr */
- bs->sc_segaddr = (u_int8_t *) phys;
- /* setup seglen */
- endva = (vaddr_t) round_page((vaddr_t) sp->scp_data + sp->scp_datalen);
- for (va = (vaddr_t) sp->scp_data; ; phys = nphys)
- {
- if ((va += PAGE_SIZE) >= endva)
- {
- bs->sc_seglen = sp->scp_datalen;
- break;
- }
-
- nphys = vtophys(va);
- if (phys + PAGE_SIZE != nphys || nphys >= bs->sc_minphys)
- {
- bs->sc_seglen =
- (u_int8_t *) trunc_page(va) - sp->scp_data;
- break;
- }
- }
- /* setup bufp */
- bs->sc_bufp = NULL;
- }
-
- bshw_dmastart(ct);
- cthw_set_count(chp, bs->sc_seglen);
- ct_cr_write_1(chp, wd3s_cmd, WD3S_TFR_INFO);
- return 0;
-}
-
-void
-bshw_dma_xfer_stop(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct sc_p *sp = &slp->sl_scp;
- struct bshw_softc *bs = ct->ct_hw;
- struct targ_info *ti;
- u_int count, transbytes;
-
- bshw_dmadone(ct);
-
- ti = slp->sl_Tnexus;
- if (ti == NULL)
- return;
-
- if (ti->ti_phase == PH_DATA)
- {
- count = cthw_get_count(&ct->sc_ch);
- if (count < (u_int) bs->sc_seglen)
- {
- transbytes = bs->sc_seglen - count;
- if (bs->sc_bufp != NULL &&
- sp->scp_direction == SCSI_LOW_READ)
- bcopy(bs->sc_bufp, sp->scp_data, transbytes);
-
- sp->scp_data += transbytes;
- sp->scp_datalen -= transbytes;
- }
- else if (count > (u_int) bs->sc_seglen)
- {
- device_printf(slp->sl_dev,
- "port data %x != seglen %x\n",
- count, bs->sc_seglen);
- slp->sl_error |= PDMAERR;
- }
-
- scsi_low_data_finish(slp);
- }
- else
- {
- device_printf(slp->sl_dev, "extra DMA interrupt\n");
- slp->sl_error |= PDMAERR;
- }
-
- bs->sc_bufp = NULL;
-}
-
-/* common dma settings */
-#undef DMA1_SMSK
-#define DMA1_SMSK (0x15)
-#undef DMA1_MODE
-#define DMA1_MODE (0x17)
-#undef DMA1_FFC
-#define DMA1_FFC (0x19)
-#undef DMA1_CHN
-#define DMA1_CHN(c) (0x01 + ((c) << 2))
-
-#define DMA37SM_SET 0x04
-#define DMA37MD_WRITE 0x04
-#define DMA37MD_READ 0x08
-#define DMA37MD_SINGLE 0x40
-
-static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 };
-
-static __inline void
-bshw_dma_write_1(struct ct_bus_access_handle *chp, bus_addr_t port,
- u_int8_t val)
-{
-
- CT_BUS_WEIGHT(chp);
- outb(port, val);
-}
-
-static void
-bshw_dmastart(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct bshw_softc *bs = ct->ct_hw;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- int chan = bs->sc_drq;
- bus_addr_t waport;
- u_int8_t regv, *phys = bs->sc_segaddr;
- u_int nbytes = bs->sc_seglen;
-
- /* flush cpu cache */
- (*bs->sc_dmasync_before) (ct);
-
- /*
- * Program one of DMA channels 0..3. These are
- * byte mode channels.
- */
- /* set dma channel mode, and reset address ff */
-
- if (slp->sl_scp.scp_direction == SCSI_LOW_READ)
- regv = DMA37MD_WRITE | DMA37MD_SINGLE | chan;
- else
- regv = DMA37MD_READ | DMA37MD_SINGLE | chan;
-
- bshw_dma_write_1(chp, DMA1_MODE, regv);
- bshw_dma_write_1(chp, DMA1_FFC, 0);
-
- /* send start address */
- waport = DMA1_CHN(chan);
- bshw_dma_write_1(chp, waport, (u_int) phys);
- bshw_dma_write_1(chp, waport, ((u_int) phys) >> 8);
- bshw_dma_write_1(chp, dmapageport[chan], ((u_int) phys) >> 16);
-
- /* send count */
- bshw_dma_write_1(chp, waport + 2, --nbytes);
- bshw_dma_write_1(chp, waport + 2, nbytes >> 8);
-
- /* vendor unique hook */
- if (bs->sc_hw->hw_dma_start)
- (*bs->sc_hw->hw_dma_start)(ct);
-
- bshw_dma_write_1(chp, DMA1_SMSK, chan);
- ct_cmdp_write_1(chp, CMDP_DMES);
-}
-
-static void
-bshw_dmadone(struct ct_softc *ct)
-{
- struct bshw_softc *bs = ct->ct_hw;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- bshw_dma_write_1(chp, DMA1_SMSK, (bs->sc_drq | DMA37SM_SET));
- ct_cmdp_write_1(chp, CMDP_DMER);
-
- /* vendor unique hook */
- if (bs->sc_hw->hw_dma_stop)
- (*bs->sc_hw->hw_dma_stop) (ct);
-
- /* flush cpu cache */
- (*bs->sc_dmasync_after) (ct);
-}
-
-/**********************************************
- * VENDOR UNIQUE DMA FUNCS
- **********************************************/
-static int bshw_dma_init_sc98(struct ct_softc *);
-static void bshw_dma_start_sc98(struct ct_softc *);
-static void bshw_dma_stop_sc98(struct ct_softc *);
-static int bshw_dma_init_texa(struct ct_softc *);
-static void bshw_dma_start_elecom(struct ct_softc *);
-static void bshw_dma_stop_elecom(struct ct_softc *);
-
-static int
-bshw_dma_init_texa(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- u_int8_t regval;
-
- if ((regval = ct_cr_read_1(chp, 0x37)) & 0x08)
- return 0;
-
- ct_cr_write_1(chp, 0x37, regval | 0x08);
- regval = ct_cr_read_1(chp, 0x3f);
- ct_cr_write_1(chp, 0x3f, regval | 0x08);
- return 1;
-}
-
-static int
-bshw_dma_init_sc98(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- if (ct_cr_read_1(chp, 0x37) & 0x08)
- return 0;
-
- /* If your card is SC98 with bios ver 1.01 or 1.02 under no PCI */
- ct_cr_write_1(chp, 0x37, 0x1a);
- ct_cr_write_1(chp, 0x3f, 0x1a);
-#if 0
- /* only valid for IO */
- ct_cr_write_1(chp, 0x40, 0xf4);
- ct_cr_write_1(chp, 0x41, 0x9);
- ct_cr_write_1(chp, 0x43, 0xff);
- ct_cr_write_1(chp, 0x46, 0x4e);
-
- ct_cr_write_1(chp, 0x48, 0xf4);
- ct_cr_write_1(chp, 0x49, 0x9);
- ct_cr_write_1(chp, 0x4b, 0xff);
- ct_cr_write_1(chp, 0x4e, 0x4e);
-#endif
- return 1;
-}
-
-static void
-bshw_dma_start_sc98(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- ct_cr_write_1(chp, 0x73, 0x32);
- ct_cr_write_1(chp, 0x74, 0x23);
-}
-
-static void
-bshw_dma_stop_sc98(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- ct_cr_write_1(chp, 0x73, 0x43);
- ct_cr_write_1(chp, 0x74, 0x34);
-}
-
-static void
-bshw_dma_start_elecom(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- u_int8_t tmp = ct_cr_read_1(chp, 0x4c);
-
- ct_cr_write_1(chp, 0x32, tmp & 0xdf);
-}
-
-static void
-bshw_dma_stop_elecom(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- u_int8_t tmp = ct_cr_read_1(chp, 0x4c);
-
- ct_cr_write_1(chp, 0x32, tmp | 0x20);
-}
-
-static struct bshw bshw_generic = {
- BSHW_SYNC_RELOAD,
-
- 0,
-
- NULL,
- NULL,
- NULL,
-};
-
-static struct bshw bshw_sc98 = {
- BSHW_DOUBLE_DMACHAN,
-
- 0x60,
-
- bshw_dma_init_sc98,
- bshw_dma_start_sc98,
- bshw_dma_stop_sc98,
-};
-
-static struct bshw bshw_texa = {
- BSHW_DOUBLE_DMACHAN,
-
- 0x60,
-
- bshw_dma_init_texa,
- NULL,
- NULL,
-};
-
-static struct bshw bshw_elecom = {
- 0,
-
- 0x38,
-
- NULL,
- bshw_dma_start_elecom,
- bshw_dma_stop_elecom,
-};
-
-static struct bshw bshw_lc_smit = {
- BSHW_SMFIFO | BSHW_DOUBLE_DMACHAN,
-
- 0x60,
-
- NULL,
- NULL,
- NULL,
-};
-
-static struct bshw bshw_lha20X = {
- BSHW_DOUBLE_DMACHAN,
-
- 0x60,
-
- NULL,
- NULL,
- NULL,
-};
-
-/* hw tabs */
-static dvcfg_hw_t bshw_hwsel_array[] = {
-/* 0x00 */ &bshw_generic,
-/* 0x01 */ &bshw_sc98,
-/* 0x02 */ &bshw_texa,
-/* 0x03 */ &bshw_elecom,
-/* 0x04 */ &bshw_lc_smit,
-/* 0x05 */ &bshw_lha20X,
-};
-
-struct dvcfg_hwsel bshw_hwsel = {
- DVCFG_HWSEL_SZ(bshw_hwsel_array),
- bshw_hwsel_array
-};
diff --git a/sys/dev/ct/bshwvar.h b/sys/dev/ct/bshwvar.h
deleted file mode 100644
index ba42a7206979..000000000000
--- a/sys/dev/ct/bshwvar.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $FreeBSD$ */
-/* $NecBSD: bshwvar.h,v 1.3.14.3 2001/06/21 04:07:37 honda Exp $ */
-/* $NetBSD$ */
-
-/*-
- * [NetBSD for NEC PC-98 series]
- * Copyright (c) 1994, 1995, 1996, 1997, 1998
- * NetBSD/pc98 porting staff. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-#ifndef _BSHWVAR_H_
-#define _BSHWVAR_H_
-
-/*
- * bshwvar.h
- * NEC 55 compatible board specific definitions
- */
-
-#define BSHW_DEFAULT_CHIPCLK 20 /* 20MHz */
-#define BSHW_DEFAULT_HOSTID 7
-
-struct bshw {
-#define BSHW_SYNC_RELOAD 0x01
-#define BSHW_SMFIFO 0x02
-#define BSHW_DOUBLE_DMACHAN 0x04
- u_int hw_flags;
- u_int hw_sregaddr;
-
- int ((*hw_dma_init)(struct ct_softc *));
- void ((*hw_dma_start)(struct ct_softc *));
- void ((*hw_dma_stop)(struct ct_softc *));
-};
-
-struct bshw_softc {
- int sc_hostid;
- int sc_irq; /* irq */
- int sc_drq; /* drq */
-
- /* dma transfer */
- u_int8_t *sc_segaddr;
- u_int8_t *sc_bufp;
- int sc_seglen;
- u_int sc_sdatalen; /* SMIT */
- u_int sc_edatalen; /* SMIT */
-
- /* private bounce */
- u_int8_t *sc_bounce_phys;
- u_int8_t *sc_bounce_addr;
- u_int sc_bounce_size;
- bus_addr_t sc_minphys;
-
- /* io control */
-#define BSHW_READ_INTERRUPT_DRIVEN 0x0001
-#define BSHW_WRITE_INTERRUPT_DRIVEN 0x0002
-#define BSHW_DMA_BLOCK 0x0010
-#define BSHW_SMIT_BLOCK 0x0020
- u_int sc_io_control;
-
- /* hardware */
- struct bshw *sc_hw;
- void ((*sc_dmasync_before))(struct ct_softc *);
- void ((*sc_dmasync_after))(struct ct_softc *);
-};
-
-void bshw_synch_setup(struct ct_softc *, struct targ_info *);
-void bshw_bus_reset(struct ct_softc *);
-int bshw_read_settings(struct ct_bus_access_handle *, struct bshw_softc *);
-int bshw_smit_xfer_start(struct ct_softc *);
-void bshw_smit_xfer_stop(struct ct_softc *);
-int bshw_dma_xfer_start(struct ct_softc *);
-void bshw_dma_xfer_stop(struct ct_softc *);
-
-extern struct dvcfg_hwsel bshw_hwsel;
-#endif /* !_BSHWVAR_H_ */
diff --git a/sys/dev/ct/ct.c b/sys/dev/ct/ct.c
deleted file mode 100644
index 6a96c9c486e6..000000000000
--- a/sys/dev/ct/ct.c
+++ /dev/null
@@ -1,1242 +0,0 @@
-/* $NecBSD: ct.c,v 1.13.12.5 2001/06/26 07:31:53 honda Exp $ */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-/* $NetBSD$ */
-
-#define CT_DEBUG
-#define CT_IO_CONTROL_FLAGS (CT_USE_CCSEQ | CT_FAST_INTR)
-
-/*-
- * [NetBSD for NEC PC-98 series]
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- * NetBSD/pc98 porting staff. All rights reserved.
- *
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- * Naofumi HONDA. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/rman.h>
-
-#include <machine/bus.h>
-
-#include <cam/scsi/scsi_low.h>
-
-#include <dev/ic/wd33c93reg.h>
-#include <dev/ct/ctvar.h>
-#include <dev/ct/ct_machdep.h>
-
-#define CT_NTARGETS 8
-#define CT_NLUNS 8
-#define CT_RESET_DEFAULT 2000
-#define CT_DELAY_MAX (2 * 1000 * 1000)
-#define CT_DELAY_INTERVAL (1)
-
-/***************************************************
- * DEBUG
- ***************************************************/
-#ifdef CT_DEBUG
-int ct_debug;
-#endif /* CT_DEBUG */
-
-/***************************************************
- * IO control
- ***************************************************/
-#define CT_USE_CCSEQ 0x0100
-#define CT_FAST_INTR 0x0200
-
-u_int ct_io_control = CT_IO_CONTROL_FLAGS;
-
-/***************************************************
- * default data
- ***************************************************/
-u_int8_t cthw_cmdlevel[256] = {
-/* 0 1 2 3 4 5 6 7 8 9 A B C E D F */
-/*0*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,1 ,0 ,0 ,0 ,0 ,0 ,
-/*1*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*2*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,1 ,0 ,0 ,0 ,0 ,0 ,
-/*3*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*4*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*5*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*6*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*7*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*8*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*9*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*A*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*B*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*C*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*D*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*E*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-/*F*/0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
-};
-
-#if 0
-/* default synch data table */
-/* A 10 6.6 5.0 4.0 3.3 2.8 2.5 2.0 M/s */
-/* X 100 150 200 250 300 350 400 500 ns */
-static struct ct_synch_data ct_synch_data_FSCSI[] = {
- {25, 0xa0}, {37, 0xb0}, {50, 0x20}, {62, 0xd0}, {75, 0x30},
- {87, 0xf0}, {100, 0x40}, {125, 0x50}, {0, 0}
-};
-
-static struct ct_synch_data ct_synch_data_SCSI[] = {
- {50, 0x20}, {75, 0x30}, {100, 0x40}, {125, 0x50}, {0, 0}
-};
-#endif
-/***************************************************
- * DEVICE STRUCTURE
- ***************************************************/
-extern struct cfdriver ct_cd;
-
-/*****************************************************************
- * Interface functions
- *****************************************************************/
-static int ct_xfer(struct ct_softc *, u_int8_t *, int, int, u_int *);
-static void ct_io_xfer(struct ct_softc *);
-static int ct_reselected(struct ct_softc *, u_int8_t);
-static void ct_phase_error(struct ct_softc *, u_int8_t);
-static int ct_start_selection(struct ct_softc *, struct slccb *);
-static int ct_msg(struct ct_softc *, struct targ_info *, u_int);
-static int ct_world_start(struct ct_softc *, int);
-static __inline void cthw_phase_bypass(struct ct_softc *, u_int8_t);
-static int cthw_chip_reset(struct ct_bus_access_handle *, int *, int, int);
-static void cthw_bus_reset(struct ct_softc *);
-static int ct_ccb_nexus_establish(struct ct_softc *);
-static int ct_lun_nexus_establish(struct ct_softc *);
-static int ct_target_nexus_establish(struct ct_softc *, int, int);
-static void cthw_attention(struct ct_softc *);
-static int ct_targ_init(struct ct_softc *, struct targ_info *, int);
-static int ct_unbusy(struct ct_softc *);
-static void ct_attention(struct ct_softc *);
-static struct ct_synch_data *ct_make_synch_table(struct ct_softc *);
-static int ct_catch_intr(struct ct_softc *);
-static int ct_poll(void *);
-
-struct scsi_low_funcs ct_funcs = {
- SC_LOW_INIT_T ct_world_start,
- SC_LOW_BUSRST_T cthw_bus_reset,
- SC_LOW_TARG_INIT_T ct_targ_init,
- SC_LOW_LUN_INIT_T NULL,
-
- SC_LOW_SELECT_T ct_start_selection,
- SC_LOW_NEXUS_T ct_lun_nexus_establish,
- SC_LOW_NEXUS_T ct_ccb_nexus_establish,
-
- SC_LOW_ATTEN_T cthw_attention,
- SC_LOW_MSG_T ct_msg,
-
- SC_LOW_TIMEOUT_T NULL,
- SC_LOW_POLL_T ct_poll,
-
- NULL, /* SC_LOW_POWER_T cthw_power, */
-};
-
-/**************************************************
- * HW functions
- **************************************************/
-static __inline void
-cthw_phase_bypass(struct ct_softc *ct, u_int8_t ph)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- ct_cr_write_1(chp, wd3s_cph, ph);
- ct_cr_write_1(chp, wd3s_cmd, WD3S_SELECT_ATN_TFR);
-}
-
-static void
-cthw_bus_reset(struct ct_softc *ct)
-{
-
- /*
- * wd33c93 does not have bus reset function.
- */
- if (ct->ct_bus_reset != NULL)
- ((*ct->ct_bus_reset) (ct));
-}
-
-static int
-cthw_chip_reset(struct ct_bus_access_handle *chp, int *chiprevp, int chipclk,
- int hostid)
-{
-#define CT_SELTIMEOUT_20MHz_REGV (0x80)
- u_int8_t aux, regv;
- u_int seltout;
- int wc;
-
- /* issue abort cmd */
- ct_cr_write_1(chp, wd3s_cmd, WD3S_ABORT);
- DELAY(1000); /* 1ms wait */
- (void) ct_stat_read_1(chp);
- (void) ct_cr_read_1(chp, wd3s_stat);
-
- /* setup chip registers */
- regv = 0;
- seltout = CT_SELTIMEOUT_20MHz_REGV;
- switch (chipclk)
- {
- case 8:
- case 10:
- seltout = (seltout * chipclk) / 20;
- regv = IDR_FS_8_10;
- break;
-
- case 12:
- case 15:
- seltout = (seltout * chipclk) / 20;
- regv = IDR_FS_12_15;
- break;
-
- case 16:
- case 20:
- seltout = (seltout * chipclk) / 20;
- regv = IDR_FS_16_20;
- break;
-
- default:
- panic("ct: illegal chip clk rate");
- break;
- }
-
- regv |= IDR_EHP | hostid | IDR_RAF | IDR_EAF;
- ct_cr_write_1(chp, wd3s_oid, regv);
-
- ct_cr_write_1(chp, wd3s_cmd, WD3S_RESET);
- for (wc = CT_RESET_DEFAULT; wc > 0; wc --)
- {
- aux = ct_stat_read_1(chp);
- if (aux != 0xff && (aux & STR_INT))
- {
- regv = ct_cr_read_1(chp, wd3s_stat);
- if (regv == BSR_RESET || regv == BSR_AFM_RESET)
- break;
-
- ct_cr_write_1(chp, wd3s_cmd, WD3S_RESET);
- }
- DELAY(1);
- }
- if (wc == 0)
- return ENXIO;
-
- ct_cr_write_1(chp, wd3s_tout, seltout);
- ct_cr_write_1(chp, wd3s_sid, SIDR_RESEL);
- ct_cr_write_1(chp, wd3s_ctrl, CR_DEFAULT);
- ct_cr_write_1(chp, wd3s_synch, 0);
- if (chiprevp != NULL)
- {
- *chiprevp = CT_WD33C93;
- if (regv == BSR_RESET)
- goto out;
-
- *chiprevp = CT_WD33C93_A;
- ct_cr_write_1(chp, wd3s_qtag, 0xaa);
- if (ct_cr_read_1(chp, wd3s_qtag) != 0xaa)
- {
- ct_cr_write_1(chp, wd3s_qtag, 0x0);
- goto out;
- }
- ct_cr_write_1(chp, wd3s_qtag, 0x55);
- if (ct_cr_read_1(chp, wd3s_qtag) != 0x55)
- {
- ct_cr_write_1(chp, wd3s_qtag, 0x0);
- goto out;
- }
- ct_cr_write_1(chp, wd3s_qtag, 0x0);
- *chiprevp = CT_WD33C93_B;
- }
-
-out:
- (void) ct_stat_read_1(chp);
- (void) ct_cr_read_1(chp, wd3s_stat);
- return 0;
-}
-
-static struct ct_synch_data *
-ct_make_synch_table(struct ct_softc *ct)
-{
- struct ct_synch_data *sdtp, *sdp;
- u_int base, i, period;
-
- sdtp = sdp = &ct->sc_default_sdt[0];
-
- if ((ct->sc_chipclk % 5) == 0)
- base = 1000 / (5 * 2); /* 5 MHz type */
- else
- base = 1000 / (4 * 2); /* 4 MHz type */
-
- if (ct->sc_chiprev >= CT_WD33C93_B)
- {
- /* fast scsi */
- for (i = 2; i < 8; i ++, sdp ++)
- {
- period = (base * i) / 2;
- if (period >= 200) /* 5 MHz */
- break;
- sdp->cs_period = period / 4;
- sdp->cs_syncr = (i * 0x10) | 0x80;
- }
- }
-
- for (i = 2; i < 8; i ++, sdp ++)
- {
- period = (base * i);
- if (period > 500) /* 2 MHz */
- break;
- sdp->cs_period = period / 4;
- sdp->cs_syncr = (i * 0x10);
- }
-
- sdp->cs_period = 0;
- sdp->cs_syncr = 0;
- return sdtp;
-}
-
-/**************************************************
- * Attach & Probe
- **************************************************/
-int
-ctprobesubr(struct ct_bus_access_handle *chp, u_int dvcfg, int hsid,
- u_int chipclk, int *chiprevp)
-{
-
-#if 0
- if ((ct_stat_read_1(chp) & STR_BSY) != 0)
- return 0;
-#endif
- if (cthw_chip_reset(chp, chiprevp, chipclk, hsid) != 0)
- return 0;
- return 1;
-}
-
-void
-ctattachsubr(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
-
- ct->sc_tmaxcnt = SCSI_LOW_MIN_TOUT * 1000 * 1000; /* default */
- slp->sl_funcs = &ct_funcs;
- slp->sl_flags |= HW_READ_PADDING;
- (void) scsi_low_attach(slp, 0, CT_NTARGETS, CT_NLUNS,
- sizeof(struct ct_targ_info), 0);
-}
-
-/**************************************************
- * SCSI LOW interface functions
- **************************************************/
-static void
-cthw_attention(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- ct->sc_atten = 1;
- if ((ct_stat_read_1(chp) & (STR_BSY | STR_CIP)) != 0)
- return;
-
- ct_cr_write_1(chp, wd3s_cmd, WD3S_ASSERT_ATN);
- DELAY(10);
- if ((ct_stat_read_1(chp) & STR_LCI) == 0)
- ct->sc_atten = 0;
- ct_unbusy(ct);
- return;
-}
-
-static void
-ct_attention(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
-
- if (slp->sl_atten == 0)
- {
- ct_unbusy(ct);
- scsi_low_attention(slp);
- }
- else if (ct->sc_atten != 0)
- {
- ct_unbusy(ct);
- cthw_attention(ct);
- }
-}
-
-static int
-ct_targ_init(struct ct_softc *ct, struct targ_info *ti, int action)
-{
- struct ct_targ_info *cti = (void *) ti;
-
- if (action == SCSI_LOW_INFO_ALLOC || action == SCSI_LOW_INFO_REVOKE)
- {
- if (ct->sc_sdp == NULL)
- {
- ct->sc_sdp = ct_make_synch_table(ct);
- }
-
- switch (ct->sc_chiprev)
- {
- default:
- ti->ti_maxsynch.offset = 5;
- break;
-
- case CT_WD33C93_A:
- case CT_AM33C93_A:
- ti->ti_maxsynch.offset = 12;
- break;
-
- case CT_WD33C93_B:
- case CT_WD33C93_C:
- ti->ti_maxsynch.offset = 12;
- break;
- }
-
- ti->ti_maxsynch.period = ct->sc_sdp[0].cs_period;
- ti->ti_width = SCSI_LOW_BUS_WIDTH_8;
- cti->cti_syncreg = 0;
- }
-
- return 0;
-}
-
-static int
-ct_world_start(struct ct_softc *ct, int fdone)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- if (ct->sc_sdp == NULL)
- {
- ct->sc_sdp = ct_make_synch_table(ct);
- }
-
- if (slp->sl_cfgflags & CFG_NOPARITY)
- ct->sc_creg = CR_DEFAULT;
- else
- ct->sc_creg = CR_DEFAULT_HP;
-
- if (ct->sc_dma & CT_DMA_DMASTART)
- (*ct->ct_dma_xfer_stop) (ct);
- if (ct->sc_dma & CT_DMA_PIOSTART)
- (*ct->ct_pio_xfer_stop) (ct);
- ct->sc_dma = 0;
- ct->sc_atten = 0;
-
- cthw_chip_reset(chp, NULL, ct->sc_chipclk, slp->sl_hostid);
- scsi_low_bus_reset(slp);
- cthw_chip_reset(chp, NULL, ct->sc_chipclk, slp->sl_hostid);
-
- return 0;
-}
-
-static int
-ct_start_selection(struct ct_softc *ct, struct slccb *cb)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
-
- struct targ_info *ti = slp->sl_Tnexus;
- struct lun_info *li = slp->sl_Lnexus;
- int s, satok;
- u_int8_t cmd;
-
- ct->sc_tmaxcnt = cb->ccb_tcmax * 1000 * 1000;
- ct->sc_atten = 0;
- satok = 0;
-
- if (scsi_low_is_disconnect_ok(cb) != 0)
- {
- if (ct->sc_chiprev >= CT_WD33C93_A)
- satok = 1;
- else if (cthw_cmdlevel[slp->sl_scp.scp_cmd[0]] != 0)
- satok = 1;
- }
-
- if (satok != 0 &&
- scsi_low_is_msgout_continue(ti, SCSI_LOW_MSG_IDENTIFY) == 0)
- {
- cmd = WD3S_SELECT_ATN_TFR;
- ct->sc_satgo = CT_SAT_GOING;
- }
- else
- {
- cmd = WD3S_SELECT_ATN;
- ct->sc_satgo = 0;
- }
-
- if ((ct_stat_read_1(chp) & (STR_BSY | STR_INT | STR_CIP)) != 0)
- return SCSI_LOW_START_FAIL;
-
- if ((ct->sc_satgo & CT_SAT_GOING) != 0)
- {
- (void) scsi_low_msgout(slp, ti, SCSI_LOW_MSGOUT_INIT);
- scsi_low_cmd(slp, ti);
- ct_cr_write_1(chp, wd3s_oid, slp->sl_scp.scp_cmdlen);
- ct_write_cmds(chp, slp->sl_scp.scp_cmd, slp->sl_scp.scp_cmdlen);
- }
- else
- {
- /* anyway attention assert */
- SCSI_LOW_ASSERT_ATN(slp);
- }
-
- ct_target_nexus_establish(ct, li->li_lun, slp->sl_scp.scp_direction);
-
- s = splhigh();
- if ((ct_stat_read_1(chp) & (STR_BSY | STR_INT | STR_CIP)) == 0)
- {
- /* XXX:
- * Reload a lun again here.
- */
- ct_cr_write_1(chp, wd3s_lun, li->li_lun);
- ct_cr_write_1(chp, wd3s_cmd, cmd);
- if ((ct_stat_read_1(chp) & STR_LCI) == 0)
- {
- splx(s);
- SCSI_LOW_SETUP_PHASE(ti, PH_SELSTART);
- return SCSI_LOW_START_OK;
- }
- }
- splx(s);
- return SCSI_LOW_START_FAIL;
-}
-
-static int
-ct_msg(struct ct_softc *ct, struct targ_info *ti, u_int msg)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct ct_targ_info *cti = (void *) ti;
- struct ct_synch_data *csp = ct->sc_sdp;
- u_int offset, period;
- int error;
-
- if ((msg & SCSI_LOW_MSG_WIDE) != 0)
- {
- if (ti->ti_width != SCSI_LOW_BUS_WIDTH_8)
- {
- ti->ti_width = SCSI_LOW_BUS_WIDTH_8;
- return EINVAL;
- }
- return 0;
- }
-
- if ((msg & SCSI_LOW_MSG_SYNCH) == 0)
- return 0;
-
- offset = ti->ti_maxsynch.offset;
- period = ti->ti_maxsynch.period;
- for ( ; csp->cs_period != 0; csp ++)
- {
- if (period == csp->cs_period)
- break;
- }
-
- if (ti->ti_maxsynch.period != 0 && csp->cs_period == 0)
- {
- ti->ti_maxsynch.period = 0;
- ti->ti_maxsynch.offset = 0;
- cti->cti_syncreg = 0;
- error = EINVAL;
- }
- else
- {
- cti->cti_syncreg = ((offset & 0x0f) | csp->cs_syncr);
- error = 0;
- }
-
- if (ct->ct_synch_setup != 0)
- (*ct->ct_synch_setup) (ct, ti);
- ct_cr_write_1(chp, wd3s_synch, cti->cti_syncreg);
- return error;
-}
-
-/*************************************************
- * <DATA PHASE>
- *************************************************/
-static int
-ct_xfer(struct ct_softc *ct, u_int8_t *data, int len, int direction,
- u_int *statp)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- int wc;
- register u_int8_t aux;
-
- *statp = 0;
- if (len == 1)
- {
- ct_cr_write_1(chp, wd3s_cmd, WD3S_SBT | WD3S_TFR_INFO);
- }
- else
- {
- cthw_set_count(chp, len);
- ct_cr_write_1(chp, wd3s_cmd, WD3S_TFR_INFO);
- }
-
- aux = ct_stat_read_1(chp);
- if ((aux & STR_LCI) != 0)
- {
- cthw_set_count(chp, 0);
- return len;
- }
-
- for (wc = 0; wc < ct->sc_tmaxcnt; wc ++)
- {
- /* check data ready */
- if ((aux & (STR_BSY | STR_DBR)) == (STR_BSY | STR_DBR))
- {
- if (direction == SCSI_LOW_READ)
- {
- *data = ct_cr_read_1(chp, wd3s_data);
- if ((aux & STR_PE) != 0)
- *statp |= SCSI_LOW_DATA_PE;
- }
- else
- {
- ct_cr_write_1(chp, wd3s_data, *data);
- }
- len --;
- if (len <= 0)
- break;
- data ++;
- }
- else
- {
- DELAY(1);
- }
-
- /* check phase miss */
- aux = ct_stat_read_1(chp);
- if ((aux & STR_INT) != 0)
- break;
- }
- return len;
-}
-
-#define CT_PADDING_BUF_SIZE 32
-
-static void
-ct_io_xfer(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct sc_p *sp = &slp->sl_scp;
- u_int stat;
- int len;
- u_int8_t pbuf[CT_PADDING_BUF_SIZE];
-
- /* polling mode */
- ct_cr_write_1(chp, wd3s_ctrl, ct->sc_creg);
-
- if (sp->scp_datalen <= 0)
- {
- slp->sl_error |= PDMAERR;
-
- if (slp->sl_scp.scp_direction == SCSI_LOW_WRITE)
- bzero(pbuf, CT_PADDING_BUF_SIZE);
- ct_xfer(ct, pbuf, CT_PADDING_BUF_SIZE,
- sp->scp_direction, &stat);
- }
- else
- {
- len = ct_xfer(ct, sp->scp_data, sp->scp_datalen,
- sp->scp_direction, &stat);
- sp->scp_data += (sp->scp_datalen - len);
- sp->scp_datalen = len;
- }
-}
-
-/**************************************************
- * <PHASE ERROR>
- **************************************************/
-struct ct_err {
- u_char *pe_msg;
- u_int pe_err;
- u_int pe_errmsg;
- int pe_done;
-};
-
-struct ct_err ct_cmderr[] = {
-/*0*/ { "illegal cmd", FATALIO, SCSI_LOW_MSG_ABORT, 1},
-/*1*/ { "unexpected bus free", FATALIO, 0, 1},
-/*2*/ { NULL, SELTIMEOUTIO, 0, 1},
-/*3*/ { "scsi bus parity error", PARITYERR, SCSI_LOW_MSG_ERROR, 0},
-/*4*/ { "scsi bus parity error", PARITYERR, SCSI_LOW_MSG_ERROR, 0},
-/*5*/ { "unknown" , FATALIO, SCSI_LOW_MSG_ABORT, 1},
-/*6*/ { "miss reselection (target mode)", FATALIO, SCSI_LOW_MSG_ABORT, 0},
-/*7*/ { "wrong status byte", PARITYERR, SCSI_LOW_MSG_ERROR, 0},
-};
-
-static void
-ct_phase_error(struct ct_softc *ct, u_int8_t scsi_status)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct targ_info *ti = slp->sl_Tnexus;
- struct ct_err *pep;
- u_int msg = 0;
-
- if ((scsi_status & BSR_CM) == BSR_CMDERR &&
- (scsi_status & BSR_PHVALID) == 0)
- {
- pep = &ct_cmderr[scsi_status & BSR_PM];
- slp->sl_error |= pep->pe_err;
- if ((pep->pe_err & PARITYERR) != 0)
- {
- if (ti->ti_phase == PH_MSGIN)
- msg = SCSI_LOW_MSG_PARITY;
- else
- msg = SCSI_LOW_MSG_ERROR;
- }
- else
- msg = pep->pe_errmsg;
-
- if (msg != 0)
- scsi_low_assert_msg(slp, slp->sl_Tnexus, msg, 1);
-
- if (pep->pe_msg != NULL)
- {
- device_printf(slp->sl_dev, "phase error: %s",
- pep->pe_msg);
- scsi_low_print(slp, slp->sl_Tnexus);
- }
-
- if (pep->pe_done != 0)
- scsi_low_disconnected(slp, ti);
- }
- else
- {
- slp->sl_error |= FATALIO;
- scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, "phase error");
- }
-}
-
-/**************************************************
- * ### SCSI PHASE SEQUENCER ###
- **************************************************/
-static int
-ct_reselected(struct ct_softc *ct, u_int8_t scsi_status)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct targ_info *ti;
- u_int sid;
- u_int8_t regv;
-
- ct->sc_atten = 0;
- ct->sc_satgo &= ~CT_SAT_GOING;
- regv = ct_cr_read_1(chp, wd3s_sid);
- if ((regv & SIDR_VALID) == 0)
- return EJUSTRETURN;
-
- sid = regv & SIDR_IDM;
- if ((ti = scsi_low_reselected(slp, sid)) == NULL)
- return EJUSTRETURN;
-
- ct_target_nexus_establish(ct, 0, SCSI_LOW_READ);
- if (scsi_status != BSR_AFM_RESEL)
- return EJUSTRETURN;
-
- SCSI_LOW_SETUP_PHASE(ti, PH_MSGIN);
- regv = ct_cr_read_1(chp, wd3s_data);
- if (scsi_low_msgin(slp, ti, (u_int) regv) == 0)
- {
- if (scsi_low_is_msgout_continue(ti, 0) != 0)
- {
- /* XXX: scsi_low_attetion */
- scsi_low_attention(slp);
- }
- }
-
- if (ct->sc_atten != 0)
- {
- ct_attention(ct);
- }
-
- ct_cr_write_1(chp, wd3s_cmd, WD3S_NEGATE_ACK);
- return EJUSTRETURN;
-}
-
-static int
-ct_target_nexus_establish(struct ct_softc *ct, int lun, int dir)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct targ_info *ti = slp->sl_Tnexus;
- struct ct_targ_info *cti = (void *) ti;
-
- if (dir == SCSI_LOW_WRITE)
- ct_cr_write_1(chp, wd3s_did, ti->ti_id);
- else
- ct_cr_write_1(chp, wd3s_did, ti->ti_id | DIDR_DPD);
- ct_cr_write_1(chp, wd3s_lun, lun);
- ct_cr_write_1(chp, wd3s_ctrl, ct->sc_creg | CR_DMA);
- ct_cr_write_1(chp, wd3s_cph, 0);
- ct_cr_write_1(chp, wd3s_synch, cti->cti_syncreg);
- cthw_set_count(chp, 0);
- return 0;
-}
-
-static int
-ct_lun_nexus_establish(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct lun_info *li = slp->sl_Lnexus;
-
- ct_cr_write_1(chp, wd3s_lun, li->li_lun);
- return 0;
-}
-
-static int
-ct_ccb_nexus_establish(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct lun_info *li = slp->sl_Lnexus;
- struct targ_info *ti = slp->sl_Tnexus;
- struct ct_targ_info *cti = (void *) ti;
- struct slccb *cb = slp->sl_Qnexus;
-
- ct->sc_tmaxcnt = cb->ccb_tcmax * 1000 * 1000;
-
- if ((ct->sc_satgo & CT_SAT_GOING) != 0)
- {
- ct_cr_write_1(chp, wd3s_oid, slp->sl_scp.scp_cmdlen);
- ct_write_cmds(chp, slp->sl_scp.scp_cmd, slp->sl_scp.scp_cmdlen);
- }
- if (slp->sl_scp.scp_direction == SCSI_LOW_WRITE)
- ct_cr_write_1(chp, wd3s_did, ti->ti_id);
- else
- ct_cr_write_1(chp, wd3s_did, ti->ti_id | DIDR_DPD);
- ct_cr_write_1(chp, wd3s_lun, li->li_lun);
- ct_cr_write_1(chp, wd3s_synch, cti->cti_syncreg);
- return 0;
-}
-
-static int
-ct_unbusy(struct ct_softc *ct)
-{
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- int wc;
- register u_int8_t regv;
-
- for (wc = 0; wc < CT_DELAY_MAX / CT_DELAY_INTERVAL; wc ++)
- {
- regv = ct_stat_read_1(chp);
- if ((regv & (STR_BSY | STR_CIP)) == 0)
- return 0;
- if (regv == (u_int8_t) -1)
- return EIO;
-
- DELAY(CT_DELAY_INTERVAL);
- }
-
- device_printf(slp->sl_dev, "unbusy timeout\n");
- return EBUSY;
-}
-
-static int
-ct_catch_intr(struct ct_softc *ct)
-{
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- int wc;
- register u_int8_t regv;
-
- for (wc = 0; wc < CT_DELAY_MAX / CT_DELAY_INTERVAL; wc ++)
- {
- regv = ct_stat_read_1(chp);
- if ((regv & (STR_INT | STR_BSY | STR_CIP)) == STR_INT)
- return 0;
-
- DELAY(CT_DELAY_INTERVAL);
- }
- return EJUSTRETURN;
-}
-
-void
-ctintr(void *arg)
-{
- struct ct_softc *ct = arg;
- struct scsi_low_softc *slp = &ct->sc_sclow;
-
- SCSI_LOW_LOCK(slp);
- ct_poll(ct);
- SCSI_LOW_UNLOCK(slp);
-}
-
-static int
-ct_poll(void *arg)
-{
- struct ct_softc *ct = arg;
- struct scsi_low_softc *slp = &ct->sc_sclow;
- struct ct_bus_access_handle *chp = &ct->sc_ch;
- struct targ_info *ti;
- struct buf *bp;
- u_int derror, flags;
- int len, satgo, error;
- u_int8_t scsi_status, regv;
-
-again:
- if (slp->sl_flags & HW_INACTIVE)
- return 0;
-
- /**************************************************
- * Get status & bus phase
- **************************************************/
- if ((ct_stat_read_1(chp) & STR_INT) == 0)
- return 0;
-
- scsi_status = ct_cr_read_1(chp, wd3s_stat);
- if (scsi_status == ((u_int8_t) -1))
- return 1;
-
- /**************************************************
- * Check reselection, or nexus
- **************************************************/
- if (scsi_status == BSR_RESEL || scsi_status == BSR_AFM_RESEL)
- {
- if (ct_reselected(ct, scsi_status) == EJUSTRETURN)
- return 1;
- }
-
- if ((ti = slp->sl_Tnexus) == NULL)
- return 1;
-
- /**************************************************
- * Debug section
- **************************************************/
-#ifdef CT_DEBUG
- if (ct_debug > 0)
- {
- scsi_low_print(slp, NULL);
- device_printf(slp->sl_dev, "scsi_status 0x%x\n\n",
- (u_int) scsi_status);
-#ifdef KDB
- if (ct_debug > 1)
- kdb_enter(KDB_WHY_CAM, "ct");
-#endif /* KDB */
- }
-#endif /* CT_DEBUG */
-
- /**************************************************
- * Internal scsi phase
- **************************************************/
- satgo = ct->sc_satgo;
- ct->sc_satgo &= ~CT_SAT_GOING;
-
- switch (ti->ti_phase)
- {
- case PH_SELSTART:
- if ((satgo & CT_SAT_GOING) == 0)
- {
- if (scsi_status != BSR_SELECTED)
- {
- ct_phase_error(ct, scsi_status);
- return 1;
- }
- scsi_low_arbit_win(slp);
- SCSI_LOW_SETUP_PHASE(ti, PH_SELECTED);
- return 1;
- }
- else
- {
- scsi_low_arbit_win(slp);
- SCSI_LOW_SETUP_PHASE(ti, PH_MSGOUT); /* XXX */
- }
- break;
-
- case PH_RESEL:
- if ((scsi_status & BSR_PHVALID) == 0 ||
- (scsi_status & BSR_PM) != BSR_MSGIN)
- {
- scsi_low_restart(slp, SCSI_LOW_RESTART_HARD,
- "phase miss after reselect");
- return 1;
- }
- break;
-
- default:
- if (slp->sl_flags & HW_PDMASTART)
- {
- slp->sl_flags &= ~HW_PDMASTART;
- if (ct->sc_dma & CT_DMA_DMASTART)
- {
- (*ct->ct_dma_xfer_stop) (ct);
- ct->sc_dma &= ~CT_DMA_DMASTART;
- }
- else if (ct->sc_dma & CT_DMA_PIOSTART)
- {
- (*ct->ct_pio_xfer_stop) (ct);
- ct->sc_dma &= ~CT_DMA_PIOSTART;
- }
- else
- {
- scsi_low_data_finish(slp);
- }
- }
- break;
- }
-
- /**************************************************
- * parse scsi phase
- **************************************************/
- if (scsi_status & BSR_PHVALID)