A stupid little program you can use to dump the bios and hunt for version
strings etc.
default is to mmap the last 1MB of the 32-bit space and write it to fildes
1. optional arg 1 is the base (it gets << 16 thanks to a strtol bug that
may no longer be there); optional arg 2 is the size.
Tested on just about everything linux, I don't see any obvious gotchas for
freebsd.
ron
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
main(int argc, char *argv[])
{
int i;
volatile unsigned char *cp;
int fd;
volatile void *v;
off_t nvram = 0xfff00000;
/* avoid linux mmap bug */
size_t length = 0x100000 /*- 0x1000*/;
if (argc > 1)
nvram = (strtol(argv[1], 0, 0)) << 16;
if (argc > 2)
length = (strtol(argv[2], 0, 0)) ;
if((fd = open("/dev/mem",O_RDWR)) != -1)
{
v = mmap(0, length, PROT_READ | PROT_WRITE, MAP_SHARED,fd,nvram);
fprintf(stderr, "mmap returns %p\n", v);
if ( (int)v == -1)
{
perror("mmap");
exit(1);
}
} else {
perror("open /dev/mem");
exit(1);
}
write(1, v, length);
}
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message