Skip to content

Commit

Permalink
Merge pull request #6 from Sister20/shell
Browse files Browse the repository at this point in the history
Interactive Shell
  • Loading branch information
Fatih20 authored Apr 29, 2023
2 parents 9da0624 + 83e1998 commit 6bf7e3e
Show file tree
Hide file tree
Showing 15 changed files with 2,999 additions and 246 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
32 changes: 16 additions & 16 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
"text": "symbol-file kernel",
"description": "Get kernel symbols"
},
{
"text": "add-symbol-file shell_elf",
"description": "Get shell symbols"
},
{
"text": "set output-radix 16",
"description": "Use hexadecimal output"
}
],
],
"avoidWindowsConsoleRedirection": true
},
{
Expand Down
18 changes: 17 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
{
"debug.onTaskErrors": "debugAnyway",
"files.associations": {
"*.pl": "prolog",
"framebuffer.h": "c",
"*.h": "c"
"*.h": "c",
"array": "c",
"atomic": "c",
"*.tcc": "c",
"concepts": "c",
"type_traits": "c",
"istream": "c",
"new": "c",
"numeric": "c",
"ostream": "c",
"string_view": "c",
"system_error": "c",
"functional": "c",
"tuple": "c",
"typeinfo": "c",
"utility": "c"
},
"C_Cpp.errorSquiggles": "enabled",
}
12 changes: 9 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ kernel:
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/keyboard.c -o $(OUTPUT_FOLDER)/keyboard.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/kernel.c -o $(OUTPUT_FOLDER)/kernel.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/fat32.c -o $(OUTPUT_FOLDER)/fat32.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/bplustree.c -o $(OUTPUT_FOLDER)/bplustree.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/disk.c -o $(OUTPUT_FOLDER)/disk.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/cmosrtc.c -o $(OUTPUT_FOLDER)/cmosrtc.o
$(CC) $(CFLAGS) $(SOURCE_FOLDER)/paging.c -o $(OUTPUT_FOLDER)/paging.o
Expand Down Expand Up @@ -72,18 +73,23 @@ disk:

inserter:
@$(CC) -Wno-builtin-declaration-mismatch -g \
$(SOURCE_FOLDER)/stdmem.c $(SOURCE_FOLDER)/fat32.c $(SOURCE_FOLDER)/cmosrtc.c $(SOURCE_FOLDER)/portio.c \
$(SOURCE_FOLDER)/stdmem.c $(SOURCE_FOLDER)/fat32.c $(SOURCE_FOLDER)/bplustree.c $(SOURCE_FOLDER)/cmosrtc.c $(SOURCE_FOLDER)/portio.c \
$(SOURCE_FOLDER)/external-inserter.c \
-o $(OUTPUT_FOLDER)/inserter

user-shell:
@$(ASM) $(AFLAGS) $(SOURCE_FOLDER)/user-entry.s -o user-entry.o
@$(CC) $(CFLAGS) -fno-pie $(SOURCE_FOLDER)/user-shell.c -o user-shell.o
@$(CC) $(CFLAGS) -fno-pie $(SOURCE_FOLDER)/stdmem.c -o $(OUTPUT_FOLDER)/stdmem.o
@$(CC) $(CFLAGS) -fno-pie $(SOURCE_FOLDER)/user-shell.c -o $(OUTPUT_FOLDER)/user-shell.o
@$(LIN) -T $(SOURCE_FOLDER)/user-linker.ld -melf_i386 \
user-entry.o user-shell.o -o $(OUTPUT_FOLDER)/shell
user-entry.o $(OUTPUT_FOLDER)/user-shell.o $(OUTPUT_FOLDER)/stdmem.o -o $(OUTPUT_FOLDER)/shell
@echo Linking object shell object files and generate flat binary...
@$(LIN) -T $(SOURCE_FOLDER)/user-linker.ld -melf_i386 --oformat=elf32-i386\
user-entry.o $(OUTPUT_FOLDER)/user-shell.o $(OUTPUT_FOLDER)/stdmem.o -o $(OUTPUT_FOLDER)/shell_elf
@echo Linking object shell object files and generate ELF32 for debugging...
@size --target=binary bin/shell
@rm -f *.o
@rm -f $(OUTPUT_FOLDER)/*.o

insert-shell: inserter user-shell
@echo Inserting shell into root directory...
Expand Down
Loading

0 comments on commit 6bf7e3e

Please sign in to comment.