Add memtest support.
[syslinux-debian/hramrach.git] / core / fs / diskio.c
blob7d95d674593b0b1d03bb794006dcbb8914707320
1 #include <dprintf.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <stdbool.h>
5 #include <klibc/compiler.h>
6 #include <core.h>
7 #include <fs.h>
8 #include <disk.h>
9 #include <ilog2.h>
10 #include <minmax.h>
12 #include <syslinux/firmware.h>
14 void getoneblk(struct disk *disk, char *buf, block_t block, int block_size)
16 int sec_per_block = block_size / disk->sector_size;
18 disk->rdwr_sectors(disk, buf, block * sec_per_block, sec_per_block, 0);
22 * Initialize the device structure.
24 struct device * device_init(void *args)
26 static struct device dev;
28 dev.disk = firmware->disk_init(args);
29 dev.cache_size = 128*1024;
30 dev.cache_data = malloc(dev.cache_size);
32 return &dev;