notaz.gp2x.de
/
ginge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ts tweaks for _dyn
[ginge.git]
/
loader
/
tools
/
static.c
diff --git
a/loader/tools/static.c
b/loader/tools/static.c
index
50013c7
..
3475228
100644
(file)
--- a/
loader/tools/static.c
+++ b/
loader/tools/static.c
@@
-1,16
+1,32
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <signal.h>
+#include <termios.h>
+#include <unistd.h>
+
+static int open_(const char *name)
+{
+ int fd = open(name, O_RDWR);
+ if (fd < 0) {
+ fprintf(stderr, "%s: ", name);
+ perror("open");
+ return 1;
+ }
+
+ return fd;
+}
int main(int argc, char *argv[])
{
volatile void *memregs;
int main(int argc, char *argv[])
{
volatile void *memregs;
- int memdev;
+ void *fbmem;
+ int memdev, fbdev;
int i;
printf("hi, home=%s\n", getenv("HOME"));
int i;
printf("hi, home=%s\n", getenv("HOME"));
@@
-18,21
+34,32
@@
int main(int argc, char *argv[])
for (i = 0; i < argc; i++)
printf("%d \"%s\"\n", i, argv[i]);
for (i = 0; i < argc; i++)
printf("%d \"%s\"\n", i, argv[i]);
- memdev = open("/dev/mem", O_RDWR);
- if (memdev < 0) {
- perror("open");
- return 1;
- }
+ memdev = open_("/dev/mem");
+ fbdev = open_("/dev/fb0");
memregs = mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0xc0000000);
memregs = mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0xc0000000);
+ fbmem = mmap(NULL, 320*240*2, PROT_READ|PROT_WRITE, MAP_SHARED, fbdev, 0);
+
ioctl(-1, 0);
signal(7, SIG_DFL);
ioctl(-1, 0);
signal(7, SIG_DFL);
+ system("buhbuh");
+ execl("bah", "bah", NULL);
+ execlp("bah", "bah", NULL);
+ if (argc == 1000)
+ fork();
+ chdir("wuhahaha!");
+ usleep(1);
+// tcgetattr(-1, NULL);
+// tcsetattr(-1, 0, NULL);
+#if 1
for (i = 0; i < 2; i++)
printf("%02x %04x %08x\n", ((char *)memregs)[0x2011],
((short *)memregs)[0x1198/2], ((int *)memregs)[0xbcdc/4]);
for (i = 0; i < 2; i++)
printf("%02x %04x %08x\n", ((char *)memregs)[0x2011],
((short *)memregs)[0x1198/2], ((int *)memregs)[0xbcdc/4]);
+#endif
+ memset(fbmem, 0xff, 320*240*2);
-
//sleep(100
0);
+
sleep(1
0);
return 0;
}
return 0;
}