1 /* device.h - Device access
3 Copyright 1992-1996 Werner Almesberger.
4 Copyright 1999-2004 John Coffman.
7 Licensed under the terms contained in the file 'COPYING' in the
27 int dev_open(DEVICE *dev,int number,int flags);
29 /* Searches /dev for a block device with the specified number. If no device
30 can be found, a temporary device is created. The device is opened with
31 the specified access mode and the file descriptor is returned. If flags
32 are -1, the device is not opened. */
36 void dev_close(DEVICE *dev);
38 /* Closes a device that has previously been opened by dev_open. If the device
39 had to be created, it is removed now. */
43 void preload_dev_cache(void);
45 /* Preloads the device number to name cache. */
49 int make_backup(char *backup_file, int force_backup, BOOT_SECTOR *bsect,
50 unsigned int device, char *id);
52 /* make a backup, returning the timestamp of the backup file */
56 unsigned int register_bios(int bios, int device);
58 /* registers the bios to device association by serial number */
61 void dump_serial_nos(void);
63 /* debugging dump of the Volume Serial number table */
66 int serial_valid(unsigned int serial, int disk_bios);
67 /* determine validity of serial number; liberally if disk_bios==0x80 */
70 int pf_hard_disk_scan(void);
71 /* scan /proc/partitions for devices & partitions */
73 int yesno(char *prompt, int expect);
74 /* prompt the user for a yes/no response */
76 int new_serial(int device);
77 /* generate a new volumeID */