Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 1998 11:09:20 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        David Greenman <dg@root.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Dump device with DEVFS? 
Message-ID:  <Pine.BSF.3.95.980719110104.22602A-100000@current1.whistle.com>
In-Reply-To: <199807191451.HAA13256@implode.root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
no, DEVFS preserves minor number bit ordering,
but under SLICE, with completely dynamic
partitionning it is impossible to preallocate any meaning to bits of the
minor number. SLICE isa a completely separate pseudo device driver with
it's own devsw entry, that sits above the raw disk drivers.

All disk like devices come in through this interface instead of being
accessed directly. it handles all partitionning and layering issues.
Because it is impossible ahead of time to know how a disk may be
partitionned, the static allocation of bits in the minor number is
imppossible.

For example what do you do if you decide to put a disklabel on a
disklabel 
partition to further divide  up your 'd' partition into 8 more devices?
how do you assign the bits?

SLICE handles this issue by simply handing out minor numbers sequentially
as needed , and mapping them internally to a pointer to the device's
softc structure.


To see if a device is a swap partition, the correct way would be to
somehow ASK it if it can be dumped to..

julian

On Sun, 19 Jul 1998, David Greenman wrote:

> >the test should be commented out for SLICE
> 
>    I'm a bit confused - you didn't preserve the minor number bit ordering in
> devfs?
> 
> -DG
> 
> David Greenman
> Co-founder/Principal Architect, The FreeBSD Project
> 
> >bde broke it because he thought it needed to test for a swap partition..
> >
> >
> >it actually needs to be re-examined..
> >
> >check the history of that file for bruce's backout.
> >your anaylsys is correct.
> >
> >
> >On 18 Jul 1998, Dag-Erling Coidan [iso-8859-1] Smørgrav  wrote:
> >
> >> It seems to be impossible to enable a dump device with DEVFS. The
> >> following code in setdumpdev() in sys/i386/i386/autoconf.c is the
> >> culprit:
> >> 
> >>         if (dkpart(dev) != SWAP_PART)
> >>                 return (ENODEV);
> >> 
> >> dkpart(dev) is #defined to (minor(dev) & 7) in disklabel.h, and
> >> SWAP_PART is #defined to 1 in the same file.
> >> 
> >> Now MAKEDEV will assign minor numbers with the lower nybble 0x1 to
> >> swap partitions ([fosw]d?b or something like that) so it will work
> >> fine, but Helen's swap partition (/dev/wd0s1b) has minor number 11
> >> (lower nybble 0x3), and Niobe's swap partition (/dev/sd0b) has minor
> >> number 20 (lower nybble 0x4), neither of which is acceptable to
> >> setdumpdev(). The only partition I have which is eligible as a dump
> >> device (due to its minor number being 25) is /dev/sd0h, aka. /usr/src.
> >> 
> >> Am I missing something here? Is this a bug or a feature? How do I set
> >> a dump device on a DEVFS system? And anyway, shouldn't setdumpdev()
> >> just trust the user to know what he's doing even if the selected
> >> partition doesn't seem to be a swap partition?
> >> 
> >> BTW, I just had a panic trying to umount an msdosfs floppy - probably
> >> thanks to soft updates, all my file systems except /var came up clean
> >> although I was cvsupping at the time of the panic.
> >
> >great..
> >
> >> 
> >> For completeness' sake, here is my dmesg, kernel config and a listing
> >> of /dev/sd*:
> >> 
> >> Copyright (c) 1992-1998 FreeBSD Inc.
> >> Copyright (c) 1982, 1986, 1989, 1991, 1993
> >> 	The Regents of the University of California. All rights reserved.
> >> FreeBSD 3.0-CURRENT #9: Fri Jul 17 18:26:15 CEST 1998
> >>     finrod@niobe.ewox.org:/usr/src/sys/compile/niobe
> >> Timecounter "i8254"  frequency 1193182 Hz  cost 2278 ns
> >> Timecounter "TSC"  frequency 166193751 Hz  cost 137 ns
> >> CPU: Pentium/P54C (166.19-MHz 586-class CPU)
> >>   Origin = "GenuineIntel"  Id = 0x52c  Stepping=12
> >>   Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
> >> real memory  = 134217728 (131072K bytes)
> >> 
> >> FreeBSD Kernel Configuration Utility - Version 1.1
> >>  Type "help" for help or "visual" to go to the visual
> >>  configuration interface (requires MGA/VGA display or
> >>  serial terminal capable of displaying ANSI graphics).
> >> config> quit
> >> avail memory = 127885312 (124888K bytes)
> >> DEVFS: ready for devices
> >> Probing for devices on PCI bus 0:
> >> chip0: <Intel 82439> rev 0x03 on pci0.0.0
> >> chip1: <Intel 82371SB PCI to ISA bridge> rev 0x01 on pci0.7.0
> >> de0: <Digital 21140A Fast Ethernet> rev 0x22 int a irq 15 on pci0.9.0
> >> de0: ACCTON EN1207 21140A [10-100Mb/s] pass 2.2
> >> de0: address 00:00:e8:4a:83:63
> >> de0: enabling 100baseTX port
> >> vga0: <Tseng Labs ET6000 graphics accelerator> rev 0x70 int a irq 9 on pci0.10.0
> >> ahc0: <Adaptec 2940 Ultra SCSI host adapter> rev 0x00 int a irq 12 on pci0.11.0
> >> ahc0: aic7880 Wide Channel, SCSI Id=7, 16 SCBs
> >> scbus0 at ahc0 bus 0
> >> sd0 at scbus0 target 2 lun 0
> >> sd0: <QUANTUM XP34550W LXY1> type 0 fixed SCSI 2
> >> sd0: Direct-Access 4341MB (8890760 512 byte sectors)
> >> sd0: with 5899 cyls, 10 heads, and an average 150 sectors/track
> >> ahc0:A:4: refuses WIDE negotiation.  Using 8bit transfers
> >> sd1 at scbus0 target 4 lun 0
> >> sd1: <QUANTUM FIREBALL ST6.4S 0F0C> type 0 fixed SCSI 2
> >> sd1: Direct-Access 6180MB (12657717 512 byte sectors)
> >> sd1: with 7068 cyls, 8 heads, and an average 223 sectors/track
> >> ahc1: <Adaptec 2940 SCSI host adapter> rev 0x00 int a irq 11 on pci0.12.0
> >> ahc1: aic7870 Single Channel, SCSI Id=7, 16 SCBs
> >> scbus1 at ahc1 bus 0
> >> st0 at scbus1 target 3 lun 0
> >> st0: <TECMAR TRAVAN NS8 P611> type 1 removable SCSI 2
> >> st0: Sequential-Access density code 0x0,  drive empty
> >> sd2 at scbus1 target 4 lun 0
> >> sd2: <CONNER CFP1080S 4649> type 0 fixed SCSI 2
> >> sd2: Direct-Access 1030MB (2110812 512 byte sectors)
> >> sd2: with 3658 cyls, 6 heads, and an average 96 sectors/track
> >> cd0 at scbus1 target 5 lun 0
> >> cd0: <TOSHIBA CD-ROM XM-3801TA 1047> type 5 removable SCSI 2
> >> cd0: CD-ROM cd present [258777 x 2048 byte records]
> >> od0 at scbus1 target 6 lun 0
> >> od0: <OLYMPUS MOS330 1.30> type 7 removable SCSI 2
> >> od0: Optical 217MB (446325 512 byte sectors)
> >> od0: with approximate 217 cyls, 64 heads, and 32 sectors/track
> >> Probing for PnP devices:
> >> Probing for devices on the ISA bus:
> >> sc0 at 0x60-0x6f irq 1 on motherboard
> >> sc0: VGA color <12 virtual consoles, flags=0x0>
> >> psm0 not found at 0x60
> >> sio0 at 0x3f8-0x3ff irq 4 flags 0x10 on isa
> >> sio0: type 16550A
> >> sio1 at 0x2f8-0x2ff irq 3 on isa
> >> sio1: type 16550A
> >> lpt0 at 0x378-0x37f irq 7 on isa
> >> lpt0: Interrupt-driven port
> >> lp0: TCP/IP capable interface
> >> pcm0 not found
> >> fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
> >> fdc0: FIFO enabled, 8 bytes threshold
> >> fd0: 1.44MB 3.5in
> >> 1 3C5x9 board(s) on ISA found at 0x300
> >> ep0 at 0x300-0x30f irq 10 on isa
> >> ep0: aui/bnc[*BNC*] address 00:60:8c:61:df:38
> >> npx0 on motherboard
> >> npx0: INT 16 interface
> >> Intel Pentium F00F detected, installing workaround
> >> DEVFS: ready to run
> >> IP packet filtering initialized, divert disabled, rule-based forwarding disabled, logging limited to 256 packets/entry
> >> sd0: probing for MBR.. rejected.. Slice includes MBR sd0: probing for disklabel..  part a, start=0, size=131072
> >>  part b, start=131072, size=1048576
> >>  part d, start=3932160, size=4958600
> >>  part e, start=1179648, size=131072
> >>  part f, start=1310720, size=524288
> >>  part g, start=1835008, size=1048576
> >>  part h, start=2883584, size=1048576
> >> sd1: probing for MBR.. rejected.. Slice includes MBR sd1: probing for disklabel..  part e, start=0, size=524288
> >>  part f, start=524288, size=1572864
> >>  part g, start=2097152, size=10560565
> >> sd2: probing for MBR..  part 1, start=63, size=2104452
> >> sd2s1: attaching disklabel..
> >>  part e, start=0, size=524288
> >>  part f, start=524288, size=1580164
> >> fd0: probing for MBR.. WOULD SELECT /sd0a And it exists
> >> WARNING: / was not properly dismounted.
> >> fd0: Operation timeout
> >> fd0: hard error, block 0  (No status)
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> ffs_mountfs: superblock updated
> >> 
> >> #
> >> # Kernel configuration for niobe.ewox.org
> >> #
> >> machine		"i386"
> >> cpu		"I586_CPU"
> >> ident		niobe
> >> maxusers	64
> >> #
> >> # Networking
> >> options		INET
> >> options		IPFIREWALL
> >> options		IPFIREWALL_VERBOSE
> >> options		"IPFIREWALL_VERBOSE_LIMIT=256"
> >> options		"NMBCLUSTERS=4096"
> >> #
> >> # File system
> >> options		DEVFS
> >> options		FFS
> >> options		FFS_ROOT		# Boot from FFS
> >> options		NFS
> >> options		PROCFS
> >> options		SLICE			# Use devfs for devices
> >> options		SOFTUPDATES
> >> #
> >> # XFree86 support
> >> options		SYSVMSG
> >> options		SYSVSEM
> >> options		SYSVSHM
> >> options		UCONSOLE
> >> #
> >> # Misc. kernel options
> >> options		"AUTO_EOI_1"
> >> options		"AUTO_EOI_2"
> >> options		"COMPAT_43"
> >> options		"MD5"
> >> options		BOUNCE_BUFFERS
> >> options		INCLUDE_CONFIG_FILE
> >> options		USERCONFIG
> >> options		USERCONFIG_BOOT
> >> options		USER_LDT
> >> options		VISUAL_USERCONFIG
> >> #
> >> config		kernel	root on sd0
> >> #
> >> # Buses
> >> controller	isa0
> >> controller	pci0
> >> controller	pnp0
> >> #
> >> # Numeric processor extensions
> >> device		npx0	at isa? port "IO_NPX" irq 13 vector npxintr
> >> #
> >> # Floppy controller
> >> controller	fdc0	at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
> >> disk		fd0	at fdc0 drive 0
> >> #
> >> # SCSI controllers
> >> controller	ahc0
> >> controller	scbus0
> >> device		sd0
> >> device		od0
> >> device		st0
> >> device		cd0
> >> pseudo-device	su
> >> pseudo-device	ssc
> >> options		"SCSI_DELAY=1"
> >> options		SCSI_REPORT_GEOMETRY
> >> #
> >> # System console and mouse
> >> device		sc0	at isa? port "IO_KBD" tty irq 1 vector scintr
> >> options		"MAXCONS=12"
> >> options		"SC_HISTORY_SIZE=4096"
> >> options		"MSGBUF_SIZE=32768"
> >> device		psm0	at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
> >> #
> >> # I/O ports
> >> device		sio0	at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
> >> device		sio1	at isa? port "IO_COM2" tty irq 3 vector siointr
> >> device		lpt0	at isa? port? tty irq 7 vector lptintr
> >> #
> >> # Network adapters
> >> device de0
> >> device ep0 at isa? port 0x300 net irq 10 vector epintr
> >> #
> >> # Networking pseudo-devices
> >> pseudo-device	loop
> >> pseudo-device	ether
> >> pseudo-device	tun	4
> >> pseudo-device	bpfilter 4
> >> #
> >> # Other pseudo-devices
> >> pseudo-device	gzip
> >> pseudo-device	pty	64
> >> pseudo-device	vn	4
> >> #
> >> # Sound hardware (Luigi Rizzo)
> >> device		pcm0 at isa? port? tty irq 5 drq 1 flags 0x15 vector pcmintr
> >> #
> >> 
> >> root@niobe # ll /dev/sd*
> >> brw-------  1 root  operator   14,   8 Jul 18 21:56 /dev/sd0
> >> brw-------  1 root  operator   14,  19 Jul 18 21:56 /dev/sd0a
> >> brw-------  1 root  operator   14,  20 Jul 18 21:56 /dev/sd0b
> >> brw-------  1 root  operator   14,  21 Jul 18 21:56 /dev/sd0d
> >> brw-------  1 root  operator   14,  22 Jul 18 21:56 /dev/sd0e
> >> brw-------  1 root  operator   14,  23 Jul 18 21:56 /dev/sd0f
> >> brw-------  1 root  operator   14,  24 Jul 18 21:56 /dev/sd0g
> >> brw-------  1 root  operator   14,  25 Jul 18 21:56 /dev/sd0h
> >> brw-------  1 root  operator   14,   9 Jul 18 21:56 /dev/sd1
> >> brw-------  1 root  operator   14,  26 Jul 18 21:56 /dev/sd1e
> >> brw-------  1 root  operator   14,  27 Jul 18 21:56 /dev/sd1f
> >> brw-------  1 root  operator   14,  28 Jul 18 21:56 /dev/sd1g
> >> brw-------  1 root  operator   14,  10 Jul 18 21:56 /dev/sd2
> >> brw-------  1 root  operator   14,  29 Jul 18 21:56 /dev/sd2s1
> >> brw-------  1 root  operator   14,  30 Jul 18 21:56 /dev/sd2s1e
> >> brw-------  1 root  operator   14,  31 Jul 18 21:56 /dev/sd2s1f
> >> 
> >> DES
> >> -- 
> >> One two, one two, one two.
> >> 
> >> To Unsubscribe: send mail to majordomo@FreeBSD.org
> >> with "unsubscribe freebsd-hackers" in the body of the message
> >> 
> >
> >
> >To Unsubscribe: send mail to majordomo@FreeBSD.org
> >with "unsubscribe freebsd-hackers" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980719110104.22602A-100000>