VMWare Workstation ssh远程连接与ChCore调试设置

由于虚拟机页面里使用VSCode存在卡顿,加上存在一些不想解决的登不上github copilot的问题,笔者采用ssh+cursor进行ChCore作业完成/

VMWare Workstation ssh远程连接

  1. 启动ssh:

    sudo apt update
    sudo apt install openssh-server
    sudo systemctl start ssh
    sudo systemctl enable ssh
    
  2. Settings 里将 Network Adapter 改为Bridged(都勾选)

  3. 使用 ip addr show 找到 ens33 的 IP 地址

    连接命令:ssh username@<ip_address>

  4. 对于ssh,可配置config文件,并加入你的IdentityFile
    注意:如果遇到 out of memory 错误,可以清理一下 lab 环境。

ChCore调试设置

参考 OS-Lab|SJTU

通过ls /usr/bin/ | grep "gdb" 找到 /usr/bin/ 下的调试器,并填入launch.json:


{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "QEMU (cppdbg)",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/kernel.img",
            "args": [],
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "stopAtEntry": true,
            "stopAtConnect": true,
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
            ],
            "MIMode": "gdb",
            // "miDebuggerPath": "/path/to/your gdb",
            "miDebuggerPath": "/usr/bin/gdb-multiarch",
            "targetArchitecture": "arm64",
            "miDebuggerServerAddress": "localhost:1234",
            "preLaunchTask": "Setup QEMU"
        }
    ]
}
posted @ 2024-12-07 20:09  Minstrelsy  阅读(144)  评论(0)    收藏  举报