Commit Graph

44 Commits

Author SHA1 Message Date
Poul-Henning Kamp
77068a7fe2 Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:49:41 +00:00
Poul-Henning Kamp
aaead0dfe9 Modernize my email address. 2002-03-25 13:52:45 +00:00
Matthew Dillon
96be23e0be Add __FBSDID()s to libdisk 2001-09-30 21:16:57 +00:00
Jordan K. Hubbard
96e426f43d + add u_long sector_size to struct disk (documented in libdisk.3)
+ make Open_Disk sense the sector size by trying 512, 1024 and 2048
  in this order. This makes the kernel note that
  dscheck(cd1): bio_bcount 512 is not on a sector boundary (ssize 2048)
  dscheck(cd1): bio_bcount 1024 is not on a sector boundary (ssize 2048)
  if 2048 is the sector size. If this worries anyone: the message is from
  /usr/src/sys/kern/subr_diskslice.c and shutups are to be placed there.
+ Have read_block and write_block use an additional parameter, the
  sector size.
+ replace all barfout calls with return NULL, 0, __LINE__, etc.
  Note that this does NOT emit diagnostics. More often than not,
  you don't want library functions to scribble on stderr -- it may
  not even be available. The right thing is to propagate the error
  condition to upper management. The app should take care of errors.
+ use d1->sector_size instead of 512 in various places. I've left many
  places untouched, especially those writing MBRs. I simply added
  another arg hardcoded as 512. This is because I would not know what
  I'm doing... I felt this approach would be reasonably backward
  compatible and not introduce any new bugs in critical software.
  Famous last words. Messing with MBRs might soon put me in the same
  screwup meister category as, uh, never mind.  :-)
+ bump the max no of disks from 20 to 32 (due to PR 24503).

