Go Bare Bones: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
m Bot: Replace deprecated source tag with syntaxhighlight |
||
Line 15:
The first thing you should do is set up a GCC Cross Compiler that supports Go. To do this read and follow [[GCC Cross-Compiler]] to the letter with one exception. When configuring the build for GCC we need to enable Go to get the i686-elf-gccgo compiler.
So instead of using: <
== Overview ==
Line 111:
You can then assemble boot.s using:
<
== Writing the Terminal package in Go ==
Line 213:
</source>
Compile using: <
== How imported packages are found ==
Line 224:
* .o
A .gox file contains just the import data. If you wanted to extract it from our terminal.go.o object file we use: <
== Writing a kernel in Go ==
Line 230:
Now we create the file kernel.go that contains the Main() function called from our bootstrap assembly we've already created and compiled above. It will import the terminal package we also created & compiled. Then we use that package to print text to the screen.
<
import "terminal"
Line 247:
// Print our Hello, World!
terminal.Print("Hello, Kernel World!\n")
}</
Compile using: <
== Linking the Kernel ==
Line 301:
You can link your kernel using:
<
The file myos.bin is now your kernel. Note that we are linking against [[libgcc]], which implements various routines that your cross-compiler depends on. Leaving it out will give you problems in the future.
Line 310:
QEMU supports booting multiboot kernels directly without using a bootable medium:
<
== External Links ==
|