forked from plctlab/riscv-operating-system-mooc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
38 additions
and
1 deletion.
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,4 +1,4 @@ | ||
*.o | ||
*.bin | ||
*.elf | ||
|
||
*.o.* |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
all: | ||
gcc -c hello.c -o hello.o | ||
readelf -h hello.o > hello.o.header | ||
readelf -SW hello.o > hello.o.section | ||
gcc -c hello.c -o hello.o -g | ||
objdump -S hello.o > hello.o.disassembly | ||
|
||
clean: | ||
rm -rf *.o *.header *.section *.disassembly |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "stdio.h" | ||
|
||
int main() | ||
{ | ||
printf("Hello World!\n"); | ||
return 0; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
all: | ||
gcc -c code.c -o code.o | ||
objdump -t code.o > code.o.symbol | ||
|
||
clean: | ||
rm -rf *.o *.symbol |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
int global_init = 0x11111111; | ||
const int global_const = 0x22222222; | ||
|
||
void main() | ||
{ | ||
static int static_var = 0x33333333; | ||
static int static_var_uninit; | ||
|
||
int auto_var = 0x44444444; | ||
|
||
printf("hello world!\n"); | ||
return; | ||
} |