réplica de
https://github.com/Arnau478/quark.git
synced 2024-11-23 12:58:07 +01:00
VERSION shell command
This commit is contained in:
pare
a930148bee
commit
5ed34dbbe6
S'han modificat 2 arxius amb 13 adicions i 2 eliminacions
|
@ -1,11 +1,13 @@
|
||||||
# CONFIG #
|
# CONFIG #
|
||||||
|
|
||||||
|
OS_VERSION = "\"dev\""
|
||||||
|
|
||||||
BUILD_DIR ?= $(abspath build/)
|
BUILD_DIR ?= $(abspath build/)
|
||||||
|
|
||||||
TARGET = i686-elf
|
TARGET = i686-elf
|
||||||
TARGET_ASM = nasm
|
TARGET_ASM = nasm
|
||||||
TARGET_ASMFLAGS =
|
TARGET_ASMFLAGS =
|
||||||
TARGET_CFLAGS = -std=c99 -g
|
TARGET_CFLAGS = -std=c99 -g -DOS_VERSION=$(OS_VERSION)
|
||||||
TARGET_CC = $(TARGET)-gcc
|
TARGET_CC = $(TARGET)-gcc
|
||||||
TARGET_CXX = $(TARGET)-g++
|
TARGET_CXX = $(TARGET)-g++
|
||||||
TARGET_LD = $(TARGET)-gcc
|
TARGET_LD = $(TARGET)-gcc
|
||||||
|
|
|
@ -3,11 +3,20 @@
|
||||||
#include "lib/string.h"
|
#include "lib/string.h"
|
||||||
|
|
||||||
int shell_run(char *cmd){
|
int shell_run(char *cmd){
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
puts("\x1b[32m");
|
||||||
if(!strcmp(cmd, "HELLO")){
|
if(!strcmp(cmd, "HELLO")){
|
||||||
printf("Hello!\n");
|
printf("Hello!\n");
|
||||||
}
|
}
|
||||||
|
else if(!strcmp(cmd, "VERSION")){
|
||||||
|
printf("%s\n", OS_VERSION);
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
printf("SHELL: Unknown command \"%s\"\n", cmd);
|
printf("SHELL: Unknown command \"%s\"\n", cmd);
|
||||||
return 127;
|
ret = 127;
|
||||||
}
|
}
|
||||||
|
puts("\x1b[0m");
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Referencia en una nova incidència