From 818a6fea63d5427e43becc0d4a5279a631a7f1a6 Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Tue, 26 Oct 2021 22:57:44 +0200 Subject: Small fixes + color + neofetch --- src/c/gdt.c | 1 - src/c/keyboard.c | 4 ++- src/c/keymap.c | 4 +-- src/c/stack_protector.c | 2 +- src/c/tty.c | 73 +++++++++++++++++++++++++++++++++++++------------ 5 files changed, 61 insertions(+), 23 deletions(-) (limited to 'src/c') diff --git a/src/c/gdt.c b/src/c/gdt.c index 32d070b..739fe70 100644 --- a/src/c/gdt.c +++ b/src/c/gdt.c @@ -16,7 +16,6 @@ struct gdt_pointer uint32_t offset; } __attribute__((packed)); -// asm function extern void load_gdt(struct gdt_pointer *gdtp); struct gdt_entry gdt[5]; diff --git a/src/c/keyboard.c b/src/c/keyboard.c index 473ec20..d573472 100644 --- a/src/c/keyboard.c +++ b/src/c/keyboard.c @@ -17,6 +17,7 @@ size_t buffer_index=0; void previous_field(void); void terminal_putchar(char c); void tty(char *buffer); +void prompt(void); void clear(); void us_en(char keymap[]); @@ -48,6 +49,7 @@ void enter() for(int i=0;i "); + //printf("[user@myos]$ "); + set_color(VGA_COLOR_RED,VGA_COLOR_BLACK); + printf("["); + set_color(VGA_COLOR_YELLOW,VGA_COLOR_BLACK); + printf("user"); + set_color(VGA_COLOR_GREEN,VGA_COLOR_BLACK); + printf("@"); + set_color(VGA_COLOR_BLUE,VGA_COLOR_BLACK); + printf("myos"); + set_color(VGA_COLOR_RED,VGA_COLOR_BLACK); + printf("]"); + set_color(VGA_COLOR_LIGHT_GREY,VGA_COLOR_BLACK); + printf("$ "); } void neofetch() { - set_color(VGA_COLOR_RED,VGA_COLOR_BLACK); - printf(" <*>\n"); - printf(" <*>\n"); - printf(" <*>\n"); - printf(" <*>\n"); - printf(" <*>\n"); - printf(" <*>\n"); - printf(" <*>\n"); - printf("<*******>\n"); - printf(" <***>\n"); - printf(" <*>\n"); + set_color(VGA_COLOR_WHITE,VGA_COLOR_BLACK); + printf(" . "); printf("Dobrodosli u moj \n"); + printf(" J:L (\"\"\") "); printf("operativni sistem :) \n"); + printf(" |:| III "); printf("Uzivajte! \n"); + printf(" |:| III "); printf(" \n"); + printf(" |:| III "); printf("Welcome to my \n"); + printf(" |:| __III__ "); printf("operating system :) \n"); + printf(" |:| /:-.___,-:\\ "); printf("Enjoy your stay! \n"); + printf(" |:| \\] |:| [/ "); printf(" \n"); + printf(" |:| |:| "); printf(" \n"); + printf(" |:| |:| "); printf(" \n"); + printf(" |:| |:| "); printf(" \n"); + printf(" /] |:| [\\ |:| "); printf(" \n"); + printf(" \\:-'\"\"\"`-:/ |:| "); printf(" \n"); + printf(" \"\"III\"\" |:| "); printf(" \n"); + printf(" III |:| "); printf(" \n"); + printf(" III |:| "); printf(" \n"); + printf(" III |:| "); printf("napravio/made by: \n"); + printf(" (___) J:F "); printf("Aleksa Vuckovic \n"); + printf(" \" "); printf(" \n"); + + for(size_t i=0;i<16;i++) + { + if(i==0) set_color(i,VGA_COLOR_WHITE); + else set_color(i,VGA_COLOR_BLACK); + printf("@%d ",i); + } + printf("\n"); + + set_color(VGA_COLOR_LIGHT_GREY,VGA_COLOR_BLACK); uptime(); } +void help() +{ + printf("Currently available commands:\n"); + printf("clear echo merge ls number uptime neofetch help\n"); +} + void tty(char *buffer) { char parts[CMD_LENGTH][CMD_LENGTH]; @@ -98,10 +135,10 @@ void tty(char *buffer) if(stringcmp(parts[0],"clear")) clear(); else if(stringcmp(parts[0],"echo")) echo(numberof,parts); else if(stringcmp(parts[0],"merge")) merge(parts); - else if(stringcmp(parts[0],"ls")) ls(numberof,parts); + else if(stringcmp(parts[0],"ls")) ls(); else if(stringcmp(parts[0],"number")) number(numberof,parts); else if(stringcmp(parts[0],"uptime")) uptime(); else if(stringcmp(parts[0],"neofetch")) neofetch(); + else if(stringcmp(parts[0],"help")) help(); else printf("command not found: %s\n",parts[0]); - prompt(); } -- cgit v1.2.3