CeDOS - Commit b5f302b3

Renamed "apps" to "shell" and added version number to shell
Celina Sophie Kalus
Fri, 07 Apr 2023 12:14:14 +0200
11 files changed, 14 insertions(+), 29 deletions(-)
M makefilemakefile

@@ -52,7 +52,7 @@

export CCFLAGS export GLOBAL_BUILD -MODULES := boot kernel libcedos apps +MODULES := boot kernel libcedos shell OBJECTS := $(patsubst %,$(LOCAL_BUILD)/%.o,$(MODULES)) $(LOCAL_BUILD)/apps_raw.o DIRS := $(LOCAL_BUILD)

@@ -70,7 +70,7 @@ > mkfs.fat -n "cedos" -S 512 -s 8 -r 32 $@

> mkdir -p ./mnt > sudo mount $@ ./mnt > sudo cp $(LOCAL_BUILD)/kernel.bin ./mnt -> sudo cp $(LOCAL_BUILD)/*.o ./mnt +> sudo cp $(LOCAL_BUILD)/bin/* ./mnt > sudo cp ./img-contents/* ./mnt > sudo umount ./mnt

@@ -100,9 +100,9 @@ .PHONY: libcedos

libcedos: > $(MAKE) GLOBAL_BUILD=$(LOCAL_BUILD) -C src/libcedos build -.PHONY: apps -apps: -> $(MAKE) GLOBAL_BUILD=$(LOCAL_BUILD) -C src/apps build +.PHONY: shell +shell: +> $(MAKE) GLOBAL_BUILD=$(LOCAL_BUILD) -C src/shell build .PHONY: clean clean:
D src/apps/fibonacci.c

@@ -1,19 +0,0 @@

-#include "cedos.h" -#include "stdio.h" - -#include <stdint.h> - -void main(char *args) { - uint32_t a = 0, b = 1, i = 0; - while (1) { - uint32_t tmp = a + b; - a = b; - b = tmp; - printf("fib (%i) = %i\n", i, a); - i++; - char c = 0; - sc_file_read(0, &c, 1); - if (c == 0x1B) { break; } - //printf("[%c]\n", (int)(uint32_t)c);//yield(); - } -}
M src/apps/makefilesrc/shell/makefile

@@ -1,6 +1,9 @@

.RECIPEPREFIX = > -LOCAL_BUILD = $(GLOBAL_BUILD)/apps +GIT_VERSION := "$(shell git describe --abbrev=4 --dirty --always --tags)" +CCFLAGS += -DVERSION=\"$(GIT_VERSION)\" + +LOCAL_BUILD = $(GLOBAL_BUILD)/shell/build SRC_DIR := $(shell pwd)

@@ -13,7 +16,7 @@ LDFLAGS += -Map=$(LOG_DIR)/$(notdir $@)_mapfile.txt

LDFLAGS += -N APP_SOURCES := $(wildcard *.c) -APP_OBJECTS := $(patsubst %.c,$(GLOBAL_BUILD)/%.o,$(APP_SOURCES)) $(patsubst %.c,$(LOCAL_BUILD)/%.c.o,$(APP_SOURCES)) +APP_OBJECTS := $(patsubst %.c,$(GLOBAL_BUILD)/bin/%,$(APP_SOURCES)) $(patsubst %.c,$(LOCAL_BUILD)/%.c.o,$(APP_SOURCES)) DIRS := $(sort $(dir $(APP_OBJECTS)))

@@ -23,7 +26,7 @@ > $(MKDIR) $(DIRS)

.PHONY: build build: $(APP_OBJECTS) -$(GLOBAL_BUILD)/%.o: $(LOCAL_BUILD)/%.c.o | $(LIBCEDOS) +$(GLOBAL_BUILD)/bin/%: $(LOCAL_BUILD)/%.c.o | $(LIBCEDOS) > $(LD) $^ $(LDFLAGS) -o $@ $(LOCAL_BUILD)/%.c.o: %.s
M src/apps/shell.csrc/shell/shelf.c

@@ -32,7 +32,8 @@

void main(char *args) { uint32_t a = 0, b = 1, i = 0; printf("\n"); - printf("CeDOS shell\n"); + printf("ShELF shell interface for CeDOS\n"); + printf("Version: " VERSION "\n"); while (1) { printf("/> ");
M src/kernel/main.csrc/kernel/main.c

@@ -158,7 +158,7 @@ // create test tasks

printk("Creating tasks.\n"); - int pid = sched_spawn("shell.o", "Hello World!"); + int pid = sched_spawn("shelf", "Hello World!"); assert(pid != -1); //sched_spawn("fibonacci.o", "Hello World!"); //sched_spawn("fibonacci.o", "Hello World!");