1 /* device.h - Device access
3 * Copyright 1992-1996 Werner Almesberger
4 * Copyright 1999-2004 John Coffman
5 * Copyright 2009-2011 Joachim Wiedorn
8 * Licensed under the terms contained in the file 'COPYING'
9 * in the source directory.
26 int dev_open(DEVICE *dev,int number,int flags);
28 /* Searches /dev for a block device with the specified number. If no device
29 can be found, a temporary device is created. The device is opened with
30 the specified access mode and the file descriptor is returned. If flags
31 are -1, the device is not opened. */
35 void dev_close(DEVICE *dev);
37 /* Closes a device that has previously been opened by dev_open. If the device
38 had to be created, it is removed now. */
42 void preload_dev_cache(void);
44 /* Preloads the device number to name cache. */
48 int make_backup(char *backup_file, int force_backup, BOOT_SECTOR *bsect,
49 unsigned int device, char *id);
51 /* make a backup, returning the timestamp of the backup file */
55 unsigned int register_bios(int bios, int device);
57 /* registers the bios to device association by serial number */
60 void dump_serial_nos(void);
62 /* debugging dump of the Volume Serial number table */
65 int serial_valid(unsigned int serial, int disk_bios);
66 /* determine validity of serial number; liberally if disk_bios==0x80 */
69 int pf_hard_disk_scan(void);
70 /* scan /proc/partitions for devices & partitions */
72 int yesno(char *prompt, int expect);
73 /* prompt the user for a yes/no response */
75 int new_serial(int device);
76 /* generate a new volumeID */