notaz.gp2x.de
/
ginge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow arguments and fix environment handling
[ginge.git]
/
loader
/
tools
/
static.c
diff --git
a/loader/tools/static.c
b/loader/tools/static.c
index
50a35c9
..
edf7139
100644
(file)
--- a/
loader/tools/static.c
+++ b/
loader/tools/static.c
@@
-1,18
+1,27
@@
#include <stdio.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
-int main()
+int main(
int argc, char *argv[]
)
{
volatile void *memregs;
int memdev;
int i;
{
volatile void *memregs;
int memdev;
int i;
- printf("hi\n");
+ printf("hi, home=%s\n", getenv("HOME"));
+
+ for (i = 0; i < argc; i++)
+ printf("%d \"%s\"\n", i, argv[i]);
memdev = open("/dev/mem", O_RDWR);
memdev = open("/dev/mem", O_RDWR);
+ if (memdev < 0) {
+ perror("open");
+ return 1;
+ }
+
memregs = mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0xc0000000);
for (i = 0; i < 2; i++)
memregs = mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0xc0000000);
for (i = 0; i < 2; i++)