forked from PoliEcho-holding-org/kern
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:
+1
-1
@@ -15,7 +15,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
while (1) {
|
||||
printf("> ");
|
||||
read(input);
|
||||
reads(input);
|
||||
|
||||
// Remove whitespace
|
||||
char* old = input;
|
||||
|
||||
+9
-1
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ void main() {
|
||||
}
|
||||
}
|
||||
|
||||
deinitMemoryRegion(0x1000, 0x11000); // Reserve kernel memory (under 0x12000)
|
||||
deinitMemoryRegion(0x1000, 0x11fff); // Reserve kernel memory (under 0x12000)
|
||||
deinitMemoryRegion(MEMMAP_AREA, maxBlocks / BLOCKS_PER_BYTE);
|
||||
|
||||
// Load root dir, find kernel INode and parse it
|
||||
|
||||
Reference in New Issue
Block a user