From f4397c8737f72c9b765e21d7f1d7ab27de979c42 Mon Sep 17 00:00:00 2001
From: RP <remy.pottier@imt-atlantique.fr>
Date: Tue, 31 Mar 2020 14:52:27 +0200
Subject: [PATCH] VSCode configuration

---
 .vscode/extensions.json |  5 +++
 .vscode/launch.json     | 25 ++++++++++++++
 .vscode/tasks.json      | 75 +++++++++++++++++++++++++++++++++++++++--
 3 files changed, 103 insertions(+), 2 deletions(-)
 create mode 100644 .vscode/extensions.json
 create mode 100644 .vscode/launch.json

diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..b9fff0e
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,5 @@
+{
+    "recommendations": [
+        "webfreak.debug"
+    ]
+}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..798f18a
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,25 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [           
+        {
+            "type": "gdb",
+            "request": "attach",
+            "name": "Attach to Sextant",
+            "executable": "${workspaceFolder}/build/boot/sextant.elf",
+            "target": "localhost:1234",
+            "remote": true,
+            "cwd": "${workspaceRoot}",
+            "valuesFormatting": "parseText",
+            "windows": {
+                "gdbpath": "C:/sextant/ccompil/gdb7.exe",
+                "autorun": [
+                ]
+            },
+            "showDevDebugOutput": true,
+            "printCalls": true
+        },
+    ]    
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 4c055a8..1a63867 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -9,15 +9,48 @@
             "command": "ls -l"
 
         },
+        {
+            "label": "Download and install the windows dependencies (Windows10)",
+            "type": "shell",
+            "windows": {
+                "command": [
+                    "if (Test-Path -Path 'C:\\sextant') {rmdir -r C:\\sextant};",
+                    "if (Test-Path -Path 'C:\\extract_sextant') {rmdir -r C:\\extract_sextant};",
+                    "Invoke-WebRequest http://www.menaud.fr/Cours/Systeme/Subjects/Codes/PS1/sextant_Win10_64.zip -O sextant_Win10_64.zip;",
+                    "Expand-Archive -Force sextant_Win10_64.zip C:\\extract_sextant;",
+                    "mv C:\\extract_sextant\\sextant C:\\sextant;",
+                    "rmdir -r C:\\extract_sextant;",
+                    "rm sextant_Win10_64.zip;"
+                ],
+                "options": {
+                    "env": {
+                        "PATH": "C:\\sextant\\ccompil"
+                    }
+                }
+            },
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": []
+        },
         {
             "label": "Build Sextant",
             "type": "shell",
             "windows": {
-                "command": "C:\\Program Files\\nodejs\\node.exe"
+                "command": "make",
+                "options": {
+                    "env": {
+                        "PATH": "C:\\sextant\\ccompil"
+                    }
+                }
             },
             "linux": {
                 "command": "make"
             },
+            "osx": {
+                "command": "make"
+            },
             "group": {
                 "kind": "build",
                 "isDefault": true
@@ -28,12 +61,46 @@
             "label": "Run Sextant",
             "type": "shell",
             "windows": {
-                "command": "C:\\Program Files\\nodejs\\node.exe"
+                "command": "cd build/boot; c:\\sextant\\qemu\\qemu.exe -L \"c:\\sextant\\qemu\" -net nic,model=ne2k_isa -net user -tftp ./ -cdrom grub.iso",
+                "options": {
+                    "env": {
+                        "PATH": "C:\\sextant\\ccompil"
+                    }
+                }                
             },
             "linux": {
                 "comments": "To quit Alt + 2 > quit",
                 "command": "cd build/boot; qemu-system-x86_64 -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
             },
+            "osx": {
+                "comments": "To quit Alt + 2 > quit",
+                "command": "cd build/boot; qemu-system-x86_64 -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
+            },
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": []
+        },
+        {
+            "label": "Debug Sextant",
+            "type": "shell",
+            "windows": {
+                "command": "cd build/boot; c:\\sextant\\qemu\\qemu.exe -S -s -L \"c:\\sextant\\qemu\" -net nic,model=ne2k_isa -net user -tftp ./ -cdrom grub.iso",
+                "options": {
+                    "env": {
+                        "PATH": "C:\\sextant\\ccompil"
+                    }
+                }
+            },
+            "linux": {
+                "comments": "To quit Alt + 2 > quit",
+                "command": "cd build/boot; qemu-system-i386 -S -s -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
+            },
+            "osx": {
+                "comments": "To quit Alt + 2 > quit",
+                "command": "cd build/boot; qemu-system-i386 -S -s -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
+            },
             "group": {
                 "kind": "build",
                 "isDefault": true
@@ -50,6 +117,10 @@
                 "comments": "To quit Alt + 2 > quit",
                 "command": "cd build/boot; qemu-system-x86_64 -curses -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
             },
+            "osx": {
+                "comments": "To quit Alt + 2 > quit",
+                "command": "cd build/boot; qemu-system-x86_64 -curses -net nic,model=ne2k_isa -net user,tftp=./ -cdrom grub.iso"
+            },
             "group": {
                 "kind": "build",
                 "isDefault": true
-- 
GitLab