#define block_size (128*1024)
#define page_size (2*1024)
int main(int argc, const char *argv[])
unsigned char oob_data[1024*2] =
0x53, 0x50, 0x4c, 0x20, 0, 0xff, 0, 0xff,
0x53, 0x50, 0x4c, 0x20, 0, 0xff, 0, 0xff,
0x53, 0x50, 0x4c, 0x20, 0, 0xff, 0, 0xff,
0x53, 0x50, 0x4c, 0x20, 0, 0xff, 0, 0xff
struct mtd_oob_buf oob = {0, N, oobbuf};
struct mtd_oob_buf my_oob = {0, N, oob_data};
fd = open("/dev/mtd3", O_RDWR);
perror("fail to open\n");
pwrite(fd, oob_data, 1024*2, 1024*4);//写时必须页对齐,一次写一页(2k)的整数位
pread(fd, oob_data, 32, 1024*4);
printf("%2x ",oob_data[i]);