source: bootcd/isolinux/syslinux-6.03/core/fs/diskio.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 769 bytes
Line 
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>
11
12#include <syslinux/firmware.h>
13
14void getoneblk(struct disk *disk, char *buf, block_t block, int block_size)
15{
16    int sec_per_block = block_size / disk->sector_size;
17
18    disk->rdwr_sectors(disk, buf, block * sec_per_block, sec_per_block, 0);
19}
20
21/*
22 * Initialize the device structure.
23 */
24struct device * device_init(void *args)
25{
26    static struct device dev;
27
28    dev.disk = firmware->disk_init(args);
29    dev.cache_size = 128*1024;
30    dev.cache_data = malloc(dev.cache_size);
31    dev.cache_init = 0; /* Explicitly set cache as uninitialized */
32
33    return &dev;
34}
Note: See TracBrowser for help on using the repository browser.