Https Help.github.com Articles Generating-an-ssh-key
Https Help.github.com Articles Generating-an-ssh-key 4,8/5 7763 reviews

You’ll use two sets of tools in this class: an x86 emulator, QEMU, for running your kernel; and a compiler toolchain, including assembler, linker, C compiler, and debugger, for compiling and testing your kernel. I am new in atom, i user git-control on a project with no issue. Recently i had another forlder into my project, with its own git repo, but i can't interact with it via git-control, i can only commit/push to the repo of the first folder.

You’ll use two sets of tools in this class: an x86 emulator,QEMU, for running your kernel; and a compilertoolchain, including assembler, linker, C compiler, anddebugger, for compiling and testing your kernel. This page has theinformation you’ll need to download and install your own copies. Thisclass assumes familiarity with Unix commands throughout.

It should be possible to get this development environment running underwindows with the help of Cygwin. Installcygwin, and be sure to install the flex and bison packages (they areunder the development header).

Https

Installation¶

Using a Virtual Machine¶

Otherwise, the easiest way to get a compatible toolchain is to installa modern Linux distribution on your computer. With platform virtualization,Linux can cohabitate with your normal computing environment.Installing a Linux virtual machine is a two step process.First, you download the virtualization platform.

  1. Download and install Virtualbox/Vagrant
  • Download and install the latest version of virtualbox
  • Download and install the latest version of vagrant
  • (Windows only, as ssh client) Download and install git
  • Ubuntu users may also use the following commands to get virtualbox and vagrant.

Note

  • It is optional to use vagrant for our labs. You can use virtualbox only.

  • If you decide to use virtualbox only.

    1. you could download Ubuntu desktop here like ubuntu-14.04.3-desktop-i386.iso.
    2. Start up your virtualization platform and create a new (32-bit) virtual machine. Use the downloaded Ubuntu image as a boot disk
    3. Follow all steps that described below except vagrant parts.
  1. Add guest OS and run the VM (Vagrant’s user only)
  1. Once you have the VM up and running, initialize your VM for this course:
  1. If you haven’t previously, create an ssh key and upload it to github.gatech.edu by following the instructions here: https://help.github.com/articles/generating-an-ssh-key/. Then clone your repo replacing YOUR-USERNAME with your github username.

QEMU Emulator¶

QEMU (manual) is a modern and fast PC emulator.

  • Installing QEMU

    • Most GNU/Linux distributions have simple installation processes based on package repositories. It is often best to use the repository approachfor installing QEMU, as you can be confident that it will just install and run.
  • Compilation from the source

    • You might prefer to install QEMU by compiling the source code, which is available on the QEMU website
    1. First you must decompress the sources:
    1. Configure QEMU and build it
    1. Make to install QEMU in /usr/local

Tool Guide¶

Familiarity with your environment is crucial for productive developmentand debugging. This page gives a brief overview of the JOS environmentand useful GDB and QEMU commands. Don’t take our word for it, though.Read the GDB and QEMU manuals. These are powerful tools that are worthknowing how to use.

Index

Debugging tips:
Reference:

Debugging tips¶

Kernel¶

GDB is your friend. Use the qemu-gdb target (or itsqemu-gdb-nox variant) to make QEMU wait forGDB to attach. See the GDB reference below for some commandsthat are useful when debugging kernels.

If you’re getting unexpected interrupts, exceptions, or triple faults,you can ask QEMU to generate a detailed log of interrupts using the-d argument. Windows 10 pro key generator kms.

To debug virtual memory issues, try the QEMU monitor commands infomem (for a high-level overview) or infopg (for lots of detail). Note that these commandsonly display the current page table.

(Lab 4+) To debug multiple CPUs, use GDB’s thread-related commands likethread and info threads.

User environments (lab 3+)¶

GDB also lets you debug user environments, but there are a few thingsyou need to watch out for, since GDB doesn’t know that there’s adistinction between multiple user environments, or between user andkernel.

