]> Joshua Wise's Git repositories - netwatch.git/blobdiff - tools/poke-rls.c
add dump-buffer command
[netwatch.git] / tools / poke-rls.c
index c6db7bccdde5223c10d113e331a307c816803512..03c4fb1fcf564d652612fd4f7376e0cac0ab11a1 100644 (file)
@@ -2,6 +2,7 @@
 #include <reg-82801b.h>
 #include <string.h>
 #include <stdint.h>
 #include <reg-82801b.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
 
 static uint16_t _get_PMBASE()
 {
 
 static uint16_t _get_PMBASE()
 {
@@ -13,19 +14,36 @@ static uint16_t _get_PMBASE()
        return pmbase;
 }
 
        return pmbase;
 }
 
+typedef struct {
+       uint32_t signature;
+       uint32_t type;
+       uint8_t data[];
+} packet_t;
 
 
-extern unsigned int poke(short addr);
+extern unsigned int poke(unsigned long addr, unsigned long * value);
 
 int main(int argc, char **argv)
 {
        unsigned int res;
 
 int main(int argc, char **argv)
 {
        unsigned int res;
+       packet_t * packet = (packet_t *)memalign(4096, sizeof(packet_t));
+
+       packet->signature = 0x1BADD00D;
+       packet->type = 42;
+       strcpy(packet->data, "hello, world!");
 
        if (iopl(3) < 0)
        {
                perror("iopl");
                return 1;
        }
 
        if (iopl(3) < 0)
        {
                perror("iopl");
                return 1;
        }
-
-       res = poke(_get_PMBASE() + 0x04);
-       printf("found %p\n", res);
+       
+       res = poke(_get_PMBASE() + 0x04, (void *)packet);
+       printf("returned %p\n", res);
+
+       if (res == 42) {
+               printf("%s\n", packet->data);
+               printf("%s\n", packet->data+41);
+               printf("%s\n", packet->data+82);
+               printf("%s\n", packet->data+123);
+       }
 }
 }
This page took 0.020601 seconds and 4 git commands to generate.