diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index 9906c9b413eb..79eb917aa4ec 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -1,198 +1,197 @@ # $FreeBSD$ DISABLE_PSE IDE_DELAY USER_LDT MATH_EMULATE opt_math_emulate.h GPL_MATH_EMULATE opt_math_emulate.h PMAP_SHPGPERPROC opt_pmap.h IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h DEBUG_LINUX opt_linux.h PPC_DEBUG opt_ppc.h SHOW_BUSYBUFS TUNE_1542 PANIC_REBOOT_WAIT_TIME opt_panic.h MAXMEM PERFMON opt_perfmon.h POWERFAIL_NMI opt_trap.h AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h BREAK_TO_DEBUGGER opt_comconsole.h CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h # i386 SMP options APIC_IO opt_global.h NAPIC opt_smp.h NINTR opt_smp.h CLK_CALIBRATION_LOOP opt_clock.h CLK_USE_I8254_CALIBRATION opt_clock.h CLK_USE_TSC_CALIBRATION opt_clock.h TIMER_FREQ opt_clock.h NO_F00F_HACK opt_cpu.h CPU_BLUELIGHTNING_FPU_OP_CACHE opt_cpu.h CPU_BLUELIGHTNING_3X 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_FASTER_5X86_FPU opt_cpu.h CPU_I486_ON_386 opt_cpu.h CPU_IORT opt_cpu.h CPU_LOOP_EN opt_cpu.h CPU_RSTK_EN opt_cpu.h CPU_SUSP_HLT opt_cpu.h CPU_UPGRADE_HW_CACHE opt_cpu.h CPU_WT_ALLOC opt_cpu.h CYRIX_CACHE_WORKS opt_cpu.h CYRIX_CACHE_REALLY_WORKS opt_cpu.h NO_MEMORY_HOLE opt_cpu.h # The CPU type affects the endian conversion functions all over the kernel. I386_CPU opt_global.h I486_CPU opt_global.h I586_CPU opt_global.h I686_CPU opt_global.h MAXCONS opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h SC_DISABLE_DDBKEY opt_syscons.h SC_DISABLE_REBOOT opt_syscons.h SC_HISTORY_SIZE opt_syscons.h SC_MOUSE_CHAR opt_syscons.h SC_NO_CUTPASTE opt_syscons.h SC_NO_FONT_LOADING opt_syscons.h SC_NO_HISTORY opt_syscons.h SC_NO_SYSMOUSE opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_VIDEO_DEBUG opt_syscons.h FB_DEBUG opt_fb.h FB_INSTALL_CDEV opt_fb.h GDC opt_gdc.h PSM_HOOKAPM opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h PSM_DEBUG opt_psm.h PCIC_RESUME_RESET opt_pcic.h KBD_DISABLE_KEYMAP_LOAD opt_kbd.h KBD_INSTALL_CDEV opt_kbd.h KBD_MAXRETRY opt_kbd.h KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h KBDIO_DEBUG opt_kbd.h USERCONFIG opt_userconfig.h VISUAL_USERCONFIG opt_userconfig.h INTRO_USERCONFIG opt_userconfig.h EISA_SLOTS opt_eisa.h FE_8BIT_SUPPORT opt_fe.h # pcvt(4) has a bunch of options FAT_CURSOR opt_pcvt.h XSERVER opt_pcvt.h PCVT_24LINESDEF opt_pcvt.h PCVT_CTRL_ALT_DEL opt_pcvt.h PCVT_EMU_MOUSE opt_pcvt.h PCVT_FREEBSD opt_pcvt.h PCVT_META_ESC opt_pcvt.h PCVT_NSCREENS opt_pcvt.h PCVT_PRETTYSCRNS opt_pcvt.h PCVT_SCANSET opt_pcvt.h PCVT_SCREENSAVER opt_pcvt.h PCVT_USEKBDSEC opt_pcvt.h PCVT_VT220KEYB opt_pcvt.h # voxware options GUS_DMA2 opt_sound.h GUS_DMA opt_sound.h GUS_IRQ opt_sound.h # Video spigot SPIGOT_UNSECURE opt_spigot.h # ------------------------------- # isdn4bsd: passive ISA cards # ------------------------------- TEL_S0_8 opt_i4b.h TEL_S0_16 opt_i4b.h TEL_S0_16_3 opt_i4b.h AVM_A1 opt_i4b.h USR_STI opt_i4b.h ITKIX1 opt_i4b.h ELSA_PCC16 opt_i4b.h # ------------------------------- # isdn4bsd: passive ISA PnP cards # ------------------------------- CRTX_S0_P opt_i4b.h DRN_NGO opt_i4b.h TEL_S0_16_3_P opt_i4b.h SEDLBAUER opt_i4b.h DYNALINK opt_i4b.h ASUSCOM_IPAC opt_i4b.h ELSA_QS1ISA opt_i4b.h AVM_PNP opt_i4b.h SIEMENS_ISURF2 opt_i4b.h # ------------------------------- # isdn4bsd: passive PCI cards # ------------------------------- ELSA_QS1PCI opt_i4b.h AVM_A1_PCI opt_i4b.h # ------------------------------- # isdn4bsd: passive PCMCIA cards # ------------------------------- AVM_A1_PCMCIA opt_i4b.h # ------------------------------- # isdn4bsd: misc options # ------------------------------- # temporary workaround for SMP machines I4B_SMP_WORKAROUND opt_i4b.h # enable VJ compression code for ipr i/f IPR_VJ opt_i4b.h # ------------------------------- # oltr: build options # ------------------------------- # Exclude microcode options OLTR_NO_TMS_MAC opt_oltr.h OLTR_NO_HAWKEYE_MAC opt_oltr.h OLTR_NO_BULLSEYE_MAC opt_oltr.h # Total number of ports controlled by the dgb(4) driver. # Defaults to NDGB*16. NDGBPORTS opt_dgb.h # ------------------------------- # EOF # ------------------------------- # bs driver options SCSI_BOUNCE_SIZE opt_bs.h BS_TARG_SAFEMODE opt_bs.h # npx options FPU_ERROR_BROKEN opt_npx.h # PC98 options PC98 opt_global.h EPSON_BOUNCEDMA opt_pc98.h EPSON_MEMWIN opt_pc98.h -COMPAT_ATDISK opt_pc98.h LINE30 opt_syscons.h diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC index 66e768143252..991733b6f7bd 100644 --- a/sys/pc98/conf/GENERIC +++ b/sys/pc98/conf/GENERIC @@ -1,273 +1,269 @@ # # GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # # http://www.freebsd.org/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.ORG/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ./LINT configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in LINT. # # $FreeBSD$ # GENERIC98 -- Generic PC98 machine with WD/SCSI disks machine pc98 cpu I386_CPU cpu I486_CPU cpu I586_CPU cpu I686_CPU ident GENERIC98 maxusers 32 #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options PC98 #PC98 options MATH_EMULATE #Support for x87 emulation options INET #InterNETworking options FFS #Berkeley Fast Filesystem options FFS_ROOT #FFS usable as root device [keep this!] options MFS #Memory Filesystem options MFS_ROOT #MFS usable as root device, "MFS" req'ed options NFS #Network Filesystem options NFS_ROOT #NFS usable as root device, "NFS" req'ed options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options CD9660_ROOT #CD-ROM usable as root. "CD9660" req'ed options PROCFS #Process filesystem options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device options EPSON_BOUNCEDMA #use bounce buufer for 15-16M #options EPSON_MEMWIN #EPSON memory window support options UCONSOLE #Allow users to grab the console #options LINE30 options USERCONFIG #boot -c editor options VISUAL_USERCONFIG #visual boot -c editor options KTRACE #ktrace(1) syscall trace support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options COM_MULTIPORT -# -# IBM-PC HDD support -#options COMPAT_ATDISK - # To make an SMP kernel, the next two are needed #options SMP # Symmetric MultiProcessor Kernel #options APIC_IO # Symmetric (APIC) I/O # Optionally these may need tweaked, (defaults shown): #options NCPU=2 # number of CPUs #options NBUS=4 # number of busses #options NAPIC=1 # number of IO APICs #options NINTR=24 # number of INTs controller isa0 controller pnp0 # PnP support for ISA controller pci0 # Floppy drives controller fdc0 at isa? port IO_FD1 irq 11 drq 2 disk fd0 at fdc0 drive 0 disk fd1 at fdc0 drive 1 disk fd2 at fdc0 drive 2 disk fd3 at fdc0 drive 3 # IDE controller and disks controller wdc0 at isa? port IO_WD1 irq 9 disk wd0 at wdc0 drive 0 #disk wd1 at wdc0 drive 1 #disk wd2 at wdc0 drive 2 #disk wd3 at wdc0 drive 3 # ATAPI devices on wdc? device wcd0 #IDE CD-ROM #device wfd0 #IDE Floppy (e.g. LS-120) #device wst0 #IDE Tape (e.g. Travan) # SCSI Controllers # A single entry for any of these controllers (ncr, ahb, ahc) is # sufficient for any number of installed devices. controller ncr0 # NCR/Symbios Logic controller ahc0 # AHA2940 and onboard AIC7xxx devices controller isp0 # Qlogic family controller adv0 # # WD33C93 SCSI card (55/92 like board) # options BS_TARG_SAFEMODE # PC-9801-92 controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0 # SC-98 # controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x10000 # HA-55BS2 and later #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x20000 # ELECOM type #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x30000 # SMIT #controller bs0 at isa? port IO_SCSI irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 # Logitec LHA-20x #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x50000 # SCSI peripherals # Only one of each of these is needed, they are dynamically allocated. controller scbus0 # SCSI bus (required) device da0 # Direct Access (disks) device sa0 # Sequential Access (tape etc) device cd0 # CD device pass0 # Passthrough device (direct SCSI access) # Proprietary or custom CD-ROM Interfaces controller matcd0 at isa? port? # keyboard driver device pckbd0 at isa? port IO_KBD irq 1 #options KBD_INSTALL_CDEV device gdc0 at isa? # splash screen/screen saver pseudo-device splash device sc0 at isa? # Floating point support - do not disable. device npx0 at nexus? port IO_NPX irq 8 # Power management support (see LINT for more options) device apm0 at nexus? disable flags 0x31 # Advanced Power Management # PCCARD (PCMCIA) support #controller card0 #device pcic0 at card? #device pcic1 at card? # Serial (COM) ports # # COM1 device sio0 at isa? port IO_COM1 irq 4 # COM2 (2nd CCU) device sio1 at isa? port 0x238 irq 5 flags 0x12000000 # PC-9861K, PC-9801-101, MDC-926Rs #device sio1 at isa? port IO_COM2 irq 5 flags 0x01000000 #device sio2 at isa? port IO_COM3 irq 6 flags 0x02000000 # PC-9801-120 (PnP off) #device sio1 at isa? port 0x8b0 irq 5 flags 0x11000000 # MC-16550II, MC-RS98 #device sio1 at isa? port 0xd2 irq 5 flags 0x14000101 #device sio2 at isa? port 0x8d2 flags 0x14000101 # RSB-2000, RSB-3000, B98-02 #device sio1 at isa? port 0xb0 flags 0x15000101 #device sio2 at isa? port 0xb1 flags 0x15000101 # RSB-384 #device sio1 at isa? port 0xb0 flags 0x16000000 #device sio2 at isa? port 0xb1 flags 0x16000000 # RSA-98III #device sio1 at isa? port 0x50e0 irq 5 flags 0x18000101 #device sio2 at isa? port 0x51e0 flags 0x18000101 # ESP98 #options COM_ESP #device sio1 at isa? port 0x18b0 irq 5 flags 0x19000000 device mse0 at isa? port IO_MSE irq 13 # NEW Parallel port device ppc0 at isa? port? irq 14 controller ppbus0 device lpt0 at ppbus? device plip0 at ppbus? device ppi0 at ppbus? #controller vpo0 at ppbus? # OLD Parallel port # Please stay olpt driver after ppc driver device olpt0 at isa? port IO_LPT # MII bus support, required for some 10/100 NICs controller miibus0 # PCI Ethernet NICs. device al0 # ADMtek AL981 (``Comet'') device ax0 # ASIX AX88140A device de0 # DEC/Intel DC21x4x (``Tulip'') device fxp0 # Intel EtherExpress PRO/100B (82557, 82558) device mx0 # Macronix 98713/98715/98725 (``PMAC'') device pn0 # Lite-On 82c168/82c169 (``PNIC'') device rl0 # RealTek 8129/8139 device sf0 # Adaptec AIC-6915 (``Starfire'') device ste0 # Sundance ST201 (D-Link DFE-550TX) device tl0 # Texas Instruments ThunderLAN device tx0 # SMC 9432TX (83c170 ``EPIC'') device vr0 # VIA Rhine, Rhine II device vx0 # 3Com 3c590, 3c595 (``Vortex'') device wb0 # Winbond W89C840F device xl0 # 3Com 3c90x (``Boomerang'', ``Cyclone'') # # DP8390 NIC # # ed0: generic driver # ed1: LANEED LD-BDN # ed2: EGY-98 # ed3: LGY-98 # ed4: ICM-IF-2766/EN-2298-T # ed5: SIC-98 # ed6: PC-9801-108 # ed7: LA-98 # ed8: C-NET(98) # ed9: C-NET(98)E/L # fe0: RE1000/1000Plus/AccessPC N98C+/LAC-98 # fe1: C-NET(98)P2/C-NET(9N)E # # FE_8BIT_SUPPORT is needed to support LAC-98 # device ed0 at isa? port 0x00d0 irq 6 device ed5 at isa? port 0x00d0 irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 device ed1 at isa? port 0x00d8 irq 6 flags 0x200000 device ed3 at isa? port 0x00d0 irq 6 flags 0x400000 device ed4 at isa? port 0x56d0 irq 5 flags 0x500000 device ed2 at isa? port 0x00d8 irq 6 flags 0x300000 device ed7 at isa? port 0x00d0 irq 6 flags 0x900000 device ed6 at isa? port 0x0770 irq 6 flags 0x800000 device ed9 at isa? port 0x03d0 irq 6 flags 0xb00000 device ed8 at isa? port 0xa3d0 irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 device ep0 at isa? port 0x40d0 irq 3 device fe0 at isa? port 0x00d0 irq 3 device fe1 at isa? port 0x73d0 irq 5 device lnc0 at isa? port 0x03d0 irq 6 #device zp0 at isa? port 0x00d0 irq 10 iomem 0xe0000 options FE_8BIT_SUPPORT # LAC-98 support #controller snd0 #device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 #device sbxvi0 at isa? drq 3 #device sbmidi0 at isa? port 0x80d2 #device opl0 at isa? port 0x28d2 #device pcm0 at isa? port 0xa460 irq 12 #device mss0 at isa? port 0xf40 irq 12 drq 1 # Pseudo devices - the number indicates how many units to allocated. pseudo-device loop # Network loopback pseudo-device ether # Ethernet support pseudo-device sl 1 # Kernel SLIP pseudo-device ppp 1 # Kernel PPP pseudo-device tun # Packet tunnel, for ppp(1) pseudo-device pty # Pseudo-ttys (telnet etc) pseudo-device gzip # Exec gzipped a.out's # The `bpf' pseudo-device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! pseudo-device bpf #Berkeley packet filter pseudo-device compat_atdisk diff --git a/sys/pc98/conf/GENERIC98 b/sys/pc98/conf/GENERIC98 index 66e768143252..991733b6f7bd 100644 --- a/sys/pc98/conf/GENERIC98 +++ b/sys/pc98/conf/GENERIC98 @@ -1,273 +1,269 @@ # # GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # # http://www.freebsd.org/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.ORG/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ./LINT configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in LINT. # # $FreeBSD$ # GENERIC98 -- Generic PC98 machine with WD/SCSI disks machine pc98 cpu I386_CPU cpu I486_CPU cpu I586_CPU cpu I686_CPU ident GENERIC98 maxusers 32 #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options PC98 #PC98 options MATH_EMULATE #Support for x87 emulation options INET #InterNETworking options FFS #Berkeley Fast Filesystem options FFS_ROOT #FFS usable as root device [keep this!] options MFS #Memory Filesystem options MFS_ROOT #MFS usable as root device, "MFS" req'ed options NFS #Network Filesystem options NFS_ROOT #NFS usable as root device, "NFS" req'ed options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options CD9660_ROOT #CD-ROM usable as root. "CD9660" req'ed options PROCFS #Process filesystem options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device options EPSON_BOUNCEDMA #use bounce buufer for 15-16M #options EPSON_MEMWIN #EPSON memory window support options UCONSOLE #Allow users to grab the console #options LINE30 options USERCONFIG #boot -c editor options VISUAL_USERCONFIG #visual boot -c editor options KTRACE #ktrace(1) syscall trace support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options COM_MULTIPORT -# -# IBM-PC HDD support -#options COMPAT_ATDISK - # To make an SMP kernel, the next two are needed #options SMP # Symmetric MultiProcessor Kernel #options APIC_IO # Symmetric (APIC) I/O # Optionally these may need tweaked, (defaults shown): #options NCPU=2 # number of CPUs #options NBUS=4 # number of busses #options NAPIC=1 # number of IO APICs #options NINTR=24 # number of INTs controller isa0 controller pnp0 # PnP support for ISA controller pci0 # Floppy drives controller fdc0 at isa? port IO_FD1 irq 11 drq 2 disk fd0 at fdc0 drive 0 disk fd1 at fdc0 drive 1 disk fd2 at fdc0 drive 2 disk fd3 at fdc0 drive 3 # IDE controller and disks controller wdc0 at isa? port IO_WD1 irq 9 disk wd0 at wdc0 drive 0 #disk wd1 at wdc0 drive 1 #disk wd2 at wdc0 drive 2 #disk wd3 at wdc0 drive 3 # ATAPI devices on wdc? device wcd0 #IDE CD-ROM #device wfd0 #IDE Floppy (e.g. LS-120) #device wst0 #IDE Tape (e.g. Travan) # SCSI Controllers # A single entry for any of these controllers (ncr, ahb, ahc) is # sufficient for any number of installed devices. controller ncr0 # NCR/Symbios Logic controller ahc0 # AHA2940 and onboard AIC7xxx devices controller isp0 # Qlogic family controller adv0 # # WD33C93 SCSI card (55/92 like board) # options BS_TARG_SAFEMODE # PC-9801-92 controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0 # SC-98 # controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x10000 # HA-55BS2 and later #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x20000 # ELECOM type #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x30000 # SMIT #controller bs0 at isa? port IO_SCSI irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 # Logitec LHA-20x #controller bs0 at isa? port IO_SCSI irq 5 drq 3 flags 0x50000 # SCSI peripherals # Only one of each of these is needed, they are dynamically allocated. controller scbus0 # SCSI bus (required) device da0 # Direct Access (disks) device sa0 # Sequential Access (tape etc) device cd0 # CD device pass0 # Passthrough device (direct SCSI access) # Proprietary or custom CD-ROM Interfaces controller matcd0 at isa? port? # keyboard driver device pckbd0 at isa? port IO_KBD irq 1 #options KBD_INSTALL_CDEV device gdc0 at isa? # splash screen/screen saver pseudo-device splash device sc0 at isa? # Floating point support - do not disable. device npx0 at nexus? port IO_NPX irq 8 # Power management support (see LINT for more options) device apm0 at nexus? disable flags 0x31 # Advanced Power Management # PCCARD (PCMCIA) support #controller card0 #device pcic0 at card? #device pcic1 at card? # Serial (COM) ports # # COM1 device sio0 at isa? port IO_COM1 irq 4 # COM2 (2nd CCU) device sio1 at isa? port 0x238 irq 5 flags 0x12000000 # PC-9861K, PC-9801-101, MDC-926Rs #device sio1 at isa? port IO_COM2 irq 5 flags 0x01000000 #device sio2 at isa? port IO_COM3 irq 6 flags 0x02000000 # PC-9801-120 (PnP off) #device sio1 at isa? port 0x8b0 irq 5 flags 0x11000000 # MC-16550II, MC-RS98 #device sio1 at isa? port 0xd2 irq 5 flags 0x14000101 #device sio2 at isa? port 0x8d2 flags 0x14000101 # RSB-2000, RSB-3000, B98-02 #device sio1 at isa? port 0xb0 flags 0x15000101 #device sio2 at isa? port 0xb1 flags 0x15000101 # RSB-384 #device sio1 at isa? port 0xb0 flags 0x16000000 #device sio2 at isa? port 0xb1 flags 0x16000000 # RSA-98III #device sio1 at isa? port 0x50e0 irq 5 flags 0x18000101 #device sio2 at isa? port 0x51e0 flags 0x18000101 # ESP98 #options COM_ESP #device sio1 at isa? port 0x18b0 irq 5 flags 0x19000000 device mse0 at isa? port IO_MSE irq 13 # NEW Parallel port device ppc0 at isa? port? irq 14 controller ppbus0 device lpt0 at ppbus? device plip0 at ppbus? device ppi0 at ppbus? #controller vpo0 at ppbus? # OLD Parallel port # Please stay olpt driver after ppc driver device olpt0 at isa? port IO_LPT # MII bus support, required for some 10/100 NICs controller miibus0 # PCI Ethernet NICs. device al0 # ADMtek AL981 (``Comet'') device ax0 # ASIX AX88140A device de0 # DEC/Intel DC21x4x (``Tulip'') device fxp0 # Intel EtherExpress PRO/100B (82557, 82558) device mx0 # Macronix 98713/98715/98725 (``PMAC'') device pn0 # Lite-On 82c168/82c169 (``PNIC'') device rl0 # RealTek 8129/8139 device sf0 # Adaptec AIC-6915 (``Starfire'') device ste0 # Sundance ST201 (D-Link DFE-550TX) device tl0 # Texas Instruments ThunderLAN device tx0 # SMC 9432TX (83c170 ``EPIC'') device vr0 # VIA Rhine, Rhine II device vx0 # 3Com 3c590, 3c595 (``Vortex'') device wb0 # Winbond W89C840F device xl0 # 3Com 3c90x (``Boomerang'', ``Cyclone'') # # DP8390 NIC # # ed0: generic driver # ed1: LANEED LD-BDN # ed2: EGY-98 # ed3: LGY-98 # ed4: ICM-IF-2766/EN-2298-T # ed5: SIC-98 # ed6: PC-9801-108 # ed7: LA-98 # ed8: C-NET(98) # ed9: C-NET(98)E/L # fe0: RE1000/1000Plus/AccessPC N98C+/LAC-98 # fe1: C-NET(98)P2/C-NET(9N)E # # FE_8BIT_SUPPORT is needed to support LAC-98 # device ed0 at isa? port 0x00d0 irq 6 device ed5 at isa? port 0x00d0 irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 device ed1 at isa? port 0x00d8 irq 6 flags 0x200000 device ed3 at isa? port 0x00d0 irq 6 flags 0x400000 device ed4 at isa? port 0x56d0 irq 5 flags 0x500000 device ed2 at isa? port 0x00d8 irq 6 flags 0x300000 device ed7 at isa? port 0x00d0 irq 6 flags 0x900000 device ed6 at isa? port 0x0770 irq 6 flags 0x800000 device ed9 at isa? port 0x03d0 irq 6 flags 0xb00000 device ed8 at isa? port 0xa3d0 irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 device ep0 at isa? port 0x40d0 irq 3 device fe0 at isa? port 0x00d0 irq 3 device fe1 at isa? port 0x73d0 irq 5 device lnc0 at isa? port 0x03d0 irq 6 #device zp0 at isa? port 0x00d0 irq 10 iomem 0xe0000 options FE_8BIT_SUPPORT # LAC-98 support #controller snd0 #device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 #device sbxvi0 at isa? drq 3 #device sbmidi0 at isa? port 0x80d2 #device opl0 at isa? port 0x28d2 #device pcm0 at isa? port 0xa460 irq 12 #device mss0 at isa? port 0xf40 irq 12 drq 1 # Pseudo devices - the number indicates how many units to allocated. pseudo-device loop # Network loopback pseudo-device ether # Ethernet support pseudo-device sl 1 # Kernel SLIP pseudo-device ppp 1 # Kernel PPP pseudo-device tun # Packet tunnel, for ppp(1) pseudo-device pty # Pseudo-ttys (telnet etc) pseudo-device gzip # Exec gzipped a.out's # The `bpf' pseudo-device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! pseudo-device bpf #Berkeley packet filter pseudo-device compat_atdisk diff --git a/sys/pc98/conf/options.pc98 b/sys/pc98/conf/options.pc98 index 9906c9b413eb..79eb917aa4ec 100644 --- a/sys/pc98/conf/options.pc98 +++ b/sys/pc98/conf/options.pc98 @@ -1,198 +1,197 @@ # $FreeBSD$ DISABLE_PSE IDE_DELAY USER_LDT MATH_EMULATE opt_math_emulate.h GPL_MATH_EMULATE opt_math_emulate.h PMAP_SHPGPERPROC opt_pmap.h IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h DEBUG_LINUX opt_linux.h PPC_DEBUG opt_ppc.h SHOW_BUSYBUFS TUNE_1542 PANIC_REBOOT_WAIT_TIME opt_panic.h MAXMEM PERFMON opt_perfmon.h POWERFAIL_NMI opt_trap.h AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h BREAK_TO_DEBUGGER opt_comconsole.h CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h # i386 SMP options APIC_IO opt_global.h NAPIC opt_smp.h NINTR opt_smp.h CLK_CALIBRATION_LOOP opt_clock.h CLK_USE_I8254_CALIBRATION opt_clock.h CLK_USE_TSC_CALIBRATION opt_clock.h TIMER_FREQ opt_clock.h NO_F00F_HACK opt_cpu.h CPU_BLUELIGHTNING_FPU_OP_CACHE opt_cpu.h CPU_BLUELIGHTNING_3X 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_FASTER_5X86_FPU opt_cpu.h CPU_I486_ON_386 opt_cpu.h CPU_IORT opt_cpu.h CPU_LOOP_EN opt_cpu.h CPU_RSTK_EN opt_cpu.h CPU_SUSP_HLT opt_cpu.h CPU_UPGRADE_HW_CACHE opt_cpu.h CPU_WT_ALLOC opt_cpu.h CYRIX_CACHE_WORKS opt_cpu.h CYRIX_CACHE_REALLY_WORKS opt_cpu.h NO_MEMORY_HOLE opt_cpu.h # The CPU type affects the endian conversion functions all over the kernel. I386_CPU opt_global.h I486_CPU opt_global.h I586_CPU opt_global.h I686_CPU opt_global.h MAXCONS opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h SC_DISABLE_DDBKEY opt_syscons.h SC_DISABLE_REBOOT opt_syscons.h SC_HISTORY_SIZE opt_syscons.h SC_MOUSE_CHAR opt_syscons.h SC_NO_CUTPASTE opt_syscons.h SC_NO_FONT_LOADING opt_syscons.h SC_NO_HISTORY opt_syscons.h SC_NO_SYSMOUSE opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_VIDEO_DEBUG opt_syscons.h FB_DEBUG opt_fb.h FB_INSTALL_CDEV opt_fb.h GDC opt_gdc.h PSM_HOOKAPM opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h PSM_DEBUG opt_psm.h PCIC_RESUME_RESET opt_pcic.h KBD_DISABLE_KEYMAP_LOAD opt_kbd.h KBD_INSTALL_CDEV opt_kbd.h KBD_MAXRETRY opt_kbd.h KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h KBDIO_DEBUG opt_kbd.h USERCONFIG opt_userconfig.h VISUAL_USERCONFIG opt_userconfig.h INTRO_USERCONFIG opt_userconfig.h EISA_SLOTS opt_eisa.h FE_8BIT_SUPPORT opt_fe.h # pcvt(4) has a bunch of options FAT_CURSOR opt_pcvt.h XSERVER opt_pcvt.h PCVT_24LINESDEF opt_pcvt.h PCVT_CTRL_ALT_DEL opt_pcvt.h PCVT_EMU_MOUSE opt_pcvt.h PCVT_FREEBSD opt_pcvt.h PCVT_META_ESC opt_pcvt.h PCVT_NSCREENS opt_pcvt.h PCVT_PRETTYSCRNS opt_pcvt.h PCVT_SCANSET opt_pcvt.h PCVT_SCREENSAVER opt_pcvt.h PCVT_USEKBDSEC opt_pcvt.h PCVT_VT220KEYB opt_pcvt.h # voxware options GUS_DMA2 opt_sound.h GUS_DMA opt_sound.h GUS_IRQ opt_sound.h # Video spigot SPIGOT_UNSECURE opt_spigot.h # ------------------------------- # isdn4bsd: passive ISA cards # ------------------------------- TEL_S0_8 opt_i4b.h TEL_S0_16 opt_i4b.h TEL_S0_16_3 opt_i4b.h AVM_A1 opt_i4b.h USR_STI opt_i4b.h ITKIX1 opt_i4b.h ELSA_PCC16 opt_i4b.h # ------------------------------- # isdn4bsd: passive ISA PnP cards # ------------------------------- CRTX_S0_P opt_i4b.h DRN_NGO opt_i4b.h TEL_S0_16_3_P opt_i4b.h SEDLBAUER opt_i4b.h DYNALINK opt_i4b.h ASUSCOM_IPAC opt_i4b.h ELSA_QS1ISA opt_i4b.h AVM_PNP opt_i4b.h SIEMENS_ISURF2 opt_i4b.h # ------------------------------- # isdn4bsd: passive PCI cards # ------------------------------- ELSA_QS1PCI opt_i4b.h AVM_A1_PCI opt_i4b.h # ------------------------------- # isdn4bsd: passive PCMCIA cards # ------------------------------- AVM_A1_PCMCIA opt_i4b.h # ------------------------------- # isdn4bsd: misc options # ------------------------------- # temporary workaround for SMP machines I4B_SMP_WORKAROUND opt_i4b.h # enable VJ compression code for ipr i/f IPR_VJ opt_i4b.h # ------------------------------- # oltr: build options # ------------------------------- # Exclude microcode options OLTR_NO_TMS_MAC opt_oltr.h OLTR_NO_HAWKEYE_MAC opt_oltr.h OLTR_NO_BULLSEYE_MAC opt_oltr.h # Total number of ports controlled by the dgb(4) driver. # Defaults to NDGB*16. NDGBPORTS opt_dgb.h # ------------------------------- # EOF # ------------------------------- # bs driver options SCSI_BOUNCE_SIZE opt_bs.h BS_TARG_SAFEMODE opt_bs.h # npx options FPU_ERROR_BROKEN opt_npx.h # PC98 options PC98 opt_global.h EPSON_BOUNCEDMA opt_pc98.h EPSON_MEMWIN opt_pc98.h -COMPAT_ATDISK opt_pc98.h LINE30 opt_syscons.h diff --git a/sys/pc98/pc98/diskslice_machdep.c b/sys/pc98/pc98/diskslice_machdep.c index 95d71396ca08..6c0b2f23b562 100644 --- a/sys/pc98/pc98/diskslice_machdep.c +++ b/sys/pc98/pc98/diskslice_machdep.c @@ -1,634 +1,634 @@ /*- * Copyright (c) 1994 Bruce D. Evans. * All rights reserved. * * Copyright (c) 1982, 1986, 1988 Regents of the University of California. * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ * $FreeBSD$ */ /* * PC9801 port by KATO Takenor */ -#include "opt_pc98.h" +#include "compat_atdisk.h" #include #include #include #include #include #ifndef PC98 #define DOSPTYP_EXTENDED 5 #define DOSPTYP_EXTENDEDX 15 #define DOSPTYP_ONTRACK 84 #endif #include #include #include #define TRACE(str) do { if (dsi_debug) printf str; } while (0) static volatile u_char dsi_debug; #ifndef PC98 static struct dos_partition historical_bogus_partition_table[NDOSPART] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0x80, 0, 1, 0, DOSPTYP_386BSD, 255, 255, 255, 0, 50000, }, }; #endif static int check_part __P((char *sname, struct dos_partition *dp, u_long offset, int nsectors, int ntracks, u_long mbr_offset)); static void extended __P((char *dname, dev_t dev, struct disklabel *lp, struct diskslices *ssp, u_long ext_offset, u_long ext_size, u_long base_ext_offset, int nsectors, int ntracks, u_long mbr_offset)); #ifdef PC98 #define DPBLKNO(cyl,hd,sect) ((cyl)*(lp->d_secpercyl)) -#ifdef COMPAT_ATDISK -int atcompat_dsinit __P((char *dname, dev_t dev, +#if NCOMPAT_ATDISK > 0 +int atcompat_dsinit __P((dev_t dev, struct disklabel *lp, struct diskslices **sspp)); #endif #endif static int check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) char *sname; struct dos_partition *dp; u_long offset; int nsectors; int ntracks; u_long mbr_offset; { int chs_ecyl; int chs_esect; int chs_scyl; int chs_ssect; int error; u_long esector; u_long esector1; u_long secpercyl; u_long ssector; u_long ssector1; #ifdef PC98 u_long pc98_start; u_long pc98_size; #endif secpercyl = (u_long)nsectors * ntracks; #ifdef PC98 chs_scyl = dp->dp_scyl; chs_ssect = dp->dp_ssect; ssector = chs_ssect + dp->dp_shd * nsectors + chs_scyl * secpercyl + mbr_offset; #else chs_scyl = DPCYL(dp->dp_scyl, dp->dp_ssect); chs_ssect = DPSECT(dp->dp_ssect); ssector = chs_ssect - 1 + dp->dp_shd * nsectors + chs_scyl * secpercyl + mbr_offset; #endif #ifdef PC98 pc98_start = dp->dp_scyl * secpercyl; pc98_size = dp->dp_ecyl ? (dp->dp_ecyl + 1) * secpercyl - pc98_start : 0; ssector1 = offset + pc98_start; #else ssector1 = offset + dp->dp_start; #endif /* * If ssector1 is on a cylinder >= 1024, then ssector can't be right. * Allow the C/H/S for it to be 1023/ntracks-1/nsectors, or correct * apart from the cylinder being reduced modulo 1024. Always allow * 1023/255/63. */ if ((ssector < ssector1 && ((chs_ssect == nsectors && dp->dp_shd == ntracks - 1 && chs_scyl == 1023) || (secpercyl != 0 && (ssector1 - ssector) % (1024 * secpercyl) == 0))) || (dp->dp_scyl == 255 && dp->dp_shd == 255 && dp->dp_ssect == 255)) { TRACE(("%s: C/H/S start %d/%d/%d, start %lu: allow\n", sname, chs_scyl, dp->dp_shd, chs_ssect, ssector1)); ssector = ssector1; } #ifdef PC98 chs_ecyl = dp->dp_ecyl; chs_esect = nsectors - 1; esector = chs_esect + (ntracks - 1) * nsectors + chs_ecyl * secpercyl + mbr_offset; esector1 = ssector1 + pc98_size - 1; #else chs_ecyl = DPCYL(dp->dp_ecyl, dp->dp_esect); chs_esect = DPSECT(dp->dp_esect); esector = chs_esect - 1 + dp->dp_ehd * nsectors + chs_ecyl * secpercyl + mbr_offset; esector1 = ssector1 + dp->dp_size - 1; #endif /* Allow certain bogus C/H/S values for esector, as above. */ if ((esector < esector1 && ((chs_esect == nsectors && dp->dp_ehd == ntracks - 1 && chs_ecyl == 1023) || (secpercyl != 0 && (esector1 - esector) % (1024 * secpercyl) == 0))) || (dp->dp_ecyl == 255 && dp->dp_ehd == 255 && dp->dp_esect == 255)) { TRACE(("%s: C/H/S end %d/%d/%d, end %lu: allow\n", sname, chs_ecyl, dp->dp_ehd, chs_esect, esector1)); esector = esector1; } error = (ssector == ssector1 && esector == esector1) ? 0 : EINVAL; if (bootverbose) #ifdef PC98 printf("%s: mid 0x%x, start %lu, end = %lu, size %lu%s\n", sname, dp->dp_mid, ssector1, esector1, pc98_size, error ? "" : ": OK"); #else printf("%s: type 0x%x, start %lu, end = %lu, size %lu %s\n", sname, dp->dp_typ, ssector1, esector1, (u_long)dp->dp_size, error ? "" : ": OK"); #endif if (ssector != ssector1 && bootverbose) printf("%s: C/H/S start %d/%d/%d (%lu) != start %lu: invalid\n", sname, chs_scyl, dp->dp_shd, chs_ssect, ssector, ssector1); if (esector != esector1 && bootverbose) printf("%s: C/H/S end %d/%d/%d (%lu) != end %lu: invalid\n", sname, chs_ecyl, dp->dp_ehd, chs_esect, esector, esector1); return (error); } int dsinit(dev, lp, sspp) dev_t dev; struct disklabel *lp; struct diskslices **sspp; { struct buf *bp; u_char *cp; int dospart; struct dos_partition *dp; struct dos_partition *dp0; int error; int max_ncyls; int max_nsectors; int max_ntracks; u_long mbr_offset; char partname[2]; u_long secpercyl; char *sname; struct diskslice *sp; struct diskslices *ssp; #ifdef PC98 u_long pc98_start; u_long pc98_size; #endif mbr_offset = DOSBBSECTOR; #ifdef PC98 /* Read master boot record. */ if ((int)lp->d_secsize < 1024) bp = geteblk((int)1024); else bp = geteblk((int)lp->d_secsize); #else reread_mbr: /* Read master boot record. */ bp = geteblk((int)lp->d_secsize); #endif bp->b_dev = dkmodpart(dkmodslice(dev, WHOLE_DISK_SLICE), RAW_PART); bp->b_blkno = mbr_offset; bp->b_bcount = lp->d_secsize; bp->b_flags |= B_READ; #ifdef PC98 if (bp->b_bcount < 1024) bp->b_bcount = 1024; #endif BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { diskerr(bp, devtoname(bp->b_dev), "error reading primary partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); error = EIO; goto done; } /* Weakly verify it. */ cp = bp->b_data; sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) printf("%s: invalid primary partition table: no magic\n", sname); error = EINVAL; goto done; } #ifdef PC98 /* * entire disk for FreeBSD */ if ((*(cp + 512) == 0x57) && (*(cp + 513) == 0x45) && (*(cp + 514) == 0x56) && (*(cp + 515) == 0x82)) { sname = dsname(dev, dkunit(dev), BASE_SLICE, RAW_PART, partname); free(*sspp, M_DEVBUF); ssp = dsmakeslicestruct(MAX_SLICES, lp); *sspp = ssp; /* Initialize normal slices. */ sp = &ssp->dss_slices[BASE_SLICE]; sp->ds_offset = 0; sp->ds_size = lp->d_secperunit; sp->ds_type = DOSPTYP_386BSD; sp->ds_subtype = 0xc4; error = 0; ssp->dss_nslices = BASE_SLICE + 1; goto done; } /* * XXX --- MS-DOG MO */ if ((*(cp + 0x0e) == 1) && (*(cp + 0x15) == 0xf0) && (*(cp + 0x1c) == 0x0) && ((*(cp + 512) == 0xf0) || (*(cp + 512) == 0xf8)) && (*(cp + 513) == 0xff) && (*(cp + 514) == 0xff)) { sname = dsname(dev, dkunit(dev), BASE_SLICE, RAW_PART, partname); free(*sspp, M_DEVBUF); ssp = dsmakeslicestruct(MAX_SLICES, lp); *sspp = ssp; /* Initialize normal slices. */ sp = &ssp->dss_slices[BASE_SLICE]; sp->ds_offset = 0; sp->ds_size = lp->d_secperunit; sp->ds_type = 0xa0; /* XXX */ sp->ds_subtype = 0x81; /* XXX */ error = 0; ssp->dss_nslices = BASE_SLICE + 1; goto done; } -#ifdef COMPAT_ATDISK +#if NCOMPAT_ATDISK > 0 /* * Check magic number of 'extended format' for PC-9801. * If no magic, it may be formatted on IBM-PC. */ if (((cp[4] != 'I') || (cp[5] != 'P') || (cp[6] != 'L') || (cp[7] != '1')) && ((strncmp(devtoname(bp->b_dev), "sd", 2) == 0) || (strncmp(devtoname(bp->b_dev), "wd", 2) == 0))) { /* IBM-PC HDD */ bp->b_flags = B_INVAL | B_AGE; brelse(bp); - return atcompat_dsinit(devtoname(bp->b_dev), dev, lp, sspp); + return atcompat_dsinit(dev, lp, sspp); } #endif dp0 = (struct dos_partition *)(cp + 512); #else dp0 = (struct dos_partition *)(cp + DOSPARTOFF); /* Check for "Ontrack Diskmanager". */ for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { if (dp->dp_typ == DOSPTYP_ONTRACK) { if (bootverbose) printf( "%s: Found \"Ontrack Disk Manager\" on this disk.\n", sname); bp->b_flags |= B_INVAL | B_AGE; brelse(bp); mbr_offset = 63; goto reread_mbr; } } if (bcmp(dp0, historical_bogus_partition_table, sizeof historical_bogus_partition_table) == 0) { TRACE(("%s: invalid primary partition table: historical\n", sname)); error = EINVAL; goto done; } #endif /* Guess the geometry. */ /* * TODO: * Perhaps skip entries with 0 size. * Perhaps only look at entries of type DOSPTYP_386BSD. */ max_ncyls = 0; max_nsectors = 0; max_ntracks = 0; for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { int ncyls; int nsectors; int ntracks; #ifdef PC98 ncyls = lp->d_secpercyl; #else ncyls = DPCYL(dp->dp_ecyl, dp->dp_esect) + 1; #endif if (max_ncyls < ncyls) max_ncyls = ncyls; #ifdef PC98 nsectors = lp->d_nsectors; #else nsectors = DPSECT(dp->dp_esect); #endif if (max_nsectors < nsectors) max_nsectors = nsectors; #ifdef PC98 ntracks = lp->d_ntracks; #else ntracks = dp->dp_ehd + 1; #endif if (max_ntracks < ntracks) max_ntracks = ntracks; } /* * Check that we have guessed the geometry right by checking the * partition entries. */ /* * TODO: * As above. * Check for overlaps. * Check against d_secperunit if the latter is reliable. */ error = 0; #ifdef PC98 for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0) continue; sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); #else for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); #endif /* * Temporarily ignore errors from this check. We could * simplify things by accepting the table eariler if we * always ignore errors here. Perhaps we should always * accept the table if the magic is right but not let * bad entries affect the geometry. */ check_part(sname, dp, mbr_offset, max_nsectors, max_ntracks, mbr_offset); } if (error != 0) goto done; /* * Accept the DOS partition table. * First adjust the label (we have been careful not to change it * before we can guarantee success). */ secpercyl = (u_long)max_nsectors * max_ntracks; if (secpercyl != 0) { u_long secperunit; lp->d_nsectors = max_nsectors; lp->d_ntracks = max_ntracks; lp->d_secpercyl = secpercyl; secperunit = secpercyl * max_ncyls; if (lp->d_secperunit < secperunit) lp->d_secperunit = secperunit; lp->d_ncylinders = lp->d_secperunit / secpercyl; } /* * We are passed a pointer to a suitably initialized minimal * slices "struct" with no dangling pointers in it. Replace it * by a maximal one. This usually oversizes the "struct", but * enlarging it while searching for logical drives would be * inconvenient. */ free(*sspp, M_DEVBUF); ssp = dsmakeslicestruct(MAX_SLICES, lp); *sspp = ssp; /* Initialize normal slices. */ sp = &ssp->dss_slices[BASE_SLICE]; for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++, sp++) { #ifdef PC98 pc98_start = DPBLKNO(dp->dp_scyl,dp->dp_shd,dp->dp_ssect); pc98_size = dp->dp_ecyl ? DPBLKNO(dp->dp_ecyl+1,dp->dp_ehd,dp->dp_esect) - pc98_start : 0; sp->ds_offset = pc98_start; sp->ds_size = pc98_size; sp->ds_type = dp->dp_mid; sp->ds_subtype = dp->dp_sid; strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name)); #else sp->ds_offset = mbr_offset + dp->dp_start; sp->ds_size = dp->dp_size; sp->ds_type = dp->dp_typ; #endif #if 0 lp->d_subtype |= (lp->d_subtype & 3) | dospart | DSTYPE_INDOSPART; #endif } ssp->dss_nslices = BASE_SLICE + NDOSPART; #ifndef PC98 /* Handle extended partitions. */ sp -= NDOSPART; for (dospart = 0; dospart < NDOSPART; dospart++, sp++) if (sp->ds_type == DOSPTYP_EXTENDED || sp->ds_type == DOSPTYP_EXTENDEDX) extended(dname, bp->b_dev, lp, ssp, sp->ds_offset, sp->ds_size, sp->ds_offset, max_nsectors, max_ntracks, mbr_offset); #endif done: bp->b_flags |= B_INVAL | B_AGE; brelse(bp); if (error == EINVAL) error = 0; return (error); } /* PC98 does not use this function */ void extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, nsectors, ntracks, mbr_offset) char *dname; dev_t dev; struct disklabel *lp; struct diskslices *ssp; u_long ext_offset; u_long ext_size; u_long base_ext_offset; int nsectors; int ntracks; u_long mbr_offset; { struct buf *bp; u_char *cp; int dospart; struct dos_partition *dp; u_long ext_offsets[NDOSPART]; u_long ext_sizes[NDOSPART]; char partname[2]; int slice; char *sname; struct diskslice *sp; #ifdef PC98 int pc98_start; int pc98_size; #endif /* Read extended boot record. */ bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; bp->b_blkno = ext_offset; bp->b_bcount = lp->d_secsize; bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { diskerr(bp, dname, "error reading extended partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); goto done; } /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", sname); goto done; } for (dospart = 0, dp = (struct dos_partition *)(bp->b_data + DOSPARTOFF), slice = ssp->dss_nslices, sp = &ssp->dss_slices[slice]; dospart < NDOSPART; dospart++, dp++) { ext_sizes[dospart] = 0; #ifdef PC98 if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0) #else if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) #endif continue; #ifdef PC98 if (dp->dp_mid == 0xff) { /* XXX */ #else if (dp->dp_typ == DOSPTYP_EXTENDED || dp->dp_typ == DOSPTYP_EXTENDEDX) { #endif char buf[32]; sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) strcat(buf, ""); check_part(buf, dp, base_ext_offset, nsectors, ntracks, mbr_offset); #ifdef PC98 pc98_start = DPBLKNO(dp->dp_scyl,dp->dp_shd,dp->dp_ssect); ext_offsets[dospart] = pc98_start; ext_sizes[dospart] = DPBLKNO(dp->dp_ecyl+1,dp->dp_ehd,dp->dp_esect) - pc98_start; #else ext_offsets[dospart] = base_ext_offset + dp->dp_start; ext_sizes[dospart] = dp->dp_size; #endif } else { sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); if (slice >= MAX_SLICES) { printf("%s: too many slices\n", sname); slice++; continue; } #ifdef PC98 pc98_start = DPBLKNO(dp->dp_scyl,dp->dp_shd,dp->dp_ssect); pc98_size = dp->dp_ecyl ? DPBLKNO(dp->dp_ecyl+1,dp->dp_ehd,dp->dp_esect) - pc98_start : 0; sp->ds_offset = ext_offset + pc98_start; sp->ds_size = pc98_size; sp->ds_type = dp->dp_mid; sp->ds_subtype = dp->dp_sid; strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name)); #else sp->ds_offset = ext_offset + dp->dp_start; sp->ds_size = dp->dp_size; sp->ds_type = dp->dp_typ; #endif ssp->dss_nslices++; slice++; sp++; } } /* If we found any more slices, recursively find all the subslices. */ for (dospart = 0; dospart < NDOSPART; dospart++) if (ext_sizes[dospart] != 0) extended(dname, dev, lp, ssp, ext_offsets[dospart], ext_sizes[dospart], base_ext_offset, nsectors, ntracks, mbr_offset); done: bp->b_flags |= B_INVAL | B_AGE; brelse(bp); }