summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_diskmbr.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a warning.dfr1999-11-091-1/+1
|
* Removed diskerr()'s unused d_name arg and updated callers. This fixesbde1999-09-131-4/+2
| | | | | | warnings caused by the arg having the wrong type (not const enough). The arg was also wrong (a full name instead of a short one) for calls from from subr_diskmbr.c and pc98/diskslice_machdep.c.
* Fixed style bugs in rev.1.36-1.39.bde1999-09-041-37/+28
|
* Merge alpha and pc98 changes into i386 MBR handling code and replace allphk1999-08-291-6/+54
| | | | three copies with one copy in MI land.
* We don't need to pass the diskname argument all over the diskslice/labelphk1999-08-281-14/+14
| | | | code, we can find the name from any convenient dev_t
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-17/+13
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-3/+3
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-5/+5
| | | | kernel compile
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-2/+2
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* The machine dependent disk slice manager does not recognizephk1998-08-101-3/+6
| | | | | | | | | | | DOS partition type 15 (Extended DOS, LBA) as a container for DOS logical volumes, so the appropriate slices (e.g. sd1s5) are not initialized. PR: 7549 PR: 4120 Reviewed by: phk Submitted by: Jim Mattson <jmattson@sonic.net>
* Don't pass the label to diskerr(), since the label is being constructedbde1998-07-251-3/+3
| | | | | and may be invalid. In particular, d_secpercyl may be 0, and diskerr() divides by it.
* Moved allocation of the slices struct to the right place. Initializebde1998-07-201-28/+9
| | | | | everything in it (the devsw pointers were not initialized early or at all for the !DEVFS case, but this was harmless on i386's).
* Fixed printf format errors.bde1998-07-111-3/+3
|
* In all such uses of struct buf: 's/b_un.b_addr/b_data/g'phk1997-12-021-4/+4
|
* Hide the `no magic' babble behind bootverbose, since it has proven tojoerg1997-09-271-5/+7
| | | | be too much magic for 99.9 % of the users.
* Avoid division by 0 in check_part(). (It occurred when max_nsectors == 0.bde1997-04-191-8/+11
| | | | | | | This case is clearly an error, but we keep calling check_part() to get diagnostics.) Fixed nearby indentation and commenting bugs.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | 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.
* Don't clobber max_ncyls, ending up guessing thetotal number of cylinders asbde1996-11-041-6/+10
| | | | | | | | the number in the 4th slot. Fixes PR 1893. Should be in 2.1.5 and 2.2.
* Don't include <sys/conf.h> for the kernel in disk-related headers.bde1996-09-201-1/+2
| | | | | | | | | | It is needed for implementation details but very little of it is needed for the interface. Include it in the few places that didn't already include it. Include <sys/ioccom.h> in <sys/disklabel.h> (as already in <sys/diskslice.h>) so that all the disk-related headers are almost self-sufficient.
* Removed now-unused #includes of <machine/cpu.h>. They were for bootverbosebde1996-04-071-2/+1
| | | | being declared in the wrong place.
* More b_flags fixes.dyson1996-03-021-3/+3
|
* Fix a bug that b_flags was getting unnecessarily modified bydyson1996-03-011-4/+4
| | | | | the slice code. The effect up to now has been insignficant, but improved buffer allocation code will break with this problem.
* Remove unused functions and variables, make things static, and other cleanups.phk1995-10-281-3/+1
|
* Don't clip d_ncylinders to value used by partitions.jkh1995-08-231-2/+2
|
* Properly initialize the d_ncylinders field to the maximum number ofjkh1995-08-231-1/+2
| | | | cylinders.
* Make the "information" slice printfs if(bootverbose).phk1995-05-181-10/+13
| | | | Fix the message about Ontrack.
* Fix style inconsistencies in the last few commits.bde1995-05-071-30/+28
|
* When past cyl 1024 it's ok if CHS is (0xff,0xff,0xff).phk1995-05-011-3/+7
| | | | It's actually recommended it seems...
* Remove the slice for the first 63 sectors for the OnTrack case, it's uselessphk1995-04-201-12/+2
| | | | and nobody care about it anyway.
* Added support for disks which "OnTrack Disk Manager" has munged.phk1995-04-201-19/+58
| | | | | I suggest you do all partitioning using the OnTrack SW, to avoid confusing it.
* Add more compatibility cruft:bde1995-03-251-19/+69
| | | | | | | | | | | | | | | | | | - ignore the partition table if it is identical with the bogus one in /usr/src/sys/i386/boot/biosboot/start.S. Honoring the bogus size field was fatal. The error is detected but other compatibilty cruft weakens the error handling too much for this case. - weaken the partition entry checking to allow the following treatments of C/H/S addresses when C should be >= 1024: (1) allow C = 1023, H = max, S = max. (2) allow C to be correct modulo 1024. Other compatibilty cruft weakens the error handling to allow all C/H/S addresses, but there too many errors were reported. Improve error messages: - print C/H/S addresses if relevant. - distinguish primary partition table from extended partition tables. - don't use diskerr() except for i/o errors.
* Fix support for extended partitions (forgot to release the buffer).bde1995-03-151-3/+7
|
* Support extended DOSpartitions.bde1995-03-041-51/+181
| | | | | | | | Accept even suspicious partitions. Moved most handling of the compatibility slice to dsopen(). Report i/o errors.
* Use dsname() to get consistent names.bde1995-02-221-16/+19
|
* Don't generate any errors here other than EIO. An invalid partitionbde1995-02-211-14/+10
| | | | table is not an error, it just causes a smaller slice table.
* Add compatibility cruft.bde1995-02-161-30/+54
| | | | | | | | | | | | | | | | | | | | | | | | | Slice 0 is now for the first BSD slice. The first BSD slice is the first DOSpartition with id 0xa5 or the whole disk if their are no DOSpartitions (except the latter is not yet implemented). Existing partitions on it work the same as in 2.0 except the 'd' partition is no longer special and partitions are relative to the skice. Slice 1 is now for the whole disk and gets a read-only label describing the disk. Previously, slice 0 was for the whole disk and there was no label on it. Slices 2-31 are for DOSpartitions. Slice 0 is an alias for one of these if there is a BSD slice. Previously, slices 1-31 were for DOSpartitions. diskslice_machdep.c: Expand whole disk slice to include all DOSpartitions. More work is required for >1024 cylinders and to rewrite the label iff the driver is unsure about the geometry. subr_diskslice.c: New function dsisopen() to help handle media changes.
* Fixed $Id$phk1995-01-231-1/+1
|
* Change an 0 to WHOLE_DISK_SLICE.bde1994-12-301-1/+1
|
* diskslice_machdep.c implements reading and checking of DOS slice tables.bde1994-12-121-0/+212
It will eventually replace readMBR.c.
OpenPOWER on IntegriCloud