src/shell/main.c
/*

    Name: ramdisk_cmd
    Description: command handler for ramdisk

 */
ramdisk_cmd
Description: command handler for ramdisk
ramdisk_cmd Description : command handler for ramdisk
void ramdisk_cmd() {
    if (!loader_xfer_recv_count) {
        iprintf("please upload a ramdisk before issuing this command\n");
        return;
    }
    if (ramdisk_buf) free(ramdisk_buf);
    ramdisk_buf = malloc(loader_xfer_recv_count);
    if (!ramdisk_buf) panic("couldn't reserve heap for ramdisk");
    ramdisk_size = loader_xfer_recv_count;
    memcpy(ramdisk_buf, loader_xfer_recv_data, ramdisk_size);
    loader_xfer_recv_count = 0;
}
void ramdisk_cmd ( ) { if ( ! loader_xfer_recv_count ) { iprintf ( " \n " ) ; return ; } if ( ramdisk_buf ) free ( ramdisk_buf ) ; ramdisk_buf = malloc ( loader_xfer_recv_count ) ; if ( ! ramdisk_buf ) panic ( " " ) ; ramdisk_size = loader_xfer_recv_count ; memcpy ( ramdisk_buf , loader_xfer_recv_data , ramdisk_size ) ; loader_xfer_recv_count = 0 ; }
Name: ramdisk_cmd
Description: command handler for ramdisk
Name : ramdisk_cmd Description : command handler for ramdisk