summaryrefslogtreecommitdiff
path: root/lib/libdisk/write_disk.c
AgeCommit message (Collapse)Author
2012-12-30With the old sade removed, libdisk is no longer used by anything in HEADNathan Whitehorn
and uses a number of problematic pre-gpart interfaces. Since it has been entirely obsoleted by interfaces in geom, remove it. Notes: svn path=/head/; revision=244865
2003-11-02Do not fill in d_ncylinders, d_ntracks and d_nsectors in the disklabelMarcel Moolenaar
on ia64. Not only do we not have a disklabel by default, we also do not have a notion of cylinders, tracks and sectors. Notes: svn path=/head/; revision=121887
2003-04-04Libdisk does not need to include <sys/diskslice.h> any more.Poul-Henning Kamp
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
2003-02-04- Remove unused old disk pointers from Write_FreeBSD() and Fill_Disklabel()John Baldwin
functions. - Clean up a few signed/unsigned warnings. Notes: svn path=/head/; revision=110339
2002-11-15Fixed style(9)Yoshihiro Takahashi
Notes: svn path=/head/; revision=106949
2002-10-23Untangle #ifdefs in the write-end of things by giving each arch itsPoul-Henning Kamp
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
2002-10-23Separate the struct disklabel filling stuff from the rest of Write_FreeBSD().Poul-Henning Kamp
Notes: svn path=/head/; revision=105815
2002-10-22Swing the weed-whacker around libdisk:Poul-Henning Kamp
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
2002-10-02#include the right thing for PC98Poul-Henning Kamp
Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104362
2002-10-01Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:Poul-Henning Kamp
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
2002-05-12Retire the bogus uses of the disklabel field d_sbsize and begin toPoul-Henning Kamp
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
2002-03-25Modernize my email address.Poul-Henning Kamp
Notes: svn path=/head/; revision=93149
2001-09-30Add __FBSDID()s to libdiskMatthew Dillon
Notes: svn path=/head/; revision=84200
2001-05-13+ add u_long sector_size to struct disk (documented in libdisk.3)Jordan K. Hubbard
+ 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
2001-04-01Add spaces around operators.David E. O'Brien
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
2001-04-01Try to untangle some of the #ifdef spaghetti.David E. O'Brien
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
2001-04-01Quiet warnings on the Alpha.David E. O'Brien
Notes: svn path=/head/; revision=75065
2001-03-18Libraries should _never_ call exit() themselves (or its alternate spellingDavid E. O'Brien
`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
2000-12-12Do install-time configuration of the i386 boot0 boot manager. AtRobert Nordier
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
2000-08-12- Added support for installing boot0 and boot0.5 for PC-98.Yoshihiro Takahashi
- Cosmetic changes. Notes: svn path=/head/; revision=64555
2000-08-08- Fixed warnings and typo.Yoshihiro Takahashi
- Recognize slice type 0x24 as FAT (only PC-98). Submitted by: Nobuyuki Koganemaru <kogane@koganemaru.co.jp> Notes: svn path=/head/; revision=64379
2000-07-12- Allow support for MBR boot loaders that are longer than one sector. AsJohn Baldwin
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
2000-06-28_PATH_DEV'ify libdiskJohn Baldwin
Notes: svn path=/head/; revision=62223
2000-05-31/dev/rXXX -> /dev/XXXMike Smith
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
2000-03-29Changes for PC-98.KATO Takenori
Notes: svn path=/head/; revision=58794
2000-03-26lowercase error messagePhilippe Charnier
Notes: svn path=/head/; revision=58632
1999-08-28$Id$ -> $FreeBSD$Peter Wemm
Notes: svn path=/head/; revision=50476
1999-05-09Back out the last change to disk.c - a kernel change removed the need.Doug Rabson
Enabled writing to the disklabel when writing a disk (only affects alpha). Notes: svn path=/head/; revision=46787
1999-01-29More support for Alpha installs.Jordan K. Hubbard
Submitted by: dfr Notes: svn path=/head/; revision=43393
1999-01-08Changes for alpha support.Jordan K. Hubbard
Submitted by: dfr Notes: svn path=/head/; revision=42387
1998-10-27Fixes for handling 'wfd' (and any other disk with a non-2-character name)Mike Smith
Submitted by: Some from Satoh Junichi (junichi@astec.co.jp) Notes: svn path=/head/; revision=40676
1998-10-06Teach libdisk about alpha boot blocks.Doug Rabson
Notes: svn path=/head/; revision=40000
1998-09-30Eliminate unaligned access on Alpha and also neaten up this code a little.Jordan K. Hubbard
Submitted by: dfr Notes: svn path=/head/; revision=39844
1998-06-27Extend the existing hackery to set the disk type to SCSI for theJohn Polstra
"da" and "od" devices. Formerly ESDI was used for them, causing problems for fresh installations of CAM systems. Notes: svn path=/head/; revision=37179
1997-02-22Revert $FreeBSD$ to $Id$Peter Wemm
Notes: svn path=/head/; revision=22993
1997-01-14Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard
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
1996-11-27Improve the Dangerously Dedidcated mode a bit. Not much, but a bit better.Poul-Henning Kamp
Notes: svn path=/head/; revision=19989
1996-04-29Move some warn()'s into DEBUG space since I don't need them comingJordan K. Hubbard
out in my curses interfaces and spamming my screen. Notes: svn path=/head/; revision=15441
1995-12-07Update the -current sources from the 2.1 branch.Peter Wemm
Approved (in spirit) by: jkh Notes: svn path=/head/; revision=12661
1995-08-26Brought in changes from rev 1.14.2.1 into main branch.David Greenman
Notes: svn path=/head/; revision=10286
1995-06-11Merge RELENG_2_0_5 into HEADRodney W. Grimes
Notes: svn path=/head/; revision=9202
1995-05-30Remove trailing whitespace.Rodney W. Grimes
Notes: svn path=/head/; revision=8881
1995-05-24Align slices to cylinder boundries.Jordan K. Hubbard
Submitted By: phk Notes: svn path=/head/; revision=8721
1995-05-21Fix a typo, now there should always be an active slice.Poul-Henning Kamp
Notes: svn path=/head/; revision=8670
1995-05-18Remove two printfs before Jordan has a fit over them.Poul-Henning Kamp
Notes: svn path=/head/; revision=8617
1995-05-08Recognize slice type #6 as dosPoul-Henning Kamp
handle OnTrack Disk manager correctly. Notes: svn path=/head/; revision=8346
1995-05-06General sanitation and cleanup. Killed the "reserved" type, it wasn't.Poul-Henning Kamp
Notes: svn path=/head/; revision=8303
1995-05-04Make the partitions names even more sensiblePoul-Henning Kamp
CheckRules sets the CHUNK_ALIGN & CHUNK_PAST_1024 flags. Notes: svn path=/head/; revision=8264
1995-05-01start CHS is 0xff,0xff,0xff if past 1024.Poul-Henning Kamp
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
1995-04-30Use the DIOCSYNCSLICE ioctl now. (use only with kernel from this morning).Poul-Henning Kamp
Get the CHS's right. Get the disklabels (more) right. Notes: svn path=/head/; revision=8192