Add support for some basic system calls and args handling correctly. #29

Merged
sb3923 merged 49 commits from system-calls into master 2024-11-07 19:36:30 +00:00
5 changed files with 235 additions and 20 deletions
Showing only changes of commit 02fff62ca2 - Show all commits

View File

@@ -161,19 +161,19 @@ syscall_read (int fd, void *buffer, unsigned size)
validate_user_pointer (buffer, size); validate_user_pointer (buffer, size);
if (fd == STDIN_FILENO) if (fd == STDIN_FILENO)
{ {
/* Reading from the console. */ /* Reading from the console. */
char *write_buffer = buffer; char *write_buffer = buffer;
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
write_buffer[i] = input_getc (); write_buffer[i] = input_getc ();
return size; return size;
} }
else else
{ {
/* Reading from a file. */ /* Reading from a file. */
return 0; // TODO: Implement Write to Files return 0; // TODO: Implement Write to Files
} }
} }
static int static int