vscode: Update configuration files

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
EnderIce2 2025-01-04 06:13:31 +02:00
parent 5632c7cb10
commit e4403cdbd6
No known key found for this signature in database
GPG Key ID: 2EE20AF089811A5A
17 changed files with 299 additions and 249 deletions

69
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,69 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch QEMU & debug the kernel",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/../Kernel/fennix.elf",
"cwd": "${workspaceFolder}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerServerAddress": "/tmp/gdb-fennix",
"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceFolder}",
"internalConsoleOptions": "neverOpen",
"customLaunchSetupCommands": [
// {
// "text": "target remote localhost:1234",
// "description": "Connect to QEMU remote debugger"
// }
],
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set breakpoint pending on",
"description": "Make breakpoint pending on future shared library load."
},
{
"text": "file ${workspaceFolder}/../Kernel/fennix.elf",
"description": "Load binary"
},
{
"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
"description": "Load /bin/utest",
"ignoreFailures": true
},
{
"text": "source ${workspaceFolder}/../tools/.gdbinit"
}
],
"preLaunchTask": "launch-qemu"
},
{
"type": "gdb",
"request": "attach",
"name": "Launch QEMU & attach to gdbserver",
"executable": "${workspaceFolder}/../Kernel/fennix.elf",
"target": "/tmp/gdb-fennix",
"remote": true,
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"gdbpath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
"autorun": [
"set auto-load safe-path ${workspaceFolder}",
"source ${workspaceFolder}/../tools/.gdbinit",
],
"internalConsoleOptions": "neverOpen",
"printCalls": false,
"preLaunchTask": "launch-qemu"
},
]
}

28
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,28 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "launch-qemu",
"type": "shell",
"command": "make -C ../ build && make -C ../ vscode_debug_only",
"isBackground": true,
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
},
"options": {
"shell": {
"executable": "bash",
"args": [
"-c"
]
}
}
}
]
}

1
Drivers/.vscode/launch.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/launch.json

1
Drivers/.vscode/tasks.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/tasks.json

View File

@ -6,6 +6,10 @@
], ],
"settings": { "settings": {
"terminal.integrated.cwd": "../", "terminal.integrated.cwd": "../",
"debug.allowBreakpointsEverywhere": true "debug.allowBreakpointsEverywhere": true,
"git.alwaysSignOff": true,
"git.defaultBranchName": "master",
"git.openRepositoryInParentFolders": "always",
"C_Cpp.autoAddFileAssociations": false
} }
} }

View File

@ -22,6 +22,10 @@
"editor.cursorBlinking": "blink", "editor.cursorBlinking": "blink",
"editor.cursorSmoothCaretAnimation": "on", "editor.cursorSmoothCaretAnimation": "on",
"editor.cursorStyle": "line", "editor.cursorStyle": "line",
"editor.cursorWidth": 2 "editor.cursorWidth": 2,
"git.alwaysSignOff": true,
"git.defaultBranchName": "master",
"git.openRepositoryInParentFolders": "always",
"C_Cpp.autoAddFileAssociations": false
} }
} }

View File

@ -6,6 +6,10 @@
], ],
"settings": { "settings": {
"terminal.integrated.cwd": "../", "terminal.integrated.cwd": "../",
"debug.allowBreakpointsEverywhere": true "debug.allowBreakpointsEverywhere": true,
"git.alwaysSignOff": true,
"git.defaultBranchName": "master",
"git.openRepositoryInParentFolders": "always",
"C_Cpp.autoAddFileAssociations": false
} }
} }

View File

@ -0,0 +1,14 @@
{
"folders": [
{
"path": "./tools/website"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"git.alwaysSignOff": true,
"git.defaultBranchName": "master",
"git.openRepositoryInParentFolders": "always",
"C_Cpp.autoAddFileAssociations": false
}
}

View File

@ -5,6 +5,10 @@
} }
], ],
"settings": { "settings": {
"debug.allowBreakpointsEverywhere": true "debug.allowBreakpointsEverywhere": true,
"git.alwaysSignOff": true,
"git.defaultBranchName": "master",
"git.openRepositoryInParentFolders": "always",
"C_Cpp.autoAddFileAssociations": false
} }
} }

View File

