2 * Copyright 2002, François Revol, revol@free.fr.
3 * Distributed under the terms of the MIT License.
11 // 2002, François Revol
12 // technical reference:
13 // http://bedriven.be-in.org/document/280-serial_port_driver.html
14 // 2004: bedriven is down now, mirror at:
15 // http://web.archive.org/web/20040220055400/http://bedriven.be-in.org/document/280-serial_port_driver.html
17 int main(int argc
, char **argv
)
19 char *default_scan
[] = { "scsi_dsk", "scsi_cd", "ata", "atapi" }; // not really sure here...
20 char *default_scan_names
[] = { "scsi disks", "scsi cdroms", "ide ata", "ide atapi" };
21 char **scan
= default_scan
;
22 char **scan_names
= default_scan_names
;
27 if (argc
== 2 && !strcmp(argv
[1], "--help")) {
28 printf("usage: rescan [driver]\n");
32 scan
= scan_names
= argv
;
34 scan_index
++; // not argv[0]
36 for (; scan_index
< scan_count
; scan_index
++) {
37 printf("scanning %s...\n", scan_names
[scan_index
]);
38 fd_dev
= open("/dev", O_WRONLY
);
39 write(fd_dev
, scan
[scan_index
], strlen(scan
[scan_index
]));