#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/mman.h>
#define MAP_SIZE 4096UL
#define MAP_MASK (MAP_SIZE - 1)//head
#define BASE (0x1e6e2000)//ast25000 scu00 base address
int main(int __attribute__((unused)) argc, char __attribute__((unused)) * *argv){
int fd;
fd=open("/dev/mem",O_RDWR);//process
void *head;
head = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, BASE & ~MAP_MASK);//refervirtualaddr
unsigned long read_result;
read_result = *((unsigned long *)(head + 0x00));//32bite corecode
unsigned long read_result_lowest_value;
unsigned long read_result_lowest_value=read_result>>0&1;//hex to 01
munmap(head, MAP_SIZE);
close(fd);
return 0;
}