Re: ioremap_nocache(0xfffe0000, 0x00020000);

From: Jon Burgess (
Date: Mon Aug 05 2002 - 05:29:02 EST

I used the program below to get a copy of Bios rom on a National Geode / CS5530
board. If I remember correctly this code depended on the chipset decoding the
rom at this specific address range, the 'standard' address range was
0xC0000..0xFFFFF but not all the Rom was available here. If you wanted to write
to the rom then it needed some other chipset bits set correctly as well.

You could also take a look at the

You could probably acomplish the same with the right 'dd if=/dev/mem of=bios.rom

     Jon Burgess

/* dumprom.c
 * Dump BIOS Rom space to a file
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>

// To read the full 4Mbit ROM it needs to be accessed at the 'high' address
// Only 128Kb is available at 'low' address of 0xc0000
#define START 0xfff80000
#define LENGTH 0x00080000

int main(int argc, char *argv[])
     void *pmem;
     int fd, fd2;

     if (argc != 2)
          printf("%s: <filename>\n", argv[0]);
          printf("Writes the BIOS memory space out to the file specifed\n");

     fd2 = open(argv[1], O_WRONLY | O_CREAT);
     if (!fd2)
         perror("Error creating file");

     /* Get access BIOS memory space */
     fd = open("/dev/mem", O_RDONLY);
         perror("Error opening /dev/mem");

     pmem = mmap(0, LENGTH, PROT_READ, MAP_SHARED, fd, START);
     if (pmem == MAP_FAILED)
         perror("Error mapping /dev/mem");

     if (write(fd2, pmem, LENGTH) == -1)
               perror("Error writing data");

     munmap(pmem, LENGTH);



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:27 EST