@ -1,68 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch QEMU & debug the kernel",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/../Kernel/fennix.elf",
"cwd": "${workspaceFolder}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceFolder}",
"internalConsoleOptions": "neverOpen",
"customLaunchSetupCommands": [
{
"text": "target remote localhost:1234",
"description": "Connect to QEMU remote debugger"
}
],
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set breakpoint pending on",
"description": "Make breakpoint pending on future shared library load."
},
{
"text": "file ${workspaceFolder}/../Kernel/fennix.elf",
"description": "Load binary"
},
{
"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
"description": "Load /bin/utest",
"ignoreFailures": true
},
{
"text": "source ${workspaceFolder}/../tools/.gdbinit"
}
],
"preLaunchTask": "launch-qemu"
},
{
"type": "gdb",
"request": "attach",
"name": "Launch QEMU & attach to gdbserver",
"executable": "${workspaceFolder}/../Kernel/fennix.elf",
"target": ":1234",
"remote": true,
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"gdbpath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
"autorun": [
"set auto-load safe-path ${workspaceFolder}",
"source ${workspaceFolder}/../tools/.gdbinit",
],
"internalConsoleOptions": "neverOpen",
"printCalls": false,
"preLaunchTask": "launch-qemu"
},
]
}

1
Kernel/.vscode/launch.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/launch.json

View File

@ -1,26 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "launch-qemu",
"type": "shell",
"command": "make -C ../ build && make -C ../ vscode_debug_only",
"isBackground": true,
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
},
"options": {
"shell": {
"executable": "bash",
"args": ["-c"]
}
}
}
]
}

1
Kernel/.vscode/tasks.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/tasks.json

View File

