diff options
Diffstat (limited to 'core/fs/diskio.c')
-rw-r--r-- | core/fs/diskio.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c index 66838161..60defd3e 100644 --- a/core/fs/diskio.c +++ b/core/fs/diskio.c @@ -7,6 +7,7 @@ #include <fs.h> #include <disk.h> #include <ilog2.h> +#include <minmax.h> #define RETRY_COUNT 6 @@ -396,24 +397,20 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start, return &disk; } - /* * Initialize the device structure. - * - * NOTE: the disk cache needs to be revamped to support multiple devices... */ struct device * device_init(uint8_t devno, bool cdrom, sector_t part_start, uint16_t bsHeads, uint16_t bsSecPerTrack, uint32_t MaxTransfer) { static struct device dev; - static __hugebss char diskcache[128*1024]; dev.disk = disk_init(devno, cdrom, part_start, bsHeads, bsSecPerTrack, MaxTransfer); - dev.cache_data = diskcache; - dev.cache_size = sizeof diskcache; + dev.cache_size = 128*1024; + dev.cache_data = malloc(dev.cache_size); return &dev; } |