-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Syscall handling actually works now. Also implemented printf as syscall
- Loading branch information
Showing
7 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
while(1); | ||
} | ||
printf("Hello world... from hello.c\n"); | ||
while(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
#include <stdio.h> | ||
#include <stdarg.h> | ||
#include "../arch/arm/syscall_arch.h" | ||
|
||
int printf(const char *restrict fmt, ...) | ||
{ | ||
int ret; | ||
va_list ap; | ||
va_start(ap, fmt); | ||
ret = vfprintf(stdout, fmt, ap); | ||
va_end(ap); | ||
return ret; | ||
} | ||
//int ret; | ||
//va_list ap; | ||
//va_start(ap, fmt); | ||
//ret = vfprintf(stdout, fmt, ap); | ||
//va_end(ap); | ||
//return ret; | ||
long error = __syscall1(SYSCALL_PRINTF, (long)fmt); | ||
return error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters