summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-09-20 10:43:13 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-09-20 10:43:13 +0000
commit06adc5357ddedbed682bc3662dceb504da207ce8 (patch)
tree4527e8b7845902f193b774eb0999bacd780a4b30 /lib
parent5d3ce8c3d9eb103d32d9e4c12833a2dc965a5436 (diff)
downloadsrc-test2-06adc5357ddedbed682bc3662dceb504da207ce8.tar.gz
src-test2-06adc5357ddedbed682bc3662dceb504da207ce8.zip
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libdisk/change.c7
-rw-r--r--lib/libdisk/create_chunk.c21
-rw-r--r--lib/libdisk/libdisk.h12
-rw-r--r--lib/libdisk/tst01.c9
-rw-r--r--lib/libdisk/write_disk.c6
5 files changed, 35 insertions, 20 deletions
diff --git a/lib/libdisk/change.c b/lib/libdisk/change.c
index 57ccbfade012..1ecd22056983 100644
--- a/lib/libdisk/change.c
+++ b/lib/libdisk/change.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: change.c,v 1.8.2.1 1995/06/05 02:24:20 jkh Exp $
+ * $Id: change.c,v 1.9 1995/06/11 19:29:31 rgrimes Exp $
*
*/
@@ -46,7 +46,7 @@ Set_Bios_Geom(struct disk *disk, u_long cyl, u_long hd, u_long sect)
}
void
-All_FreeBSD(struct disk *d)
+All_FreeBSD(struct disk *d, int force_all)
{
struct chunk *c;
@@ -57,5 +57,6 @@ All_FreeBSD(struct disk *d)
goto again;
}
c=d->chunks;
- Create_Chunk(d,c->offset,c->size,freebsd,0xa5,0);
+ Create_Chunk(d,c->offset,c->size,freebsd,0xa5,
+ force_all? CHUNK_FORCE_ALL: 0);
}
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index ad0c8020134a..a9688290e7ac 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.20.2.1 1995/05/31 23:53:45 jkh Exp $
+ * $Id: create_chunk.c,v 1.21 1995/06/11 19:29:33 rgrimes Exp $
*
*/
@@ -157,15 +157,18 @@ Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, int subty
int i;
u_long l;
- /* Never use the first track */
- if (!offset) {
- offset += d->bios_sect;
- size -= d->bios_sect;
- }
+ if(!(flags & CHUNK_FORCE_ALL))
+ {
+ /* Never use the first track */
+ if (!offset) {
+ offset += d->bios_sect;
+ size -= d->bios_sect;
+ }
- /* Always end on cylinder boundary */
- l = (offset+size) % (d->bios_sect * d->bios_hd);
- size -= l;
+ /* Always end on cylinder boundary */
+ l = (offset+size) % (d->bios_sect * d->bios_hd);
+ size -= l;
+ }
i = Add_Chunk(d,offset,size,"X",type,subtype,flags);
Fixup_Names(d);
diff --git a/lib/libdisk/libdisk.h b/lib/libdisk/libdisk.h
index e7d6bd3bcd67..12c3a9a5d7c0 100644
--- a/lib/libdisk/libdisk.h
+++ b/lib/libdisk/libdisk.h
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: libdisk.h,v 1.18.2.2 1995/06/05 02:24:32 jkh Exp $
+ * $Id: libdisk.h,v 1.19 1995/06/11 19:29:35 rgrimes Exp $
*
*/
@@ -74,6 +74,10 @@ struct chunk {
/* This 'part' is a rootfs, allocate 'a' */
# define CHUNK_ACTIVE 32
/* This is the active slice in the MBR */
+# define CHUNK_FORCE_ALL 64
+ /* Force a dedicated disk for FreeBSD, bypassing
+ * all BIOS geometry considerations
+ */
void (*private_free)(void*);
void *(*private_clone)(void*);
@@ -138,8 +142,10 @@ Create_Chunk(struct disk *disk, u_long offset, u_long size, chunk_e type, int su
*/
void
-All_FreeBSD(struct disk *d);
- /* Make one FreeBSD chunk covering the entire disk
+All_FreeBSD(struct disk *d, int force_all);
+ /* Make one FreeBSD chunk covering the entire disk;
+ * if force_all is set, bypass all BIOS geometry
+ * considerations.
*/
char *
diff --git a/lib/libdisk/tst01.c b/lib/libdisk/tst01.c
index 2793778edd40..93286c7c1065 100644
--- a/lib/libdisk/tst01.c
+++ b/lib/libdisk/tst01.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: tst01.c,v 1.14.2.1 1995/06/05 02:24:35 jkh Exp $
+ * $Id: tst01.c,v 1.15 1995/06/11 19:29:37 rgrimes Exp $
*
*/
@@ -189,7 +189,11 @@ main(int argc, char **argv)
continue;
}
if (!strcasecmp(*cmds,"allfreebsd")) {
- All_FreeBSD(d);
+ All_FreeBSD(d, 0);
+ continue;
+ }
+ if (!strcasecmp(*cmds,"dedicate")) {
+ All_FreeBSD(d, 1);
continue;
}
if (!strcasecmp(*cmds,"bios") && ncmd == 4) {
@@ -280,6 +284,7 @@ main(int argc, char **argv)
printf("\007ERROR\n");
printf("CMDS:\n");
printf("\tallfreebsd\n");
+ printf("\tdedicate\n");
printf("\tbios cyl hd sect\n");
printf("\tboot\n");
printf("\tbteasy17\n");
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index e745917e5bae..f592dafae397 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: write_disk.c,v 1.14 1995/06/11 19:29:38 rgrimes Exp $
+ * $Id: write_disk.c,v 1.14.2.1 1995/07/21 11:22:38 rgrimes Exp $
*
*/
@@ -79,11 +79,11 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
dl->d_secsize = 512;
dl->d_secperunit = new->chunks->size;
#if 0
- dl->d_secpercyl = new->real_cyl ? new->real_cyl : new->bios_cyl;
+ dl->d_ncylinders = new->real_cyl ? new->real_cyl : new->bios_cyl;
dl->d_ntracks = new->real_hd ? new->real_hd : new->bios_hd;
dl->d_nsectors = new->real_sect ? new->real_sect : new->bios_sect;
#else
- dl->d_secpercyl = new->bios_cyl;
+ dl->d_ncylinders = new->bios_cyl;
dl->d_ntracks = new->bios_hd;
dl->d_nsectors = new->bios_sect;
#endif