GithubHelp home page GithubHelp logo

Comments (1)

philipgreat avatar philipgreat commented on July 2, 2024

The following code works under mips and arm CPU, it should work on other linux too.

env GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w" -o server-arm server.go
env GOOS=linux GOARCH=mips go build -ldflags "-s -w" mem.go

PC linux is not tested yet. Referenced different headers made this works.

https://github.com/mojo-runtime/lib-linux/blob/6dbfa74d17beda9be9c6e3b595c76f8df3cbb077/c/struct-termios.h

#if defined(__mips__)
#  define NCCS 23
#elif defined(__sparc__)
#  define NCCS 17
#else
#  define NCCS 19
#endif

The change to the file serial/open_linux.go

Please reference https://github.com/philipgreat/go-serial/blob/master/serial/open_linux.go

func nccs() int {
	if runtime.GOARCH == "mips" {
		return 23
	}
	if runtime.GOARCH == "mipsle" {
		return 23
	}
	if runtime.GOARCH == "spark" {
		return 17
	}
	if runtime.GOARCH == "sparc64" {
		return 17
	}
	return 19

}

const (
	kTCSETS2 = unix.TCSETS2 //0x8030542B
	kBOTHER  = unix.BOTHER//0x00001000
	kNCCS    = nccs() 
)

from go-serial.

Related Issues (20)

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.