home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1035
/
fdisk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-28
|
2KB
|
98 lines
/***************************************************************
* Fdisk Prototype
***************************************************************
*
* Revision Control Information
*
* By: $Author: root $
* $Revision: 1.2 $
* Last modified: $Date: 87/09/16 02:12:16 $
* $Source: /u/src/microport/newfdisk/test/RCS/fdisk.c,v $
*
* Release state: $State: Exp $
*
***************************************************************
*
* Modification Log
* ----------------
* $Log: fdisk.c,v $
* Revision 1.2 87/09/16 02:12:16 root
* maintenance update
*
* Revision 1.1 88/04/07 23:10:47 root
* Initial revision
*
*
***************************************************************
*
* Get Master Boot Block which contains
* * possable disk geometry info
* Partition structure
* MBB signature
*
* If MBB not valid: (Newly formatted disk)
* Get disk geometry from user
* Get partition table info from user
* Get Slice Table from user
* initialize MBB with contents of /etc/master.bblock
* initialize PBB
* initialize PER
* initialize BTT
* initialize SLICE TABLE
* Recalibrate drive
*
* else (MBB is valid)
* get PBB
* get PER
* get BTT
* get SLICE TABLE
* get disk geometry from PER/PBB/MBB/cmos
*
* Allow user to modify:
* Drive type: invalidates MBB,PBB,PER
* Partition table from MBB: if act part changes,
* PER&BTT need to be redone
* BTT: nothing invalidated.
* PER:?
* SLICE TABLE: need to mkfs the thing...
***************************************************************
*/
#ifndef lint
static char rcsid[] =
"$Header: fdisk.c,v 1.2 87/09/16 02:12:16 root Exp $";
#endif
#include <fcntl.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/types.h>
#include <malloc.h>
#include "cmos.h" /* cmos layout */
#include "mbb.h" /* master boot block */
#include "pbb.h" /* partition boot block */
#include "btt.h" /* bad track table */
#include "per.h" /* partition end record */
#include "fdisk.h"
cmos_t cmos; /* CMOS contents */
mbb_t mbb; /* Master Boot Block */
pbb_t pbb; /* Partition Boot Block */
btt_t btt; /* Bad Track Table */
per_t per; /* Partition End Record */
main() {
int cc;
cc = openunit( 0 );
cc |= get_cmos( &cmos );
cc |= get_mbb( 0, &mbb );
cc |= get_pbb( 0, &mbb, &pbb );
cc |= get_per( 0, &mbb, &per );
cc |= get_btt( 0, &mbb, &btt );
cc |= closeunit( 0 );
}