Start working on disk write to write files to disk, and remove diskwrite binary from repository
This commit is contained in:
parent
85bf36c2d1
commit
d42d640667
|
|
@ -2,3 +2,4 @@ bin
|
||||||
mount
|
mount
|
||||||
image.bin
|
image.bin
|
||||||
dump.img
|
dump.img
|
||||||
|
diskwrite
|
||||||
|
|
@ -396,7 +396,7 @@ open_file:
|
||||||
pop ds
|
pop ds
|
||||||
push 0
|
push 0
|
||||||
pop es
|
pop es
|
||||||
;sector start now contains the sector number of the first data sector of the root directory
|
|
||||||
mov ah, 0x42
|
mov ah, 0x42
|
||||||
mov dl, byte [data.boot_disc]
|
mov dl, byte [data.boot_disc]
|
||||||
mov si, DAP
|
mov si, DAP
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,22 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc, char **argv){
|
int main(int argc, char **argv){
|
||||||
printf("Hello, World!\n");
|
char **files = malloc(512);
|
||||||
|
int filec = 0;
|
||||||
|
printf("write files to virtual disk\n");
|
||||||
|
if(argc == 1 || !strcmp(argv[1], "help")){
|
||||||
|
printf("Usage:\ndiskwrite <input files> -o <output file>");
|
||||||
|
printf("\n-h: Help");
|
||||||
|
printf("\n-o: Specify output file\n");
|
||||||
|
}
|
||||||
|
for(int i = 1; i < argc; i++){
|
||||||
|
if(!strcmp(argv[i], "-o")){
|
||||||
|
i++;
|
||||||
|
if(i >= argc){
|
||||||
|
printf("Error: No output file specified!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
files[filec++] = argv[i];
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue