. It makes cd9660 root f/s working again.
. It makes CD9660 a new-style option.
. It adds support to mount an ISO9660 multi-session CD-ROM as the root
filesystem (the last session actually, but that's what is expected
behaviour).
Sigh. The CDIOREADTOCENTRYS did a copyout() of its own, and thus has
been unusable for me for this work. Too bad it didn't simply stuff
the max 100 entries into the struct ioc_read_toc_entry, but relied on
a user supplied data buffer instead. :-( I now had to reinvent the
wheel, and created a CDIOREADTOCENTRY ioctl command that can be used
in a kernel context.
While doing this, i noticed the following bogosities in existing CD-ROM
drivers:
wcd: This driver is likely to be totally bogus when someone tries
two succeeding CDIOREADTOCENTRYS (or now CDIOREADTOCENTRY)
commands with requesting MSF format, since it apparently
operates on an internal table.
scd: This driver apparently returns just a single TOC entry only for
the CDIOREADTOCENTRYS command.
I have only been able to test the CDIOREADTOCENTRY command with the
cd(4) driver. I hereby request the respective maintainers of the
other CD-ROM drivers to verify my code for their driver. When it
comes to merging this CD-ROM multisession stuff into RELENG_2_2 i will
only consider drivers where i've got a confirmation that it actually
works.
I got tired of not seeing my worm stats show up during a burn. :)
[Joerg, I just stapled in 1MB/sec for a bogus xfer rate and left seek = 1,
as suggested - I'm not going to dynamically calculate the xfer rate from
a known device spectable, OK? :-)]
Reviewed by: joerg
caller is scsi_done which the controller interrupt handlers call. In the
case of a non-buffer based transaction, the xs structure is freed by the
process that initiated the transfer in scsi_scsi_cmd. In this case, an
explicit splbio/splx pair around the call to free_xs is required. Without
the splbio protection, the xs free list could be corrupted, and the type
driver's start routine might run without spl protection.
Submitted by: Tor Egge <Tor.Egge@idt.ntnu.no>
Obtained from: PR kern/2891
and fixed everything that depended on getting it from the wrong
place. Most of the broken things actually only depended on getting
the declaration of their interrupt handler from "ioconf.h".
Many things have been changing in the kernel since mid-1996, so there's
quite some amount of diffs here already. It compiles, but i cannot
test it anywhere here.
2.2 candidate?
Closes PR # 1201.
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.
The system boots and can mount UFS filesystems.
Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
Mount_std mounts will not work until the getfsent
library routine is changed.
Reviewed by: various people
Submitted by: Jeffery Hsu <hsu@freebsd.org>
from last time. Some people have pointed out that there were some odd
side-effects in the changes I made. Two things are different:
- sc_print_addr() will print 'foodev0:' (i.e. sd0:, st0:, cd0:, etc...)
if the device name is known. If it's not known, it'll use a longer
notation. This shortens error messages back to a sane length.
- Added a small function called sc_print_init() to set the sc_printing
flag so that sc_print_addr() will know that we want it to print a
linefeed. Used this in scsi_device_attach() to restore proper carriage
return printing behavior which I broke.
Remaining bogons: the NCR SCSI driver prints out information while the
device-specific attach routine is running with its own linefeeds. This
breaks up the individual messages emitted by the subdriver modules and
causes at least one message to appear on a line by itself without a
device spec prefix. I'm not sure of the correct way to fix this, and
I don't have any NCR SCSI hardware to test with anyway.
There's probably more, but I gather that a rewrite of the SCSI subsystem
is pending anyway, so I'll leave the rest to Those Who Know More About
This Than I (tm).
read-mode access to CD-ROM media in the worm(4) driver. No whistles
and bells yet, like all the CDIO* commands, but at least a start.
In order to do this, i had to slightly rearrange the semantics of an
open(2) on the worm driver: now, opening it with O_NONBLOCK set means
no actual IO operations will be intended but only ioctls are to be
processed. This mode is used by wormcontrol(8) to prepare a track
and/or session.
I have only been able to test this on a 2.2-GAMMA system by now, and
only the !DEVFS part is tested yet. Also, i have only done a dummy
burn so far, but wouldn't expect many surprises else. Report bugs to
me ASAP, if there's reasonable demand and i hear no objections, i
might consider merging it into the 2.2 branch as well.
(since T_DIRECT just incidentally happens to be equal 0). This causes
more harm than it would do good. Instead , get it at the uk driver.
Reviewed by: obrien@NUXI.com (David O'Brien)
slices in sd_open() after a media change when the previous sd_open()
discards the previous slices and then fails. sd_open() just handles
media changes poorly and fails too often.
("Hey! Who made _you_ the keeper of all things BSDish?!") but this has
bugged me for a long time, and now that I finally have the chance
to hack on it (and test the results), I'll take my chances. I can also
point to other BSD implementations for precedents if you put my back to
the wall.
The only thing that's changed is how the messages are formatted. Now,
instead of having this:
aha0 at 0x330-0x333 irq 11 drq 5 on isa
(aha0:3:0): "HP C1553A 9503" type 1 removable SCSI 2
st0(aha0:3:0): Sequential-Access density code 0x24, variable blocks, write-enabled
(aha0:3:1): "HP C1553A 9503" type 8 removable SCSI 2
ch0(aha0:3:1): Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s)
We have this:
aha0 at 0x330-0x333 irq 11 drq 5 on isa
scbus0 at aha0 bus 0
st0 at scbus0 target 3 lun 0
st0: <HP C1553A 9503> type 1 removable SCSI 2
st0: Sequential-Access density code 0x24, variable blocks, write-enabled
ch0 at scbus0 target 3 lun 1
ch0: <HP C1553A 9503> type 8 removable SCSI 2
ch0: Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s)
Which is (to me anyway) is a lot more pleasant to look at. (Call me
crazy -- g'head: you know you wanna -- but the previous messages remind
me of Linux. Ever see the output from the linux device probes? It's a mess
of copyright notices, version numbers/dates, author e-mail addresses and
other crap. Let's not go there, okay? Bleh.)
Notice that devices are now specified in terms of the scsi bus they
live on rather than the adapter. This better reflects the contents
of the kernel config file (if you use wired-down device specifications
anyway) and removes some ambiguity that may arise if you have a multi-
channel adapter with more than one bus.
Also, sc_print_addr() now generates messages like this:
st0 at scbus0 target 3 lun 0: NOT READY asc:3a,0 Medium not present
instead of this:
st0(aha0:3:0): NOT READY asc:3a,0 Medium not present
I also added a quirk entry for the HP Superstore 12000e 6 tape DAT
autoloader, which needs SC_MORE_LUS in order for the changer device
to be properly probed and attached. (I'm working on a chcontrol utility
to manipulate the changer on this drive which should hopefully be general
enough to work with other changers too. If you want the prototype I have
now, it's at ftp://skynet.ctr.columbia.edu/pub/freebsd/changer.c.)
Remaining bugs:
- The 'foodev0: yadda yadda yadda' bits should probably be printed entirely
by the device-specific subdriver attach code instead of half by the
scsi_device_attach() routine and half by the device specific attach
routine like it is now.
- The wired-down device specifications in the kernel config file should
be used to control bus/device probing to some extent rather than just
for choosing names for devices we find. If the config says there's a
device at scbus0 target 0 lun 0 called sd0, we should look there and
check for a device that can be managed by the sd driver. If we don't
find one, we should probably complain that there's no device there or
that there is a device but of the wrong type. Once all the devices from
the wired down list have been probed, the code can then autodetect and
autoattach any devices that remain unassigned.
- Apparently some tape changers (hi Ulf!) return 'not ready/medium not
present' when the magazine is loaded but a tape has not been put in the
drive yet. This causes an open(/dev/ch0) to fail and prevents you from
using the changer.c utility to load the first tape into the drive. My
HP changer does not behave this way. The workaround is to manually load
a tape into the drive before attempting to use the changer program, but
you can get in trouble if you accidentally eject a tape without loading
a new one and you're at a remote location: you won't be able to load
any tapes anymore. I'm not sure what the correct software solution is
for this but ideally there should be one.
- I should not be doing this: I'm the NIS guru, not the SCSI guru.
(This is not my beautiful code. How did I get here? My god: what
have I done?)
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
the START UNIT command before testing whether the device is ready.
Maybe it should be done even earlier, i'm not 100 % sure.
Again, CD changers will most likely benefit from it.
While i was at it, also made the debugging case a little more verbose
about why the cdopen() yielded an ENXIO. (Only in effect when
SCSIDEBUG is specified.)
Should eventually also go into 2.2.
error code with ASC/ASCQ 4/1 (``Logical unit is in the process of
becoming ready'') non-fatal. Retry the operation until it will
eventually either yield a real error condition, or finally succeed.
Devices like CD changers or tape drives with a freshly inserted
cartridge should benefit from this.
Should go into 2.2 after some testing in -current. I'd like to see
this in the release if possible.
I've added an installation from optical disk drive facility.
This enables FreeBSD to be installed from an optical disk, which
may be formatted in "super floppy" style or sliced into MSDOS-FS
and UFS partitions.
Note: ncr.c should be reviewed by Stefan Esser <se@freebsd.org>
and cd.c by Joerg Wunsch <joerg@freebsd.org> before bringing this
into 2.2.
Submitted-By: Shunsuke Akiyama <akiyama@kme.mei.co.jp>
series drives, and add the NAKAMICHI MO drive RMD-5200-S.
Closes PR # kern/2200: Change/Add new optical di...
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
the sd & od drivers. There is also slight changes to fdisk & newfs
in order to comply with different sectorsizes.
Currently sectors of size 512, 1024 & 2048 are supported, the only
restriction beeing in fdisk, which hunts for the sectorsize of
the device.
This is based on patches to od.c and the other system files by
John Gumb & Barry Scott, minor changes and the sd.c patches by
me.
There also exist some patches for the msdos filesys code, but I
havn't been able to test those (yet).
John Gumb (john@talisker.demon.co.uk)
Barry Scott (barry@scottb.demon.co.uk)
medium with another size is being inserted. Right now, this case was
broken and led to a situation where a medium could only be replaced
with another one of the same size.
Closes PR #kern/1830: Can't mount optical disk...
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
. also detect the Phlips CDD2000; it's software-compatible with the HP part
Submitted by: cau@cc.gatech.edu (Carlos Ugarte)
. correct the blocksize handling for CD-DA tracks, and fix multitrack
handling
Submitted by: nsayer@quack.kfu.com (Nick Sayer)
2.2 candidates!
does) before calling dscheck(). dscheck() doesn't appreciate this and
calls Debugger() and returns without setting bp->b_error.
This can happen when there is a casting error and offsets > 2G are
converted to negative off_t's in the disk tools. (dumpfs used to do this).
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.
No functional change intended nor expected.
GENERIC should be about one k smaller now :-)
media in all cases.
Remove SCSI_2_MAX_DENSITY_CODE definition and rely on the device to tell
us if we attempt an invalid setting.
Closes PR 1245.
Submitted by: fredriks@mcs.com a few changes by me.
. use new-style options
. introduce an option OD_AUTO_TURNOFF
. try to use the native geometry as reported by the drive instead of
a faked on -- MOs do have a ``classical'' geometry
. make the scsi_start_unit() actually working
. some cosmetic fixes
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.
Ok'd by: core
Submitted by: FreeBSD(98) development team
Changed DEVFS structure devfs_token so that adding the devices is
a simple matter of a 4 line for loop versus 16 lines of code
Reviewed by: julian@freebsd.org
Added scsi control devices.
Converted almost everything that I changed to use devfs_add_devswf()
and verbose id macros.
st.c:
Renamed enrst* to erst* since that's what the current name is (enrst
seems to be an old name).
drives require ST_Q_SNS_HLP, they also wrongly accept a blocksize of
1024 in the first place (for a QIC-150 cartridge), but complain later
about it. The hack is to only probe for 512 for them.
Reorder the entries in st_decide_mode() so that QIC >= 525 is properly
accepted as variable blocksize.
. remove some unused variables
. declare worminit() right this time, it's actually extern (?)
. use wormminphys(), now that it's already there (hope i've got this right)
Also declared worminit() to avoid a compiler warning. Seems that the
other SCSI drivers don't declare XXinit() yet, so perhaps we'd also
create a typedef for these func's.
The worm driver is alpha-usable! I've stuffed everything that is
needed into the kernel driver, including the logic to select
between different vendor's quirks.
Disclaimer: this has by now _only_ been tested on a heavily tweaked
2.0.5R system. I've done my best to retrofit it into -current, but
i don't have a chance yet to test it in a -current environment.
quite work yet, so the heart of it is disabled.
Added bdev and cdev args to dsopen().
drivers:
Fixed device names, links, minor numbers and modes.
wd.c:
Started actually supporting devfs.
diskslice.h:
Added devfs tokens to structs (currently 576 of them per disk! :-().
subr_diskslice.c:
Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times. DEVFS is #undefed at the start so
that this shouldn't cause problems.
This makes it sorta usable, just for my ``proof-of-concept'' Perl
script i've been posting to freebsd-scsi. The driver will be
overhauled further, this is just to provide Jordan with a base to
perform testing of his own with his HP burner. Use entirely at your
own risk, expect a bunch of misburnt CD-R's when using it already in
this very green stage.
Note that by now the driver will only work when the CD-R has already
been in the drive at boot time.
obtained by the MOSE SENSE command. SONY drives are too stupid to eat
their own food.
Submitted by: stu@solaris.com (Stu Phillips)
While i was at it, i've removed two bogus channel numbers in the``set
mono'' command, that kept my Toshiba drive complaining.
Also remove Julian's misspelling of `stereo'.
Unstaticize a function in scsi/scsi_base that was used, with an undocumented
option.
My last count on the LINT kernel shows:
Total symbols: 3647
unref symbols: 463
undef symbols: 4
1 ref symbols: 1751
2 ref symbols: 485
Approaching the pain threshold now.
seems to work hre just fine though I can't check every file
that changed due to limmited h/w, however I've checked enught to be petty
happy withe hte code..
WARNING... struct lkm[mumble] has changed
so it might be an idea to recompile any lkm related programs
It will need to be changed
but it's the better starting point..
also add '?' to wildcarding in SCSI identification of devices..
so we can catch all PIONEER CD 6??* devices instead of having
separate entries for the 600, 602, 604X, 624X etc..
it's getting so we should have a small regexp routine in the kernel
maybe just a little one.. matching CDX-6[0-9][0-9][ A-Z] would be better
there will be drastic changes in this
but this is the best starting point..
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)
If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)
pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
to get the definitions of TRUE and FALSE which happen to be defined in
a deeply nested include.
Added nearby #includes of <sys/conf.h> where appropriate.
sscselect(). Use the standard dummies nostrategy(), noread(),
nowrite() and noselect() instead.
sscread() and sscwrite() returned bogus errnos. It isn't possible
to return an error from a select routine so noselect() is just as
bogus as sscselect() (it's equivalent to nullselect()).