diff options
author | phk <phk@FreeBSD.org> | 1995-04-28 23:57:04 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-04-28 23:57:04 +0000 |
commit | 773ad9f330436a3c7484840bf3a542958fd14c96 (patch) | |
tree | 52b9513433e8fa4d94139f8ec002668ef2560b11 /lib/libdisk/change.c | |
parent | e31775a1086bdadc2cd01b0eed72cb217fb1e9e8 (diff) | |
download | FreeBSD-src-773ad9f330436a3c7484840bf3a542958fd14c96.zip FreeBSD-src-773ad9f330436a3c7484840bf3a542958fd14c96.tar.gz |
This is a revision 0.00 of the backend stuff for the fdisk/disklabel stuff
in the new sysinstall. If you want to give a helping hand, then send email
to phk@FreeBSD.ORG. DO NOT COMMIT TO THIS DIRECTORY!
Diffstat (limited to 'lib/libdisk/change.c')
-rw-r--r-- | lib/libdisk/change.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/libdisk/change.c b/lib/libdisk/change.c new file mode 100644 index 0000000..17dd782 --- /dev/null +++ b/lib/libdisk/change.c @@ -0,0 +1,45 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + * + * $Id$ + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> +#include <err.h> +#include <sys/types.h> +#include <sys/queue.h> +#include "libdisk.h" + +struct disk * +Set_Phys_Geom(struct disk *disk, u_long cyl, u_long hd, u_long sect) +{ + struct disk *d = Int_Open_Disk(disk->name,cyl*hd*sect); + d->real_cyl = cyl; + d->real_hd = hd; + d->real_sect = sect; + d->bios_cyl = disk->bios_cyl; + d->bios_hd = disk->bios_hd; + d->bios_sect = disk->bios_sect; + d->flags = disk->flags; + Free_Disk(disk); + return d; +} + +void +Set_Bios_Geom(struct disk *disk, u_long cyl, u_long hd, u_long sect) +{ + disk->bios_cyl = cyl; + disk->bios_hd = hd; + disk->bios_sect = sect; + Bios_Limit_Chunk(disk->chunks,1024*hd*sect); +} |