@ -1,28 +1,164 @@
{ {
"Fennix Kernel Header": { "Fennix Userspace C++ Header": {
"isFileTemplate": true,
"scope": "c,cpp",
"prefix": [ "prefix": [
"head", "head",
], ],
"body": [ "body": [
"#ifndef __FENNIX_LIBC_${2:header}_H__", "/*",
"#define __FENNIX_LIBC_${2:header}_H__", "\tThis file is part of Fennix Userspace.",
"",
"\tFennix Userspace is free software: you can redistribute it and/or",
"\tmodify it under the terms of the GNU General Public License as",
"\tpublished by the Free Software Foundation, either version 3 of",
"\tthe License, or (at your option) any later version.",
"",
"\tFennix Userspace is distributed in the hope that it will be useful,",
"\tbut WITHOUT ANY WARRANTY; without even the implied warranty of",
"\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"\tGNU General Public License for more details.",
"",
"\tYou should have received a copy of the GNU General Public License",
"\talong with Fennix Userspace. If not, see <https://www.gnu.org/licenses/>.",
"*/",
"",
"#pragma once",
"",
"$0",
"",
"$1",
""
],
"description": "Create userspace header."
},
"Fennix Userspace C Header": {
"isFileTemplate": true,
"scope": "c,cpp",
"prefix": [
"headc",
],
"body": [
"/*",
"\tThis file is part of Fennix Userspace.",
"",
"\tFennix Userspace is free software: you can redistribute it and/or",
"\tmodify it under the terms of the GNU General Public License as",
"\tpublished by the Free Software Foundation, either version 3 of",
"\tthe License, or (at your option) any later version.",
"",
"\tFennix Userspace is distributed in the hope that it will be useful,",
"\tbut WITHOUT ANY WARRANTY; without even the implied warranty of",
"\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"\tGNU General Public License for more details.",
"",
"\tYou should have received a copy of the GNU General Public License",
"\talong with Fennix Userspace. If not, see <https://www.gnu.org/licenses/>.",
"*/",
"",
"#ifndef __FENNIX_USERSPACE_${1:header}_H__",
"#define __FENNIX_USERSPACE_${1:header}_H__",
"", "",
"#include <types.h>", "#include <types.h>",
"", "",
"$0", "$0",
"", "",
"#endif // !__FENNIX_LIBC_${2:header}_H__", "#endif // !__FENNIX_USERSPACE_${1:header}_H__",
"" ""
], ],
"description": "Create kernel header." "description": "Create userspace header."
}, },
"Fennix Kernel brief": { "Fennix C Library Header": {
"isFileTemplate": true,
"scope": "c,cpp",
"prefix": [ "prefix": [
"brief", "libc",
], ],
"body": [ "body": [
"/** @brief $0 */" "/*",
"\tThis file is part of Fennix C Library.",
"",
"\tFennix C Library is free software: you can redistribute it and/or",
"\tmodify it under the terms of the GNU General Public License as",
"\tpublished by the Free Software Foundation, either version 3 of",
"\tthe License, or (at your option) any later version.",
"",
"\tFennix C Library is distributed in the hope that it will be useful,",
"\tbut WITHOUT ANY WARRANTY; without even the implied warranty of",
"\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"\tGNU General Public License for more details.",
"",
"\tYou should have received a copy of the GNU General Public License",
"\talong with Fennix C Library. If not, see <https://www.gnu.org/licenses/>.",
"*/",
"",
"#ifndef _${1:header}_H",
"#define _${1:header}_H",
"",
"#ifdef __cplusplus",
"extern \"C\"",
"{",
"#endif // __cplusplus",
"",
"$0",
"",
"#ifdef __cplusplus",
"}",
"#endif // __cplusplus",
"",
"#endif // !_${1:header}_H",
""
], ],
"description": "Create kernel documentation brief." "description": "Create C Library Header."
},
"Userspace License": {
"isFileTemplate": true,
"prefix": [
"license",
],
"body": [
"/*",
"\tThis file is part of Fennix Userspace.",
"",
"\tFennix Userspace is free software: you can redistribute it and/or",
"\tmodify it under the terms of the GNU General Public License as",
"\tpublished by the Free Software Foundation, either version 3 of",
"\tthe License, or (at your option) any later version.",
"",
"\tFennix Userspace is distributed in the hope that it will be useful,",
"\tbut WITHOUT ANY WARRANTY; without even the implied warranty of",
"\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"\tGNU General Public License for more details.",
"",
"\tYou should have received a copy of the GNU General Public License",
"\talong with Fennix Userspace. If not, see <https://www.gnu.org/licenses/>.",
"*/"
],
"description": "Create userspace license."
},
"C Library License": {
"isFileTemplate": true,
"prefix": [
"license_libc",
],
"body": [
"/*",
"\tThis file is part of Fennix C Library.",
"",
"\tFennix C Library is free software: you can redistribute it and/or",
"\tmodify it under the terms of the GNU General Public License as",
"\tpublished by the Free Software Foundation, either version 3 of",
"\tthe License, or (at your option) any later version.",
"",
"\tFennix C Library is distributed in the hope that it will be useful,",
"\tbut WITHOUT ANY WARRANTY; without even the implied warranty of",
"\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"\tGNU General Public License for more details.",
"",
"\tYou should have received a copy of the GNU General Public License",
"\talong with Fennix C Library. If not, see <https://www.gnu.org/licenses/>.",
"*/"
],
"description": "Create libc license."
} }
} }

View File

