PDA

View Full Version : restarter



yeager
20-08-2007, 23:26
hi
is it possible to run this on asus wl500b?

http://www.wardriving.pl/new.php?nr=84

how can i compiling file reset.c to make executable on asus?

reset.c


00 /* RESETER.c (c) 2004 Marcin Lukasik */
01
02 #include <sys/io.h>
03 #include <unistd.h>
04 #include <stdio.h>
05 #include <stdlib.h>
06
07 #include "port.h"
08
09 #define ERR " \033[0;22m\033[31m-\033[31;1m>\033[31;22m-\033[0m "
10
11 int main(int argc, char **argv) {
12
13 unsigned int t = 0;
14
15 if(getuid() != 0) {
16 printf("ERROR: To access LPT from Linux you must run this program as root.");
17 exit(-1);
18 }
19
20 if(argc != 2) {
21 printf("%sUsage: %s reset_time_in_sec\n", ERR, argv[0]);
22 exit(-1);
23 }
24
25
26 t = atoi(argv[1]) * 1000000;
27
28
29 ioperm(0x378, 3, 1); // open port
30 port_out(0x378, 255); // HI on b2-b9 (relay open - RESET)
31 usleep(t); // sleep for t seconds
32 port_out(0x378, 0); // LOW on (relay closed - NORMAL OPERATION)
33
34 return 0;
35 }
36

yeager
22-08-2007, 14:11
please, anyone. i need it urgentli.