Began working on file I/O through stdio.h. Wrote most of the code needed in stdio.h. Next up is writing the syscall handlers.

This commit is contained in:
2024-08-14 14:32:44 +02:00
parent 40e84e5b70
commit bab4b308f9
8 changed files with 147 additions and 60 deletions
+9 -1
View File
@@ -75,6 +75,14 @@ void main() {
mallocPhysicalAddr = kernelMallocPhysicalAddr;
mallocPages = kernelMallocPages;
// Setup stdio FILE*
stdin->_file = 0;
stdin->_oflag = O_RDONLY;
stdout->_file = 1;
stdout->_oflag = O_WRONLY | O_APPEND;
stderr->_file = 2;
stderr->_oflag = O_WRONLY | O_APPEND;
// FS Setup
cwd = malloc(1024);
strcpy(cwd, "/");
@@ -92,7 +100,7 @@ void main() {
char input[256];
char* inputPtr = input;
read(input);
reads(input);
if (*input == '\0') continue;