summaryrefslogtreecommitdiffstats
path: root/amtider.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2022-04-13 12:44:53 +0200
committerGerd Hoffmann <kraxel@redhat.com>2022-04-22 14:52:30 +0200
commit4d10e4bfde39110d8119e57730581d391ce6c8e7 (patch)
tree422d7d59076ece501dd2bcc850c6f06f7059e0ff /amtider.c
parentc01ea3c6fed1290062cfb55446af62bfaa8b1b89 (diff)
downloadamtterm-4d10e4bfde39110d8119e57730581d391ce6c8e7.tar.gz
ider: switch to floppy emulation
Diffstat (limited to 'amtider.c')
-rw-r--r--amtider.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/amtider.c b/amtider.c
index d266f31..3f0fefd 100644
--- a/amtider.c
+++ b/amtider.c
@@ -171,6 +171,7 @@ static void usage(FILE *fp)
" -h print this text\n"
" -v verbose (default)\n"
" -q quiet\n"
+ " -c use CD-ROM emulation\n"
" -g start redirection gracefully\n"
" -r start redirection on reboot\n"
" -f file file to use as device data\n"
@@ -204,14 +205,14 @@ int main(int argc, char *argv[])
r.cb_data = &r;
r.cb_recv = recv_ider;
r.cb_state = state_ider;
+ r.device = 0xa0;
r.enable_options = IDER_START_NOW;
- r.lba_size = (unsigned int)1 << 11;
if (NULL != (h = getenv("AMT_PASSWORD")))
snprintf(r.pass, sizeof(r.pass), "%s", h);
for (;;) {
- if (-1 == (c = getopt(argc, argv, "f:ghvqu:p:LC:")))
+ if (-1 == (c = getopt(argc, argv, "df:ghvqu:p:LC:")))
break;
switch (c) {
case 'v':
@@ -226,6 +227,9 @@ int main(int argc, char *argv[])
case 'u':
snprintf(r.user, sizeof(r.user), "%s", optarg);
break;
+ case 'c':
+ r.device = 0xb0;
+ break;
case 'g':
r.enable_options = IDER_START_GRACEFUL;
break;
@@ -289,7 +293,13 @@ int main(int argc, char *argv[])
perror("mmap");
exit(1);
}
-
+ if (r.device == 0xa0) {
+ r.lba_size = 512;
+ r.lba_shift = 9;
+ } else {
+ r.lba_size = 2048;
+ r.lba_shift = 11;
+ }
if (0 == strlen(r.pass)) {
tty_save();
tty_noecho();