Update markdown and tabs and stuff
This commit is contained in:
@@ -41,8 +41,8 @@ boasts expressive error messages as a feature...
|
||||
|
||||
Anyway with clang version 3.1 you can compile i386-elf object files through
|
||||
|
||||
> clang -ccc-host-triple i386-pc-linux -c source.c -o object.o
|
||||
{: .prettyprint .lang-sh}
|
||||
:::bash
|
||||
$ clang -ccc-host-triple i386-pc-linux -c source.c -o object.o
|
||||
|
||||
`-ccc-host-triple` isn't mentioned even once in the documentation of
|
||||
clang nor are the possible choices. `i386-elf` which is somewhat of a
|
||||
@@ -66,8 +66,8 @@ If you run OSX clang 3.1 is installed with the
|
||||
current version of Xcode. Version 3.2 is installed by
|
||||
[Homebrew](http://mxcl.github.com/homebrew/).
|
||||
|
||||
> homebrew install llvm
|
||||
{: .prettyprint .lang-sh}
|
||||
:::bash
|
||||
$ homebrew install llvm
|
||||
|
||||
Binutils
|
||||
--------
|
||||
@@ -82,12 +82,14 @@ Instead, again, I use Homebrew.
|
||||
First of all, to get a working cross target binutils, the brew formula
|
||||
will have to be changed a bit
|
||||
|
||||
> brew edit binutils
|
||||
:::bash
|
||||
$ brew edit binutils
|
||||
|
||||
Change the last configure flag (` --enable-targets=x86_64-elf,arm-none-eabi,m32r`)
|
||||
to `--target=i386-elf`. I also changed the `--program-prefix` to `i386-elf-`. Save the file and run
|
||||
|
||||
> brew install binutils
|
||||
:::bash
|
||||
$ brew install binutils
|
||||
|
||||
and you're good to go.
|
||||
|
||||
@@ -122,48 +124,53 @@ a text mode (curses mode).
|
||||
|
||||
So I went out on a whim and tried
|
||||
|
||||
> brew info qemu
|
||||
:::bash
|
||||
$ brew info qemu
|
||||
|
||||
By now you should know pretty much what I think of Homebrew, so the
|
||||
results of that command pretty much sealed the deal.
|
||||
|
||||
Now I run my kernel in qemu through
|
||||
|
||||
> qemu-system-i386 -kernel kernel/kernel -curses
|
||||
:::bash
|
||||
$ qemu-system-i386 -kernel kernel/kernel -curses
|
||||
|
||||
Qemu also turned out to have a monitor mode which contains some of the
|
||||
functions I used most often in the bochs debugger, such as printing the
|
||||
memory map. Further, this could be accessed using telnet from a
|
||||
different tmux pane.
|
||||
|
||||
#!/bin/bash
|
||||
tmux split-window -h 'qemu-system-i386 -kernel kernel/kernel -curses -monitor telnet:localhost:4444,server'
|
||||
tmux select-pane -L
|
||||
telnet localhost 4444
|
||||
{: .prettyprint}
|
||||
:::bash
|
||||
#!/bin/bash
|
||||
tmux split-window -h 'qemu-system-i386 -kernel kernel/kernel -curses -monitor telnet:localhost:4444,server'
|
||||
tmux select-pane -L
|
||||
telnet localhost 4444
|
||||
|
||||
Finally, I also installed an i386-elf targeted version of gdb - using Homebrew, obviously, with the same trick as for binutils. Gdb is found in a different tap of homebrew, so that will have to be installed first
|
||||
|
||||
> brew tap homebrew/dupes
|
||||
> brew edit gdb
|
||||
:::bash
|
||||
$ brew tap homebrew/dupes
|
||||
$ brew edit gdb
|
||||
|
||||
Add the flag `--target=i386-elf` to the configure flags, save and
|
||||
|
||||
> brew install gdb
|
||||
:::bash
|
||||
$ brew install gdb
|
||||
|
||||
This will link to `ì386-elf-gdb` and can be run in yet another tmux window.
|
||||
|
||||
#!/bin/bash
|
||||
tmux split-window -h 'qemu-system-i386 -kernel kernel/kernel -curses -monitor telnet:localhost:4444,server -s -S'
|
||||
tmux select-pane -L
|
||||
tmux slit-window -v 'i386-elf-gdb'
|
||||
tmux select-pane -U
|
||||
telnet localhost 4444
|
||||
:::bash
|
||||
#!/bin/bash
|
||||
tmux split-window -h 'qemu-system-i386 -kernel kernel/kernel -curses -monitor telnet:localhost:4444,server -s -S'
|
||||
tmux select-pane -L
|
||||
tmux slit-window -v 'i386-elf-gdb'
|
||||
tmux select-pane -U
|
||||
telnet localhost 4444
|
||||
|
||||
Upon start, gdb will look for a file called `.gdbinit` which in my case contains
|
||||
|
||||
file kernel/kernel
|
||||
target remote localhost:1234
|
||||
file kernel/kernel
|
||||
target remote localhost:1234
|
||||
|
||||
Results
|
||||
-------
|
||||
|
||||
Reference in New Issue
Block a user