Re:Gopher-OS: A Proof of Concept OS Written in Go
by driusan on Monday June 12, 2017 @04:48PM
(#14540996)
The Go assembly language is actually one of the things that make doing something like this difficult.
Go uses the Plan9 assembly syntax but doesn't support GNU asm syntax. gccgo uses GNU asm syntax but doesn't support Plan9 assembly.
The Go linker doesn't allow you to not link in the Go standard library runtime, which means you need to use gccgo to write a kernel.
The end result is that you can't do something that's buildable with the standard Go toolchain, and even if Go were to add a "don't link the runtime" option there'd be no way to incrementally port your ASM over one bit at a time. It's all or nothing.
Re:Gopher-OS: A Proof of Concept OS Written in Go
by achilleasa on Monday June 12, 2017 @05:04PM
(#14541096)
I take a slightly different approach for my implementation that allows me to use the standard go toolchain. I use nasm for the early ASM code and patch the go build tool's output (see: https://github.com/achilleasa/gopher-os/blob/master/Makefile...) to bypass the link step and replace it with a manual call to ld that links the go object files with the output from nasm.
I will be talking about this approach in more detail in GolangUK '17.
Re:Gopher-OS: A Proof of Concept OS Written in Go
by lloeki on Tuesday June 13, 2017 @02:36AM
(#14543213)
> I will be talking about this approach in more detail in GolangUK '17.
Sounds great. Any chance for you to come to dotgo.eu?
Re:Gopher-OS: A Proof of Concept OS Written in Go
by driusan on Tuesday June 13, 2017 @09:44AM
(#14544636)
Do you know if your talk going to be online afterwards?
Re:Gopher-OS: A Proof of Concept OS Written in Go
by achilleasa on Tuesday June 13, 2017 @10:43AM
(#14545061)
Yes, the talk will be recorded and posted online with the slides and some getting started code.
https://golang.org/doc/asm