diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | bin/Kbuild | 1 | ||||
| -rw-r--r-- | bin/clear/Kbuild | 3 | ||||
| -rw-r--r-- | bin/clear/clear.c | 14 | ||||
| -rwxr-xr-x | bin/echo/echo | bin | 3480 -> 0 bytes | |||
| -rwxr-xr-x | bin/false/false | bin | 824 -> 0 bytes | |||
| -rwxr-xr-x | bin/true/true | bin | 824 -> 0 bytes | |||
| -rw-r--r-- | include/sys/sysinfo.h | 21 | ||||
| -rw-r--r-- | lib/libc/libc.a | bin | 1358016 -> 0 bytes | |||
| -rw-r--r-- | lib/libc/sys/mount.c | 3 | ||||
| -rw-r--r-- | lib/libc/sys/sysinfo.c | 7 | ||||
| -rw-r--r-- | lib/libc/unistd/isatty.c | 2 | ||||
| -rw-r--r-- | lib/libm/libm.a | bin | 1175300 -> 0 bytes |
13 files changed, 47 insertions, 5 deletions
@@ -1,4 +1,5 @@ *.o +*.a .cache @@ -1,3 +1,4 @@ +obj-y += clear/ obj-y += echo/ obj-y += false/ obj-y += gzip/ diff --git a/bin/clear/Kbuild b/bin/clear/Kbuild new file mode 100644 index 00000000..845df317 --- /dev/null +++ b/bin/clear/Kbuild @@ -0,0 +1,3 @@ +bin-y := clear +obj-y += clear.o +libs-y += $(srctree)/lib/libc/libc.a diff --git a/bin/clear/clear.c b/bin/clear/clear.c new file mode 100644 index 00000000..9c371ea7 --- /dev/null +++ b/bin/clear/clear.c @@ -0,0 +1,14 @@ +#include <sys/cdefs.h> +#include <unistd.h> + +int main(int argc, char **__unused argv) +{ + if (argc) { + write(STDOUT_FILENO, "usage: clear\n", 13); + return 0; + } + + write(STDOUT_FILENO, "\033[H\033[2J", 7); + + return 0; +} diff --git a/bin/echo/echo b/bin/echo/echo Binary files differdeleted file mode 100755 index c9bbb0df..00000000 --- a/bin/echo/echo +++ /dev/null diff --git a/bin/false/false b/bin/false/false Binary files differdeleted file mode 100755 index 554098bc..00000000 --- a/bin/false/false +++ /dev/null diff --git a/bin/true/true b/bin/true/true Binary files differdeleted file mode 100755 index 49700c41..00000000 --- a/bin/true/true +++ /dev/null diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h new file mode 100644 index 00000000..dc9ac04b --- /dev/null +++ b/include/sys/sysinfo.h @@ -0,0 +1,21 @@ +#ifndef __SYS_SYSINFO_H +#define __SYS_SYSINFO_H + +struct sysinfo { + long uptime; + unsigned long loads[3]; + unsigned long totalram; + unsigned long freeram; + unsigned long sharedram; + unsigned long bufferram; + unsigned long totalswap; + unsigned long freeswap; + unsigned short procs; + unsigned long totalhigh; + unsigned long freehigh; + unsigned int mem_unit; +}; + +int sysinfo(struct sysinfo *); + +#endif diff --git a/lib/libc/libc.a b/lib/libc/libc.a Binary files differdeleted file mode 100644 index 7a52d590..00000000 --- a/lib/libc/libc.a +++ /dev/null diff --git a/lib/libc/sys/mount.c b/lib/libc/sys/mount.c index c42dc90e..67f2d9af 100644 --- a/lib/libc/sys/mount.c +++ b/lib/libc/sys/mount.c @@ -1,6 +1,3 @@ - - - #include <sys/mount.h> // for mount #include <syscall.h> // for __syscall_5, syscall diff --git a/lib/libc/sys/sysinfo.c b/lib/libc/sys/sysinfo.c new file mode 100644 index 00000000..5af79c60 --- /dev/null +++ b/lib/libc/sys/sysinfo.c @@ -0,0 +1,7 @@ +#include <sys/sysinfo.h> +#include <syscall.h> + +int sysinfo(struct sysinfo *info) +{ + return syscall(sysinfo, info); +} diff --git a/lib/libc/unistd/isatty.c b/lib/libc/unistd/isatty.c index b356a694..46a952e4 100644 --- a/lib/libc/unistd/isatty.c +++ b/lib/libc/unistd/isatty.c @@ -1,5 +1,3 @@ - - #include <asm-generic/ioctls.h> // for TIOCGWINSZ #include <syscall.h> // for __syscall_3, syscall #include <termios.h> // for winsize diff --git a/lib/libm/libm.a b/lib/libm/libm.a Binary files differdeleted file mode 100644 index ac371df8..00000000 --- a/lib/libm/libm.a +++ /dev/null |