@ -3,16 +3,11 @@
{ {
"name": "Fennix x64 (Linux, GCC, debug)", "name": "Fennix x64 (Linux, GCC, debug)",
"includePath": [ "includePath": [
"${workspaceFolder}/out/include/**", "${workspaceFolder}/libc/include/**",
"${workspaceFolder}/libs/include/**", "${workspaceFolder}/libs/include/**"
"${workspaceFolder}/libs/include"
], ],
"defines": [ "defines": [
"__debug_vscode__", "__debug_vscode__",
"KERNEL_NAME=\"Fennix\"",
"KERNEL_VERSION=\"1.0\"",
"GIT_COMMIT=\"0000000000000000000000000000000000000000\"",
"GIT_COMMIT_SHORT=\"0000000\"",
"DEBUG=\"1\"" "DEBUG=\"1\""
], ],
"compilerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gcc", "compilerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gcc",
@ -29,10 +24,8 @@
"-pipe", "-pipe",
"-ffunction-sections", "-ffunction-sections",
"-fno-builtin", "-fno-builtin",
// C++ flags // C++ flags
"-fexceptions", "-fexceptions",
// Linker flags // Linker flags
"-fPIC", "-fPIC",
"-fPIE", "-fPIE",
@ -42,7 +35,6 @@
"-nolibc", "-nolibc",
"-zmax-page-size=0x1000", "-zmax-page-size=0x1000",
"-static", "-static",
// VSCode flags // VSCode flags
"-ffreestanding", "-ffreestanding",
"-nostdinc", "-nostdinc",
@ -52,16 +44,11 @@
{ {
"name": "Fennix x32 (Linux, GCC, debug)", "name": "Fennix x32 (Linux, GCC, debug)",
"includePath": [ "includePath": [
"${workspaceFolder}/out/include/**", "${workspaceFolder}/libc/include/**",
"${workspaceFolder}/libs/include/**", "${workspaceFolder}/libs/include/**"
"${workspaceFolder}/libs/include"
], ],
"defines": [ "defines": [
"__debug_vscode__", "__debug_vscode__",
"KERNEL_NAME=\"Fennix\"",
"KERNEL_VERSION=\"1.0\"",
"GIT_COMMIT=\"0000000000000000000000000000000000000000\"",
"GIT_COMMIT_SHORT=\"0000000\"",
"DEBUG=\"1\"" "DEBUG=\"1\""
], ],
"compilerPath": "${workspaceFolder}/../tools/cross/bin/i386-fennix-gcc", "compilerPath": "${workspaceFolder}/../tools/cross/bin/i386-fennix-gcc",
@ -78,10 +65,8 @@
"-pipe", "-pipe",
"-ffunction-sections", "-ffunction-sections",
"-fno-builtin", "-fno-builtin",
// C++ flags // C++ flags
"-fexceptions", "-fexceptions",
// Linker flags // Linker flags
"-fPIC", "-fPIC",
"-fPIE", "-fPIE",
@ -91,7 +76,6 @@
"-nolibc", "-nolibc",
"-zmax-page-size=0x1000", "-zmax-page-size=0x1000",
"-static", "-static",
// VSCode flags // VSCode flags
"-ffreestanding", "-ffreestanding",
"-nostdinc", "-nostdinc",

View File

@ -1,122 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "/bin/init",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/bin/init",
"cwd": "${workspaceFolder}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceFolder}",
"customLaunchSetupCommands": [
{
"text": "target remote localhost:1234",
"description": "Connect to QEMU remote debugger"
}
],
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set breakpoint pending on",
"description": "Make breakpoint pending on future shared library load."
},
{
"text": "file ${workspaceFolder}/out/bin/init",
"description": "Load binary."
},
{
"text": "add-symbol-file ${workspaceFolder}/../Kernel/fennix.elf",
"description": "Load kernel binary."
},
]
},
{
"name": "/lib/ld.so",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/lib/ld.so",
"cwd": "${workspaceFolder}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceFolder}",
"customLaunchSetupCommands": [
{
"text": "target remote localhost:1234",
"description": "Connect to QEMU remote debugger"
}
],
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set breakpoint pending on",
"description": "Make breakpoint pending on future shared library load."
},
{
"text": "file ${workspaceFolder}/out/lib/ld.so",
"description": "Load binary."
},
{
"text": "add-symbol-file ${workspaceFolder}/../Kernel/fennix.elf",
"description": "Load kernel binary."
},
]
},
{
"name": "/usr/bin/doom",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/usr/bin/doom",
"cwd": "${workspaceFolder}",
"args": [],
"targetArchitecture": "x64",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerArgs": "",
"externalConsole": false,
"additionalSOLibSearchPath": "${workspaceFolder}",
"customLaunchSetupCommands": [
{
"text": "target remote localhost:1234",
"description": "Connect to QEMU remote debugger"
}
],
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "set breakpoint pending on",
"description": "Make breakpoint pending on future shared library load."
},
{
"text": "file ${workspaceFolder}/out/usr/bin/doom",
"description": "Load binary."
},
{
"text": "add-symbol-file ${workspaceFolder}/../Kernel/fennix.elf",
"description": "Load kernel binary."
},
]
}
]
}

1
Userspace/.vscode/launch.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/launch.json

8
Userspace/.vscode/preinclude.h vendored Normal file
View File

@ -0,0 +1,8 @@
#undef __linux__
#undef __WIN32__
#undef __WIN64__
#undef _WIN32
#undef _WIN64
#undef __APPLE__
#undef __clang__
#define __vscode__ 1

5
Userspace/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"git.openRepositoryInParentFolders": "always",
"git.alwaysSignOff": true,
"git.defaultBranchName": "master"
}

1
Userspace/.vscode/tasks.json vendored Symbolic link
View File

@ -0,0 +1 @@
../../.vscode/tasks.json