updates bsp and cleans hello.c

This commit is contained in:
Eyck Jentzsch 2025-04-14 17:01:19 +02:00
parent a5825bfd67
commit 071d9cc8eb
2 changed files with 13 additions and 10 deletions

@ -1 +1 @@
Subproject commit db3a2d68d6c7c73e32d4e2e0aae3a10e7de86576
Subproject commit e0807b8cddb07c2eb91dfe0b230d3121897b7a96

View File

@ -15,19 +15,22 @@ int factorial(int i) {
}
return result;
}
extern volatile uint32_t tohost;
extern volatile uint32_t fromhost;
int main() {
volatile int result = factorial(10);
volatile char string[] = "hello world with write in hello";
volatile uint64_t payload[4] = {64, 0, (uintptr_t)string,
(strlen(string) + 1)};
tohost = (uint32_t)payload;
void write_tohost(char* string) {
volatile uint64_t payload[4] = {64, 0, (uintptr_t)string,
(strlen(string) + 1)};
tohost = (uintptr_t)payload;
}
int main() {
char string[] = "hello world with write in hello";
write_tohost(string);
write(STDOUT_FILENO, string, sizeof(string));
int result = factorial(10);
printf("Factorial is %d", result);
// printf("End of execution");
return 0;
}