Merge pull request #2 from eddyb/master

Fixed a link error on x64 linux by providing the target in LDFLAGS.
vga: improved code in write(), added fill() function and turned clear() into a wrapper around it.
io: module for abstracting I/O, currently does x86 PIO
serial: new module for reading and writing to a serial port, used in main to write some basic info to the serial port (use -serial stdio in qemu to see this).
vga: get buflen out of input string in a more concise way
build: allow machine emulation for $(LD) to be overriden in config.mk (MACHINE variable)
io: turn outport/inport into a generic; turns out Clang maps "a" and "d" as input reg constraints to LLVM's X86 target inline ASM constraints.

See https://github.com/llvm-mirror/clang/blob/master/lib/Basic/Targets.cpp#L2861-L2879.
start: load a basic initial GDT

Using this we also now set GS to a known segment pointing to known memory,
which means the stack check on entry to functions works as expected without
trashing the memory at physical address 0x30.
gdt: we now load a full, proper GDT in Rust.

The GDT loaded in start.S is used to get us into Rust code with a working
TLS segment for stack switching. The GDT loaded in Rust is then used for
everything else in the system.
cpu: idt module doesn't exist yet