Giter VIP home page Giter VIP logo

embeddedgo / go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from golang/go

75.0 3.0 5.0 339.77 MB

The Go programming language with support for bare-matal programing

Home Page: https://embeddedgo.github.io

License: BSD 3-Clause "New" or "Revised" License

Shell 0.14% Go 88.21% C 0.26% HTML 5.22% JavaScript 0.04% Assembly 6.01% Makefile 0.01% Awk 0.01% Perl 0.06% Python 0.03% Batchfile 0.02% Dockerfile 0.01%

go's Introduction

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.

go's People

Contributors

rsc avatar griesemer avatar robpike avatar ianlancetaylor avatar bradfitz avatar aclements avatar mdempsky avatar randall77 avatar cherrymui avatar josharian avatar adg avatar minux avatar dvyukov avatar alexbrainman avatar cixtor avatar cuonglm avatar tklauser avatar thanm avatar mknyszek avatar findleyr avatar agl avatar ken avatar davecheney avatar dr2chase avatar nigeltao avatar mvdan avatar filosottile avatar crawshaw avatar 4a6f656c avatar prattmic avatar

Stargazers

IzumiGoshi avatar Marco Gandra avatar Lewin Kelly avatar Bastien Veuthey avatar Nikita Nikonov avatar 0xNULL avatar nisch.codes avatar Javad EbrahimPourBoura avatar sam bacha avatar Dmitry Aladin avatar  avatar gihnius avatar Antares avatar Timur Celik avatar Christian Korneck avatar  avatar Sandalots avatar mzz avatar Eric Johnson avatar kizzy avatar  avatar  avatar  avatar Xue Peidong avatar R. S. Doiel avatar  avatar Bryan Souza avatar  avatar sowiner avatar Elara avatar Larry Bah avatar  avatar Kulshekhar Kabra avatar  avatar Pavlos Karakalidis avatar  avatar Devendra Tewari avatar John M. Owen avatar venjiang avatar Tsuzuki Tsuchiya avatar  avatar Dmitrii Okunev avatar Noofbiz avatar Robin avatar  avatar  avatar Shun Wang avatar  avatar  avatar GITSRC avatar  avatar CodeCore avatar Ji Hyeok Lee avatar Sylvain avatar 不求圣剑 avatar moatx avatar Jacob Gadikian avatar Piotr Mońko avatar  avatar Hao.Dong avatar xukgo avatar  avatar Jonathan Beri avatar Ingo Oeser avatar kekemuyu avatar Tim Kersey avatar Anupam <|> अनुपम avatar irieda avatar Anuj Deshpande avatar  avatar Michael Sullivan avatar  avatar Simen Linderud avatar Oleg Schwann avatar  avatar

Watchers

 avatar Timur Celik avatar  avatar

go's Issues

Undefined: gostartcall

Trying to compile the blinky program for nRF5, but getting an error on macOS 12.3.

export GOTEXT=0x00001000
export GOMEM=0x20000008:262136
export GOSTRIPFN=1
export GOOUT=hex

emgo build -o blinky ./main.go
# runtime
../../../embeddedgo/goroot/src/runtime/stack.go:1132:2: undefined: gostartcall

I tried a few different patch version in the patch repo, but got the same error each time.

nil checking doesn't work on loads

Current nil checking code bases on the fact that loading from or store to pageZero causes a segmentation fault. This usually doesn't work in case of embedded system.

Possible solutions for ARMv7-M:

  1. Use MPU if available to make the beginning of memory unreadable. This doesn't change the current nil check implementation but the MPU is optional peripheral. I don't know how this solution interfere with exception vector fetch which is performed on instruction bus. In the last resort, we can accept that nil checks work only in unprivileged mode.

  2. Use test and branch or conditional UNDEF. This requires couple of additional instructions and unset faultOnNilArg0 for all load instructions. In case of UNDEF we need to implement UsageFault handler to handle Undefined Instruction exception.

We alseo need to handle nil checking for stores. In most cases the beginning of memory is read-only but in case of STM32F7 and maybe other Cortex-M7 based MCUs the ITCM-RAM can be mapped at address 0.

Implement some runtime initialization outside the runtime

Consider to perform a target specific initialization outside the runtime package in target specific packages as proposed by n64 port:

// Relies on external implementations of the following target specific
// functions, that must be provided by the target module via go:linkname pragma
// or in assembly:
//
// _rt0_mips64_noos()
// runtime.unhandledException()
// runtime.defaultWrite(fd int, p []byte) int

It may give us more flexibility when it comes to early hardware initialization. For example, with this approach we can probably avoid the plugin code in imxmbr.

Questions

  1. Does this //go:linkname approach affects the order of package initialization if we use Go (nosplit) instead of assembly?
  2. Can we reduce the number of external functions to only _rt0_GOARCH_noos and in some way force the init function in some external package to be the first one (with dependencies) executed by runtime?
  3. If the init approach described above doesn't work, can we reduce the number of external functions to only two. For example the second one in the form of: func noos_defaults() map[string]any?
  4. Maybe only one _rt0_GOARCH_noos function is enough to fulfill our needs?

I personally prefer 4. You can probably use DATA unhandledException set to very dumb handler that stops execution here and update it in the _rt0_GOARCH_noos to more intelligent one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.