summaryrefslogtreecommitdiff
path: root/lib/libdisk/write_disk.c
Commit message (Collapse)AuthorAgeFilesLines
* Libdisk does not need to include <sys/diskslice.h> any more.Poul-Henning Kamp2003-04-041-1/+0
| | | | | | | | | | | | Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h> Move i386/pc98 specific bits from <sys/reboot.h> to <i386/include/bootinfo.h> as well. Adjust includes in sys/boot accordingly. Notes: svn path=/head/; revision=113083
* - Remove unused old disk pointers from Write_FreeBSD() and Fill_Disklabel()John Baldwin2003-02-041-1/+1
| | | | | | | | functions. - Clean up a few signed/unsigned warnings. Notes: svn path=/head/; revision=110339
* Fixed style(9)Yoshihiro Takahashi2002-11-151-9/+10
| | | | Notes: svn path=/head/; revision=106949
* Untangle #ifdefs in the write-end of things by giving each arch itsPoul-Henning Kamp2002-10-231-314/+1
| | | | | | | | | | own file and own copy of WriteDisk() to do things in. This should have happened years ago, instead of adding #ifdefs all over the place. Notes: svn path=/head/; revision=105816
* Separate the struct disklabel filling stuff from the rest of Write_FreeBSD().Poul-Henning Kamp2002-10-231-42/+41
| | | | Notes: svn path=/head/; revision=105815
* Swing the weed-whacker around libdisk:Poul-Henning Kamp2002-10-221-40/+15
| | | | | | | | | | | | Constify some things. Staticize some things. Remove some unused things. Prototype some things. Don't install a gazillion man-pages links. Drop support for ON-TRACK disk-manager. Notes: svn path=/head/; revision=105681
* #include the right thing for PC98Poul-Henning Kamp2002-10-021-0/+4
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104362
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:Poul-Henning Kamp2002-10-011-0/+1
| | | | | | | | | | | | | | | | | | | Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h. These two new copies are still intact copies of disklabel.h and therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them in programs which already include <sys.disklabel.h> is currently a no-op. This commit adds a number of such #includes. Once I have verified that I have fixed all the places which need fixing, I will commit the updated versions of the three #include files. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104272
* Retire the bogus uses of the disklabel field d_sbsize and begin toPoul-Henning Kamp2002-05-121-1/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=96475
* Modernize my email address.Poul-Henning Kamp2002-03-251-1/+1
| | | | Notes: svn path=/head/; revision=93149
* Add __FBSDID()s to libdiskMatthew Dillon2001-09-301-3/+3
| | | | Notes: svn path=/head/; revision=84200
* + add u_long sector_size to struct disk (documented in libdisk.3)Jordan K. Hubbard2001-05-131-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + 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> Notes: svn path=/head/; revision=76551
* Add spaces around operators.David E. O'Brien2001-04-011-39/+38
| | | | | | | | It's OK, the Project and afford them now -- they aren't as expensive as they used to be. Notes: svn path=/head/; revision=75069
* Try to untangle some of the #ifdef spaghetti.David E. O'Brien2001-04-011-9/+9
| | | | | | | | | 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. Notes: svn path=/head/; revision=75067
* Quiet warnings on the Alpha.David E. O'Brien2001-04-011-1/+4
| | | | Notes: svn path=/head/; revision=75065
* Libraries should _never_ call exit() themselves (or its alternate spellingDavid E. O'Brien2001-03-181-1/+0
| | | | | | | | | | | | | | `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 Notes: svn path=/head/; revision=74426
* Do install-time configuration of the i386 boot0 boot manager. AtRobert Nordier2000-12-121-1/+23
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=69920
* - Added support for installing boot0 and boot0.5 for PC-98.Yoshihiro Takahashi2000-08-121-0/+7
| | | | | | | - Cosmetic changes. Notes: svn path=/head/; revision=64555
* - Fixed warnings and typo.Yoshihiro Takahashi2000-08-081-0/+2
| | | | | | | | | - Recognize slice type 0x24 as FAT (only PC-98). Submitted by: Nobuyuki Koganemaru <kogane@koganemaru.co.jp> Notes: svn path=/head/; revision=64379
* - Allow support for MBR boot loaders that are longer than one sector. AsJohn Baldwin2000-07-121-0/+3
| | | | | | | | | 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. Notes: svn path=/head/; revision=63030
* _PATH_DEV'ify libdiskJohn Baldwin2000-06-281-1/+2
| | | | Notes: svn path=/head/; revision=62223
* /dev/rXXX -> /dev/XXXMike Smith2000-05-311-1/+1
| | | | | | | | This should fix sysinstall and other tools that don't expect the 'r' devices to exist anymore (and thus don't create them). Notes: svn path=/head/; revision=61101
* Changes for PC-98.KATO Takenori2000-03-291-0/+85
| | | | Notes: svn path=/head/; revision=58794
* lowercase error messagePhilippe Charnier2000-03-261-1/+1
| | | | Notes: svn path=/head/; revision=58632
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Back out the last change to disk.c - a kernel change removed the need.Doug Rabson1999-05-091-1/+5
| | | | | | | Enabled writing to the disklabel when writing a disk (only affects alpha). Notes: svn path=/head/; revision=46787
* More support for Alpha installs.Jordan K. Hubbard1999-01-291-2/+10
| | | | | | | Submitted by: dfr Notes: svn path=/head/; revision=43393
* Changes for alpha support.Jordan K. Hubbard1999-01-081-1/+11
| | | | | | | Submitted by: dfr Notes: svn path=/head/; revision=42387
* Fixes for handling 'wfd' (and any other disk with a non-2-character name)Mike Smith1998-10-271-3/+4
| | | | | | | Submitted by: Some from Satoh Junichi (junichi@astec.co.jp) Notes: svn path=/head/; revision=40676
* Teach libdisk about alpha boot blocks.Doug Rabson1998-10-061-1/+18
| | | | Notes: svn path=/head/; revision=40000
* Eliminate unaligned access on Alpha and also neaten up this code a little.Jordan K. Hubbard1998-09-301-3/+13
| | | | | | | Submitted by: dfr Notes: svn path=/head/; revision=39844
* Extend the existing hackery to set the disk type to SCSI for theJohn Polstra1998-06-271-2/+3
| | | | | | | | "da" and "od" devices. Formerly ESDI was used for them, causing problems for fresh installations of CAM systems. Notes: svn path=/head/; revision=37179
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Improve the Dangerously Dedidcated mode a bit. Not much, but a bit better.Poul-Henning Kamp1996-11-271-7/+1
| | | | Notes: svn path=/head/; revision=19989
* Move some warn()'s into DEBUG space since I don't need them comingJordan K. Hubbard1996-04-291-1/+7
| | | | | | | out in my curses interfaces and spamming my screen. Notes: svn path=/head/; revision=15441
* Update the -current sources from the 2.1 branch.Peter Wemm1995-12-071-3/+3
| | | | | | | Approved (in spirit) by: jkh Notes: svn path=/head/; revision=12661
* Brought in changes from rev 1.14.2.1 into main branch.David Greenman1995-08-261-1/+10
| | | | Notes: svn path=/head/; revision=10286
* Merge RELENG_2_0_5 into HEADRodney W. Grimes1995-06-111-1/+7
| | | | Notes: svn path=/head/; revision=9202
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-9/+9
| | | | Notes: svn path=/head/; revision=8881
* Align slices to cylinder boundries.Jordan K. Hubbard1995-05-241-5/+4
| | | | | | | Submitted By: phk Notes: svn path=/head/; revision=8721
* Fix a typo, now there should always be an active slice.Poul-Henning Kamp1995-05-211-2/+2
| | | | Notes: svn path=/head/; revision=8670
* Remove two printfs before Jordan has a fit over them.Poul-Henning Kamp1995-05-181-4/+1
| | | | Notes: svn path=/head/; revision=8617
* Recognize slice type #6 as dosPoul-Henning Kamp1995-05-081-3/+14
| | | | | | | handle OnTrack Disk manager correctly. Notes: svn path=/head/; revision=8346
* General sanitation and cleanup. Killed the "reserved" type, it wasn't.Poul-Henning Kamp1995-05-061-3/+1
| | | | Notes: svn path=/head/; revision=8303
* Make the partitions names even more sensiblePoul-Henning Kamp1995-05-041-1/+9
| | | | | | | CheckRules sets the CHUNK_ALIGN & CHUNK_PAST_1024 flags. Notes: svn path=/head/; revision=8264
* start CHS is 0xff,0xff,0xff if past 1024.Poul-Henning Kamp1995-05-011-17/+12
| | | | | | | | | 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. Notes: svn path=/head/; revision=8196
* Use the DIOCSYNCSLICE ioctl now. (use only with kernel from this morning).Poul-Henning Kamp1995-04-301-28/+32
| | | | | | | | Get the CHS's right. Get the disklabels (more) right. Notes: svn path=/head/; revision=8192
* get bootblocks right.Poul-Henning Kamp1995-04-301-2/+6
| | | | | | | | | | 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. Notes: svn path=/head/; revision=8183
* Use 0xff for CHS when past 1024 cyls.Poul-Henning Kamp1995-04-301-22/+34
| | | | | | | Fix (hopefully) a bug Gary found. Notes: svn path=/head/; revision=8180