mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-13 01:48:42 +00:00
Compare commits
4 commits
11593b1b23
...
2580700ff9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2580700ff9 | ||
|
|
078ad437a5 | ||
|
|
c275da6145 | ||
|
|
0075493fba |
3 changed files with 9 additions and 8 deletions
|
|
@ -20,7 +20,7 @@ $(if $(filter doom,$1),$(APP_METADATA_SOURCE_DOOM),$(if $(filter lua,$1),$(APP_M
|
|||
endef
|
||||
|
||||
LIBC_SOURCES = $(wildcard libc/*.c)
|
||||
LIBC_OBJS = $(patsubst libc/%.c, $(BIN_DIR)/%.o, $(LIBC_SOURCES)) $(BIN_DIR)/crt0.o $(BIN_DIR)/libwidget.o $(BIN_DIR)/stb_image.o
|
||||
LIBC_OBJS = $(patsubst libc/%.c, $(BIN_DIR)/libc_%.o, $(LIBC_SOURCES)) $(BIN_DIR)/crt0.o $(BIN_DIR)/libwidget.o $(BIN_DIR)/stb_image.o
|
||||
|
||||
VPATH = cli gui sys games libc net cli/third_party
|
||||
vpath %.c cli gui sys games libc net cli/third_party
|
||||
|
|
@ -46,7 +46,7 @@ $(BIN_DIR):
|
|||
$(BIN_DIR)/crt0.o: crt0.asm
|
||||
$(AS) -f elf64 $< -o $@
|
||||
|
||||
$(BIN_DIR)/%.o: libc/%.c | $(BIN_DIR)
|
||||
$(BIN_DIR)/libc_%.o: libc/%.c | $(BIN_DIR)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(BIN_DIR)/libwidget.o: ../wm/libwidget.c | $(BIN_DIR)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int main(int argc, char **argv) {
|
|||
printf("clear - Clear the screen\n");
|
||||
printf("exit - Exit the terminal\n");
|
||||
printf("net - Network tools\n");
|
||||
printf("ptime <cmd> - Measure command execution time\n");
|
||||
printf("time <cmd> - Measure command execution time\n");
|
||||
printf("\nHint: Use Ctrl+C to force quit any running application.\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
// This software is released under the GNU General Public License v3.0. See LICENSE file for details.
|
||||
// This header needs to maintain in any file it is present in, as per the GPL license terms.
|
||||
|
||||
#include "../libc/stdlib.h"
|
||||
#include "stdlib.h"
|
||||
#include "syscall.h"
|
||||
|
||||
#define CMDLINE_MAX 512
|
||||
|
||||
|
|
@ -40,12 +41,12 @@ static int ends_with_elf(const char *s) {
|
|||
}
|
||||
|
||||
static void print_usage(void) {
|
||||
printf("Usage: ptime <command> [args...]\n");
|
||||
printf("Usage: time <command> [args...]\n");
|
||||
printf("\n");
|
||||
printf("Examples:\n");
|
||||
printf(" ptime ls\n");
|
||||
printf(" ptime hexdump file.txt\n");
|
||||
printf(" ptime /bin/hexdump.elf file.txt\n");
|
||||
printf(" time ls\n");
|
||||
printf(" time hexdump file.txt\n");
|
||||
printf(" time /bin/hexdump.elf file.txt\n");
|
||||
}
|
||||
|
||||
// Read the system uptime in milliseconds by reading /proc/uptime and parsing the first number (seconds).
|
||||
Loading…
Reference in a new issue