diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 558dd66..88f261f 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -9,11 +9,8 @@ extern uint32_t _kernel_end; void kernelMain() { - clearScreen(); - setTextStyle(0x0F); - printf(logo); + drawLogo(); initMemoryAllocation(0x100000); // initializing stacks after the kernel seems to not work :( otherwise, _kernel_end should be passed here - printf("Hello World!\nTree OS is alive!\n"); initOSTasks(); printf("Switching to otherTask... \n"); yields(); diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 558dd66..88f261f 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -9,11 +9,8 @@ extern uint32_t _kernel_end; void kernelMain() { - clearScreen(); - setTextStyle(0x0F); - printf(logo); + drawLogo(); initMemoryAllocation(0x100000); // initializing stacks after the kernel seems to not work :( otherwise, _kernel_end should be passed here - printf("Hello World!\nTree OS is alive!\n"); initOSTasks(); printf("Switching to otherTask... \n"); yields(); diff --git a/src/kernel/lib/task/osTasks.c b/src/kernel/lib/task/osTasks.c index 407709a..3ddeddd 100644 --- a/src/kernel/lib/task/osTasks.c +++ b/src/kernel/lib/task/osTasks.c @@ -8,6 +8,8 @@ void testMain() { printf("Hello from another task!\n"); + yields(); + printf("wait. . . Hello again\n"); yield(); } diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 558dd66..88f261f 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -9,11 +9,8 @@ extern uint32_t _kernel_end; void kernelMain() { - clearScreen(); - setTextStyle(0x0F); - printf(logo); + drawLogo(); initMemoryAllocation(0x100000); // initializing stacks after the kernel seems to not work :( otherwise, _kernel_end should be passed here - printf("Hello World!\nTree OS is alive!\n"); initOSTasks(); printf("Switching to otherTask... \n"); yields(); diff --git a/src/kernel/lib/task/osTasks.c b/src/kernel/lib/task/osTasks.c index 407709a..3ddeddd 100644 --- a/src/kernel/lib/task/osTasks.c +++ b/src/kernel/lib/task/osTasks.c @@ -8,6 +8,8 @@ void testMain() { printf("Hello from another task!\n"); + yields(); + printf("wait. . . Hello again\n"); yield(); } diff --git a/src/kernel/lib/task/task.c b/src/kernel/lib/task/task.c index 5b177fe..21eef66 100644 --- a/src/kernel/lib/task/task.c +++ b/src/kernel/lib/task/task.c @@ -34,7 +34,6 @@ while (test->nextTask != 0x0) { test = test->nextTask; } - printf("scheduling Task %x after task %x\n", task, test); test->nextTask = task; } diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 558dd66..88f261f 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -9,11 +9,8 @@ extern uint32_t _kernel_end; void kernelMain() { - clearScreen(); - setTextStyle(0x0F); - printf(logo); + drawLogo(); initMemoryAllocation(0x100000); // initializing stacks after the kernel seems to not work :( otherwise, _kernel_end should be passed here - printf("Hello World!\nTree OS is alive!\n"); initOSTasks(); printf("Switching to otherTask... \n"); yields(); diff --git a/src/kernel/lib/task/osTasks.c b/src/kernel/lib/task/osTasks.c index 407709a..3ddeddd 100644 --- a/src/kernel/lib/task/osTasks.c +++ b/src/kernel/lib/task/osTasks.c @@ -8,6 +8,8 @@ void testMain() { printf("Hello from another task!\n"); + yields(); + printf("wait. . . Hello again\n"); yield(); } diff --git a/src/kernel/lib/task/task.c b/src/kernel/lib/task/task.c index 5b177fe..21eef66 100644 --- a/src/kernel/lib/task/task.c +++ b/src/kernel/lib/task/task.c @@ -34,7 +34,6 @@ while (test->nextTask != 0x0) { test = test->nextTask; } - printf("scheduling Task %x after task %x\n", task, test); test->nextTask = task; } diff --git a/src/kernel/tree-os.c b/src/kernel/tree-os.c new file mode 100644 index 0000000..15acf0c --- /dev/null +++ b/src/kernel/tree-os.c @@ -0,0 +1,17 @@ +#include +#include + +const char* logo = "\ + _______ \n\ +|__ __| \n\ + | |_ __ ___ ___ ___ ___ \n\ + | | '__/ _ \\/ _ \\ / _ \\/ __| \n\ + | | | | __/ __/ | (_) \\__ \\ \n\ + |_|_| \\___|\\___| \\___/|___/ \n\n"; + +void drawLogo() { + clearScreen(); + setTextStyle(0x0F); + printf(logo); + printf("TREE-OS v. alpha 0.0 (IN DEVELOPMENT)\n\n"); +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e1e9b..f178ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "cursor.h": "c" + "cursor.h": "c", + "alloc.h": "c", + "stdio.h": "c", + "tree-os.h": "c" } } \ No newline at end of file diff --git a/Makefile b/Makefile index e4f6439..8b250bc 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(CC) $(CCFLAGS) -r $< -o $@ clean: - rm -r $(BUILD_FOLDER) + rm -r $(BUILD_FOLDER) tree-os.iso iso/boot/tree-os.elf cleanELF: rm iso/boot/tree-os.elf \ No newline at end of file diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 558dd66..88f261f 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -9,11 +9,8 @@ extern uint32_t _kernel_end; void kernelMain() { - clearScreen(); - setTextStyle(0x0F); - printf(logo); + drawLogo(); initMemoryAllocation(0x100000); // initializing stacks after the kernel seems to not work :( otherwise, _kernel_end should be passed here - printf("Hello World!\nTree OS is alive!\n"); initOSTasks(); printf("Switching to otherTask... \n"); yields(); diff --git a/src/kernel/lib/task/osTasks.c b/src/kernel/lib/task/osTasks.c index 407709a..3ddeddd 100644 --- a/src/kernel/lib/task/osTasks.c +++ b/src/kernel/lib/task/osTasks.c @@ -8,6 +8,8 @@ void testMain() { printf("Hello from another task!\n"); + yields(); + printf("wait. . . Hello again\n"); yield(); } diff --git a/src/kernel/lib/task/task.c b/src/kernel/lib/task/task.c index 5b177fe..21eef66 100644 --- a/src/kernel/lib/task/task.c +++ b/src/kernel/lib/task/task.c @@ -34,7 +34,6 @@ while (test->nextTask != 0x0) { test = test->nextTask; } - printf("scheduling Task %x after task %x\n", task, test); test->nextTask = task; } diff --git a/src/kernel/tree-os.c b/src/kernel/tree-os.c new file mode 100644 index 0000000..15acf0c --- /dev/null +++ b/src/kernel/tree-os.c @@ -0,0 +1,17 @@ +#include +#include + +const char* logo = "\ + _______ \n\ +|__ __| \n\ + | |_ __ ___ ___ ___ ___ \n\ + | | '__/ _ \\/ _ \\ / _ \\/ __| \n\ + | | | | __/ __/ | (_) \\__ \\ \n\ + |_|_| \\___|\\___| \\___/|___/ \n\n"; + +void drawLogo() { + clearScreen(); + setTextStyle(0x0F); + printf(logo); + printf("TREE-OS v. alpha 0.0 (IN DEVELOPMENT)\n\n"); +} \ No newline at end of file diff --git a/src/kernel/tree-os.h b/src/kernel/tree-os.h index 012d471..71476fe 100644 --- a/src/kernel/tree-os.h +++ b/src/kernel/tree-os.h @@ -1,12 +1,6 @@ #ifndef TREE_OS_H #define TREE_OS_H -const char* logo = "\ - _______ \n\ -|__ __| \n\ - | |_ __ ___ ___ ___ ___ \n\ - | | '__/ _ \\/ _ \\ / _ \\/ __| \n\ - | | | | __/ __/ | (_) \\__ \\ \n\ - |_|_| \\___|\\___| \\___/|___/ \n\n"; +extern void drawLogo(); #endif \ No newline at end of file