mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
baremetal: symlink all programs that currently run on both userland and baremetal
This commit is contained in:
1
userland/c/add.c
Symbolic link
1
userland/c/add.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../../lkmc/c/add.c
|
||||
1
userland/c/add.py
Symbolic link
1
userland/c/add.py
Symbolic link
@@ -0,0 +1 @@
|
||||
../../lkmc/c/add.py
|
||||
@@ -1 +1 @@
|
||||
../../lkmc/assert_fail.c
|
||||
../../lkmc/c/assert_fail.c
|
||||
@@ -1,21 +0,0 @@
|
||||
/* Get on character from stdin, and then print it back out.
|
||||
*
|
||||
* Same as getc(stdin).
|
||||
*
|
||||
* You have to press enter for the character to go through:
|
||||
* https://stackoverflow.com/questions/1798511/how-to-avoid-pressing-enter-with-getchar
|
||||
*
|
||||
* Used at:
|
||||
* https://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1/53937376#53937376
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char c;
|
||||
printf("enter a character: ");
|
||||
c = getchar();
|
||||
printf("you entered: %c\n", c);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
1
userland/c/getchar.c
Symbolic link
1
userland/c/getchar.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../../lkmc/c/getchar.c
|
||||
@@ -1 +1 @@
|
||||
../../lkmc/hello.c
|
||||
../../lkmc/c/hello.c
|
||||
@@ -1,29 +0,0 @@
|
||||
/* Loop infinitely. Print an integer whenever a period is reached:
|
||||
*
|
||||
* ....
|
||||
* ./infinite_loop [period]
|
||||
* ....
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
uintmax_t i, j, period;
|
||||
if (argc > 1) {
|
||||
period = strtoumax(argv[1], NULL, 10);
|
||||
} else {
|
||||
period = 100000000;
|
||||
}
|
||||
i = 0;
|
||||
j = 0;
|
||||
while (1) {
|
||||
i++;
|
||||
if (i % period == 0) {
|
||||
printf("%ju\n", j);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
userland/c/infinite_loop.c
Symbolic link
1
userland/c/infinite_loop.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../../lkmc/c/infinite_loop.c
|
||||
@@ -1,7 +0,0 @@
|
||||
/* Print hello to stderr. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
fputs("hello\n", stderr);
|
||||
}
|
||||
1
userland/c/stderr.c
Symbolic link
1
userland/c/stderr.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../../lkmc/c/stderr.c
|
||||
@@ -1 +0,0 @@
|
||||
Testing mostly infrastructure of this repository rather than anything else.
|
||||
@@ -1 +0,0 @@
|
||||
../../lkmc/add.c
|
||||
@@ -1 +0,0 @@
|
||||
../../lkmc/add.py
|
||||
Reference in New Issue
Block a user