You can start JOS with a specific user environment using makerun-*name* (or you can edit kern/init.c directly).To make QEMU wait for GDB to attach, use therun-*name*-gdb variant.

You can symbolically debug user code, just like you can kernel code, butyou have to tell GDB which symbol table to use with thesymbol-file command, since it can only use onesymbol table at a time. The provided .gdbinit loads the kernelsymbol table, obj/kern/kernel. The symbol table for a userenvironment is in its ELF binary, so you can load it using symbol-fileobj/user/name. Don’t load symbols from any .o files, as thosehaven’t been relocated by the linker (libraries are statically linkedinto JOS user binaries, so those symbols are already included in eachuser binary). Make sure you get the right user binary; libraryfunctions will be linked at different EIPs in different binaries and GDBwon’t know any better!

(Lab 4+) Since GDB is attached to the virtual machine as a whole, itsees clock interrupts as just another control transfer. This makes itbasically impossible to step through user code because a clock interruptis virtually guaranteed the moment you let the VM run again. Thestepi command works because it suppresses interrupts, butit only steps one assembly instruction. Breakpointsgenerally work, but watch out because you can hit the same EIP in adifferent environment (indeed, a different binary altogether!).

Reference¶

JOS makefile¶

The JOS Makefile includes a number of phony targets for running JOSin various ways. All of these targets configure QEMU to listen for GDBconnections (the *-gdb targets also wait for this connection). Tostart once QEMU is running, simply run gdb from your lab directory. Weprovide a .gdbinit file that automatically points GDB at QEMU, loadsthe kernel symbol file, and switches between 16-bit and 32-bit mode.Exiting GDB will shut down QEMU.

make qemu
Build everything and start QEMU with the VGA console in a new windowand the serial console in your terminal. To exit, either close theVGA window or press Ctrl-c or Ctrl-ax in your terminal.
make qemu-nox
Like makeqemu, but run with only the serial console. To exit,press Ctrl-ax. This is particularly useful over SSH connectionsto Athena dialups because the VGA window consumes a lot ofbandwidth.
make qemu-gdb
Like makeqemu, but rather than passively accepting GDBconnections at any time, this pauses at the first machineinstruction and waits for a GDB connection.
make qemu-nox-gdb
A combination of the qemu-nox and qemu-gdb targets.
make run-name
(Lab 3+) Run user program name. For example, makerun-helloruns user/hello.c.
make run-name-nox, run-name-gdb, run-name-gdb-nox,
(Lab 3+) Variants of run-name that correspond to the variants ofthe qemu target.

The makefile also accepts a few useful variables:

make V=1 ..
Verbose mode. Print out every command being executed, includingarguments.
make V=1 grade
Stop after any failed grade test and leave the QEMU output injos.out for inspection.
make QEMUEXTRA=’args‘ ..
Specify additional arguments to pass to QEMU.

JOS obj/¶

When building JOS, the makefile also produces some additional outputfiles that may prove useful while debugging:

obj/boot/boot.asm, obj/kern/kernel.asm, obj/user/hello.asm, etc.
Assembly code listings for the bootloader, kernel, and userprograms.
obj/kern/kernel.sym, obj/user/hello.sym, etc.
Symbol tables for the kernel and user programs.
obj/boot/boot.out, obj/kern/kernel, obj/user/hello, etc
Linked ELF images of the kernel and user programs. These containsymbol information that can be used by GDB.

GDB¶

See the GDBmanual for a fullguide to GDB commands. Here are some particularly useful commands forcs3210, some of which don’t typically come up outside of OS development.

