summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile1
-rw-r--r--amtterm.c15
-rwxr-xr-xamttool8
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
#################################################################
diff --git a/amtterm.c b/amtterm.c
index bdafb7b..49c5590 100644
--- a/amtterm.c
+++ b/amtterm.c
@@ -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);
}
diff --git a/amttool b/amttool
index d1b0f48..b47d3fe 100755
--- a/amttool
+++ b/amttool
@@ -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";