PR:		8434 / 8436 / 24503
Submitted by:	Jens Schweikhardt <schweikh@schweikhardt.net>
2001-05-13 20:08:54 +00:00
David E. O'Brien
e32cb81d24 Add spaces around operators.
It's OK, the Project and afford them now -- they aren't as expensive as
they used to be.
2001-04-01 12:18:20 +00:00
David E. O'Brien
8c32a31fd2 Try to untangle some of the #ifdef spaghetti.
Also, looking to the future, don't assume all the world is an i386 and all
its disk layout brain damage will be repeated by other platforms.  So all
the diking out if we are an Alpha, becomes adding in if we are an i386.
2001-04-01 11:37:31 +00:00
David E. O'Brien
656533ef4d Quiet warnings on the Alpha. 2001-04-01 11:22:40 +00:00
David E. O'Brien
135c56336a Libraries should _never_ call exit() themselves (or its alternate spelling
`err()').  libdisk does! and additionally libdisk gets confused on Alpha
disks with foreign disklabels, throws up its hands and exits.  This is
the cause of the "going no where without my init" install bug on the Alpha.

So now on the Alpha, rather than call err(), we print the error string and
continue processing.

Submitted by:	jkh
2001-03-18 21:30:11 +00:00
Robert Nordier
f0da1b03a0 Do install-time configuration of the i386 boot0 boot manager. At
present, this is limited to turning on the packet option if any of
disk slices begin above cylinder 1023.  The effect of this change
should therefore be to automatically enable LBA support, as needed,
when installing FreeBSD.

Something-of-the-kind-requested-by: peter
2000-12-12 17:25:06 +00:00
Yoshihiro Takahashi
552112cadd - Added support for installing boot0 and boot0.5 for PC-98.
- Cosmetic changes.
2000-08-12 14:20:31 +00:00
Yoshihiro Takahashi
9ede9bda28 - Fixed warnings and typo.
- Recognize slice type 0x24 as FAT (only PC-98).

Submitted by:	Nobuyuki Koganemaru <kogane@koganemaru.co.jp>
2000-08-08 04:01:51 +00:00
John Baldwin
be0fdc4646 - Allow support for MBR boot loaders that are longer than one sector. As
with fdisk, ensure that they are a multiple of the sector size in length.
- Axe all the 1024 cylinder checks as they are no longer relevant with the
  fixed bootstrap.
2000-07-12 18:05:18 +00:00
John Baldwin
61e9944f4f _PATH_DEV'ify libdisk 2000-06-28 22:28:50 +00:00
Mike Smith
ad3a8d908d /dev/rXXX -> /dev/XXX
This should fix sysinstall and other tools that don't expect the 'r' devices
to exist anymore (and thus don't create them).
2000-05-31 00:51:57 +00:00
KATO Takenori
7e9e421193 Changes for PC-98. 2000-03-29 15:10:28 +00:00
Philippe Charnier
c0154e9a31 lowercase error message 2000-03-26 15:14:16 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Doug Rabson
c914395258 Back out the last change to disk.c - a kernel change removed the need.
Enabled writing to the disklabel when writing a disk (only affects alpha).
1999-05-09 11:34:58 +00:00
Jordan K. Hubbard
35ea9462db More support for Alpha installs.
Submitted by:   dfr
1999-01-29 11:39:24 +00:00
Jordan K. Hubbard
a864ef37a3 Changes for alpha support.
Submitted by:	dfr
1999-01-08 00:32:19 +00:00
Mike Smith
f5ce88ded8 Fixes for handling 'wfd' (and any other disk with a non-2-character name)
Submitted by:	Some from Satoh Junichi (junichi@astec.co.jp)
1998-10-27 21:14:03 +00:00
Doug Rabson
5b4c313702 Teach libdisk about alpha boot blocks. 1998-10-06 11:57:08 +00:00
Jordan K. Hubbard
55ff249dd5 Eliminate unaligned access on Alpha and also neaten up this code a little.
Submitted by:	dfr
1998-09-30 21:40:51 +00:00
John Polstra
fd898ba100 Extend the existing hackery to set the disk type to SCSI for the
"da" and "od" devices.  Formerly ESDI was used for them, causing
problems for fresh installations of CAM systems.
1998-06-27 02:01:25 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
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.
1997-01-14 07:20:47 +00:00
Poul-Henning Kamp
00f723bf6b Improve the Dangerously Dedidcated mode a bit. Not much, but a bit better. 1996-11-27 22:44:43 +00:00
Jordan K. Hubbard
d402093152 Move some warn()'s into DEBUG space since I don't need them coming
out in my curses interfaces and spamming my screen.
1996-04-29 05:03:02 +00:00
Peter Wemm
40b0c0d936 Update the -current sources from the 2.1 branch.
Approved (in spirit) by: jkh
1995-12-07 10:34:59 +00:00
David Greenman
bdc3c66075 Brought in changes from rev 1.14.2.1 into main branch. 1995-08-26 04:57:03 +00:00
Rodney W. Grimes
d3628763db Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
Rodney W. Grimes
e5370bd7fe Remove trailing whitespace. 1995-05-30 08:29:07 +00:00
Jordan K. Hubbard
2f2a4e7a4a Align slices to cylinder boundries.
Submitted By: phk
1995-05-24 08:59:40 +00:00
Poul-Henning Kamp
c5cc77ec44 Fix a typo, now there should always be an active slice. 1995-05-21 07:47:24 +00:00
Poul-Henning Kamp
739618d119 Remove two printfs before Jordan has a fit over them. 1995-05-18 22:25:37 +00:00
Poul-Henning Kamp
d81adf1ebe Recognize slice type #6 as dos
handle OnTrack Disk manager correctly.
1995-05-08 02:08:33 +00:00
Poul-Henning Kamp
b83d7daff4 General sanitation and cleanup. Killed the "reserved" type, it wasn't. 1995-05-06 03:28:32 +00:00
Poul-Henning Kamp
e9851d87a8 Make the partitions names even more sensible
CheckRules sets the CHUNK_ALIGN & CHUNK_PAST_1024 flags.
1995-05-04 07:00:57 +00:00
Poul-Henning Kamp
20c9844ca0 start CHS is 0xff,0xff,0xff if past 1024.
end CHS is 1023,bios_hd,bios_sect if past 1024.  This way we can find
bios the geometry again.
Added a primitive "scan" to tst01.
1995-05-01 04:05:27 +00:00
Poul-Henning Kamp
87d4886cc3 Use the DIOCSYNCSLICE ioctl now. (use only with kernel from this morning).
Get the CHS's right.
Get the disklabels (more) right.
1995-04-30 22:51:05 +00:00
Poul-Henning Kamp
9781a14091 get bootblocks right.
Add mbr and bteasy17 to tst01
read partitions from kernel instead of disk.
Still problems with writing labels, discussing with Bruce.
Extended slices doesn't get written yet.
1995-04-30 11:04:16 +00:00
Poul-Henning Kamp
e6b172ee57 Use 0xff for CHS when past 1024 cyls.
Fix (hopefully) a bug Gary found.
1995-04-30 07:30:45 +00:00
Poul-Henning Kamp
2d5caf92d0 Now we do writes too. 1995-04-30 06:09:29 +00:00
Poul-Henning Kamp
a29b6fccc0 Names are assigned when chunks are created.
Rules for only one fat & one extended in MBR.
1995-04-29 07:21:14 +00:00