Ctrl-c
Halt the machine and break in to GDB at the current instruction. IfQEMU has multiple virtual CPUs, this halts all of them.
c (or continue)
Continue execution until the next breakpoint or Ctrl-c.
si (or stepi)
Execute one machine instruction.
b function or b file:line (or breakpoint)
Set a breakpoint at the given function or line.
b *addr (or breakpoint)
Set a breakpoint at the EIP addr.
set print pretty
Enable pretty-printing of arrays and structs.
info registers
Print the general purpose registers, eip, eflags, and thesegment selectors. For a much more thorough dump of the machineregister state, see QEMU’s own inforegisters command.
x/Nx addr
Display a hex dump of N words starting at virtual address addr.If N is omitted, it defaults to 1. addr can be any expression.
x/Ni addr
Display the N assembly instructions starting at addr. Using$eip as addr will display the instructions at the currentinstruction pointer.
symbol-file file
(Lab 3+) Switch to symbol file file. When GDB attaches to QEMU, ithas no notion of the process boundaries within the virtual machine,so we have to tell it which symbols to use. By default, we configureGDB to use the kernel symbol file, obj/kern/kernel. If themachine is running user code, say hello.c, you can switch to thehello symbol file using symbol-fileobj/user/hello.

info

Add Ssh Key To Github

QEMU represents each virtual CPU as a thread in GDB, so you can use allof GDB’s thread-related commands to view or manipulate QEMU’s virtualCPUs.

thread n
GDB focuses on one thread (i.e., CPU) at a time. This commandswitches that focus to thread n, numbered from zero.
info threads
List all threads (i.e., CPUs), including their state (active orhalted) and what function they’re in.

QEMU¶

QEMU includes a built-in monitor that can inspect and modify the machinestate in useful ways. To enter the monitor, press Ctrl-a c in theterminal running QEMU. Press Ctrl-a c again to switch back to the serialconsole.

For a complete reference to the monitor commands, see the QEMUmanual.Here are some particularly useful commands:

xp/Nx paddr
Display a hex dump of N words starting at physical addresspaddr. If N is omitted, it defaults to 1. This is the physicalmemory analogue of GDB’s x command.
info registers

Display a full dump of the machine’s internal register state. Inparticular, this includes the machine’s hidden segment state forthe segment selectors and the local, global, and interruptdescriptor tables, plus the task register. This hidden state is theinformation the virtual CPU read from the GDT/LDT when the segmentselector was loaded. Here’s the CS when running in the JOS kernel inlab 1 and the meaning of each field:

CS=0008
The visible part of the code selector. We’re using segment 0x8.This also tells us we’re referring to the global descriptortable (0x8&4=0), and our CPL (current privilege level) is0x8&3=0.
10000000
The base of this segment. Linear address = logical address +0x10000000.
ffffffff
The limit of this segment. Linear addresses above 0xffffffffwill result in segment violation exceptions.
10cf9a00
The raw flags of this segment, which QEMU helpfully decodes forus in the next few fields.
DPL=0
The privilege level of this segment. Only code running withprivilege level 0 can load this segment.
CS32
This is a 32-bit code segment. Other values include DS fordata segments (not to be confused with the DS register), andLDT for local descriptor tables.
[-R-]
This segment is read-only.
info mem

(Lab 2+) Display mapped virtual memory and permissions. For example,

tells us that the 0x00040000 bytes of memory from 0xef7c0000 to0xef800000 are mapped read/write and user-accessible, while thememory from 0xefbf8000 to 0xefc00000 is mapped read/write, but onlykernel-accessible.

QEMU also takes some useful command line arguments, which can be passedinto the JOS makefile using the QEMUEXTRAvariable.

make QEMUEXTRA=’-d int’ ..

Generating Ssh Keys For Git

Log all interrupts, along with a full register dump, toqemu.log. You can ignore the first two log entries, “SMM: enter”and “SMM: after RMS”, as these are generated before entering theboot loader. After this, log entries look like

Github Ssh Key Not Working

The first line describes the interrupt. The 4: is just a logrecord counter. v gives the vector number in hex. e givesthe error code. i=1 indicates that this was produced by anint instruction (versus a hardware interrupt). The rest of theline should be self-explanatory. See inforegisters for a description of theregister dump that follows.

Https://help.github.com/articles/generating-ssh-keys

Note: If you’re running a pre-0.15 version of QEMU, the log will bewritten to /tmp instead of the current directory.

Questions or comments regarding cs3210?Send e-mail to the TAs at *cs3210-staff@cc.gatech.edu*.