diff options
author | kraxel <kraxel> | 2008-10-30 09:59:57 +0000 |
---|---|---|
committer | kraxel <kraxel> | 2008-10-30 09:59:57 +0000 |
commit | 67ae9c9d246070251ba1ab9660bf5cb78deefb82 (patch) | |
tree | 6ffcededa4d9ba6efb72c38de899657788c92028 | |
parent | 7c080383cd6cc523b0bd196dc5d13112d3929b24 (diff) | |
download | amtterm-67ae9c9d246070251ba1ab9660bf5cb78deefb82.tar.gz |
- make BIOS-over-SOL work.
-rw-r--r-- | GNUmakefile | 1 | ||||
-rw-r--r-- | amtterm.c | 15 | ||||
-rwxr-xr-x | amttool | 8 |
3 files changed, 18 insertions, 6 deletions
diff --git a/GNUmakefile b/GNUmakefile index bfc3f0e..5fcb4d6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -55,6 +55,7 @@ clean: distclean: clean rm -f Make.config + rm -f mk/*.dep ################################################################# @@ -69,7 +69,7 @@ static int redir_loop(struct redir *r) { unsigned char buf[BUFSIZE+1]; struct timeval tv; - int rc; + int rc, i; fd_set set; for(;;) { @@ -91,7 +91,7 @@ static int redir_loop(struct redir *r) fprintf(stderr,"select: timeout\n"); return -1; } - + if (FD_ISSET(0,&set)) { /* stdin has data */ rc = read(0,buf,BUFSIZE); @@ -107,6 +107,11 @@ static int redir_loop(struct redir *r) if (r->verbose) fprintf(stderr, "\n" APPNAME ": saw ^], exiting\n"); redir_sol_stop(r); + } + for (i = 0; i < rc; i++) { + /* meet BIOS expectations */ + if (buf[i] == 0x0a) + buf[i] = 0x0d; } if (-1 == redir_sol_send(r, buf, rc)) return -1; @@ -136,7 +141,7 @@ static void tty_save(void) static void tty_noecho(void) { struct termios tattr; - + memcpy(&tattr,&saved_attributes,sizeof(struct termios)); tattr.c_lflag &= ~(ECHO); tcsetattr (0, TCSAFLUSH, &tattr); @@ -145,7 +150,7 @@ static void tty_noecho(void) static void tty_raw(void) { struct termios tattr; - + fcntl(0,F_SETFL,O_NONBLOCK); memcpy(&tattr,&saved_attributes,sizeof(struct termios)); tattr.c_lflag &= ~(ISIG|ICANON|ECHO); @@ -260,6 +265,6 @@ int main(int argc, char *argv[]) redir_start(&r); redir_loop(&r); tty_restore(); - + exit(0); } @@ -13,6 +13,7 @@ $amt_debug = $ENV{'AMT_DEBUG'} if defined($ENV{'AMT_DEBUG'}); my $amt_command = shift; $amt_command = "info" if !defined($amt_command); +my $amt_arg = shift; my $amt_version; @@ -277,7 +278,12 @@ sub remote_control($) { if ($reply =~ m/^(y|yes)$/i) { printf "execute: %s\n", $command; push (@args, SOAP::Data->name('Command' => $rcc{$command})); - push (@args, SOAP::Data->name('IanaOemNumber' => 4542)); + push (@args, SOAP::Data->name('IanaOemNumber' => 343)); + if (defined($amt_arg) && $amt_arg eq 'bios') { + push (@args, SOAP::Data->name('OEMparameters' => 1 )); + push (@args, SOAP::Data->name('SpecialCommand' => 0xC1 )); + push (@args, SOAP::Data->name('SpecialCommandParameter' => 0)); + } do_soap($rcs, "RemoteControl", @args); } else { printf "canceled\n"; |