Support for real harddrive and Jmicron usb drives

This commit is contained in:
Marc
2021-12-04 23:02:31 +01:00
parent 1024e96ebc
commit 53441d5b9d
17 changed files with 333 additions and 152 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
printf("%d\n", argc);
if(argc < 2) {
printf("missing arguments\n");
return 1;
}
char * args[argc - 1];
for(int i=1; i < argc; i++) {
args[i-1] = (char *)malloc(sizeof(char) * strlen(argv[1]));
strcpy(args[i-1], argv[i]);
}
//args have to be null terminated
args[argc - 2] = NULL;
printf("starting %s\n", argv[1]);
if(execv(argv[1], args)) {
printf("\nfile not found, or error happened\n");
return 1;
}
}