initrd_init() function:
Code: Select all
(void)part;
initrd_head_t header;
media_acquire(media);
media_begin(media);
media_read(media, 0, 1, &header);
printhex(media); printk("\n");
while(1);
media_end(media);
media_release(media);
Code: Select all
void media_read(media_t *media, u32int sector, u32int count, char * buffer)
{
printhex(media); printk("\n");
media->mread(media, sector, count, buffer);
printhex(media); printk("\n");
};
Code: Select all
void ramdisk_read(media_t * media, u32int sector, u32int count, char * buffer)
{
if ((sector+count)*512 > media->size) count = (media->size-sector);
char * intbuf = (char *) (media->id + 512 * sector);
memcpy(buffer, intbuf, count*512);
printhex(media); printk("\n");
};