Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call various kernel inits directly, rather than via an import #99

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ Nope. You can install [multiple versions](https://go.dev/doc/manage-install#inst
```bash
$ GOROOT=$(go1.16.13 env GOROOT) egg build
```

### How do I disable mouse/ network/ filesystem support?

By default, running `egg build` will transparently load a set of well tested, useful drivers and kernel components into your application by generating an init function which configures things.

This works wonderfully for turning any application into a useful, and usable, unikernel but is not without drawbacks- especially where things like mice, or filesystem support is not needed.

You can run `egg generate` at the root of your project and then edit the file `zz_load_eggos.go` accordingly. The presence of this file will stop `egg build` generating anything its self.
2 changes: 1 addition & 1 deletion app/cmd/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/spf13/afero"
)

Expand Down
2 changes: 1 addition & 1 deletion app/cmd/cd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"errors"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func cdmain(ctx *app.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/cpuinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/klauspost/cpuid"
)

Expand Down
4 changes: 2 additions & 2 deletions app/cmd/date.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"time"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/drivers/clock"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/drivers/clock"
)

func datemain(ctx *app.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func echomain(ctx *app.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"text/tabwriter"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func printfiles(w io.Writer, files ...os.FileInfo) {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/memtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"math/rand"
"time"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func memtestmain(ctx *app.Context) error {
Expand Down
8 changes: 4 additions & 4 deletions app/cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"errors"
"net/url"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/fs"
"github.com/icexin/eggos/fs/smb"
"github.com/icexin/eggos/fs/stripprefix"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/fs"
"github.com/jspc/eggos/fs/smb"
"github.com/jspc/eggos/fs/stripprefix"
)

func mountmain(ctx *app.Context) error {
Expand Down
8 changes: 4 additions & 4 deletions app/cmd/nes.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"io"
"time"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/drivers/kbd"
"github.com/icexin/eggos/drivers/vbe"
"github.com/icexin/eggos/log"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/drivers/kbd"
"github.com/jspc/eggos/drivers/vbe"
"github.com/jspc/eggos/log"

"github.com/fogleman/nes/nes"
"golang.org/x/image/draw"
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/nssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func nsshmain(ctx *app.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/pstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"runtime"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func gostack() []byte {
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/sleep.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func sleepmain(ctx *app.Context) error {
Expand Down
6 changes: 3 additions & 3 deletions app/cmd/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"
"time"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/drivers/kbd"
"github.com/icexin/eggos/kernel"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/drivers/kbd"
"github.com/jspc/eggos/kernel"
)

func printstat(ctx *app.Context) {
Expand Down
9 changes: 5 additions & 4 deletions app/cmd/win.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build nk
// +build nk

package cmd
Expand All @@ -9,12 +10,12 @@ import (
"unsafe"

"github.com/fogleman/fauxgl"
"github.com/icexin/eggos/app"
"github.com/icexin/eggos/drivers/kbd"
"github.com/icexin/eggos/drivers/ps2/mouse"
"github.com/icexin/eggos/drivers/vbe"
"github.com/icexin/nk/cnk"
"github.com/icexin/nk/libc"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/drivers/kbd"
"github.com/jspc/eggos/drivers/ps2/mouse"
"github.com/jspc/eggos/drivers/vbe"
"golang.org/x/image/draw"
)

Expand Down
4 changes: 2 additions & 2 deletions app/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"io"

"github.com/icexin/eggos/fs"
"github.com/icexin/eggos/fs/chdir"
"github.com/jspc/eggos/fs"
"github.com/jspc/eggos/fs/chdir"
"github.com/peterh/liner"
)

Expand Down
4 changes: 2 additions & 2 deletions app/cowsay/cowsay.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/dj456119/go-cowsay/gocowsay"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/app/cowsay/animal"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/app/cowsay/animal"
)

var animalTempalteMap = make(map[string]AnimalTemplate)
Expand Down
2 changes: 1 addition & 1 deletion app/examples/graphic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"math/rand"
"time"

"github.com/icexin/eggos/drivers/vbe"
"github.com/jspc/eggos/drivers/vbe"
)

var palette = []color.Color{color.White, color.Black}
Expand Down
2 changes: 1 addition & 1 deletion app/examples/syscall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"syscall"

"github.com/icexin/eggos/kernel/isyscall"
"github.com/jspc/eggos/kernel/isyscall"
)

var handler isyscall.Handler
Expand Down
2 changes: 1 addition & 1 deletion app/gin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"

"github.com/gin-gonic/gin"
"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

func main(ctx *app.Context) error {
Expand Down
6 changes: 3 additions & 3 deletions app/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/icexin/eggos/app
module github.com/jspc/eggos/app

go 1.16

Expand All @@ -10,9 +10,9 @@ require (
github.com/fogleman/nes v0.0.0-20210605215016-0aace4b1814a
github.com/gin-gonic/gin v1.7.2
github.com/gliderlabs/ssh v0.3.3
github.com/icexin/eggos v0.0.0-00010101000000-000000000000
github.com/icexin/nk v0.1.0
github.com/jakecoffman/cp v1.1.0
github.com/jspc/eggos v0.0.0-00010101000000-000000000000
github.com/klauspost/cpuid v1.3.1
github.com/mattn/go-shellwords v1.0.12
github.com/peterh/liner v1.2.1
Expand All @@ -29,5 +29,5 @@ require (
replace (
github.com/aarzilli/nucular => github.com/icexin/nucular v0.0.0-20210713192454-c3f236ca56cb
github.com/fogleman/nes => github.com/icexin/nes v0.0.0-20200906065456-8ff789fac016
github.com/icexin/eggos => ../
github.com/jspc/eggos => ../
)
4 changes: 2 additions & 2 deletions app/httpd/httpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package httpd
import (
"net/http"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/fs"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/fs"
"github.com/spf13/afero"
)

Expand Down
2 changes: 1 addition & 1 deletion app/js/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"regexp"
"strings"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/peterh/liner"
"github.com/robertkrimen/otto"
)
Expand Down
2 changes: 1 addition & 1 deletion app/js/js.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package js

import (
"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/robertkrimen/otto"
"github.com/spf13/afero"
)
Expand Down
2 changes: 1 addition & 1 deletion app/js/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/robertkrimen/otto"
)

Expand Down
2 changes: 1 addition & 1 deletion app/js/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/ioutil"
"net/http"

"github.com/icexin/eggos/kernel/sys"
"github.com/jspc/eggos/kernel/sys"
"github.com/robertkrimen/otto"
)

Expand Down
16 changes: 8 additions & 8 deletions app/kmain/apps.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
_ "github.com/icexin/eggos/app/cmd"
// _ "github.com/icexin/eggos/app/gin"
_ "github.com/icexin/eggos/app/cowsay"
_ "github.com/icexin/eggos/app/httpd"
_ "github.com/icexin/eggos/app/js"
_ "github.com/icexin/eggos/app/phy"
_ "github.com/jspc/eggos/app/cmd"
// _ "github.com/jspc/eggos/app/gin"
_ "github.com/jspc/eggos/app/cowsay"
_ "github.com/jspc/eggos/app/httpd"
_ "github.com/jspc/eggos/app/js"
_ "github.com/jspc/eggos/app/phy"

// _ "github.com/icexin/eggos/app/sshd"
_ "github.com/icexin/eggos/app/uidemo"
// _ "github.com/jspc/eggos/app/sshd"
_ "github.com/jspc/eggos/app/uidemo"
)
8 changes: 4 additions & 4 deletions app/kmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"runtime"

_ "github.com/icexin/eggos"
"github.com/icexin/eggos/app/sh"
"github.com/icexin/eggos/console"
"github.com/icexin/eggos/log"
_ "github.com/jspc/eggos"
"github.com/jspc/eggos/app/sh"
"github.com/jspc/eggos/console"
"github.com/jspc/eggos/log"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions app/phy/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"math/rand"
"time"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/drivers/kbd"
"github.com/icexin/eggos/drivers/vbe"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/drivers/kbd"
"github.com/jspc/eggos/drivers/vbe"
"github.com/jakecoffman/cp"
)

Expand Down
2 changes: 1 addition & 1 deletion app/sh/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"path"
"strings"

"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
"github.com/spf13/afero"
)

Expand Down
4 changes: 2 additions & 2 deletions app/sh/sh.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"strings"

"github.com/icexin/eggos/app"
"github.com/icexin/eggos/console"
"github.com/jspc/eggos/app"
"github.com/jspc/eggos/console"

"github.com/mattn/go-shellwords"
)
Expand Down
4 changes: 2 additions & 2 deletions app/shiny/event.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package shiny

import (
"github.com/icexin/eggos/console"
imouse "github.com/icexin/eggos/drivers/ps2/mouse"
"github.com/jspc/eggos/console"
imouse "github.com/jspc/eggos/drivers/ps2/mouse"
"golang.org/x/mobile/event/key"
"golang.org/x/mobile/event/mouse"
"golang.org/x/sys/unix"
Expand Down
8 changes: 4 additions & 4 deletions app/shiny/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"image/draw"
"image/png"

"github.com/icexin/eggos/assets"
imouse "github.com/icexin/eggos/drivers/ps2/mouse"
"github.com/icexin/eggos/drivers/uart"
"github.com/icexin/eggos/drivers/vbe"
"github.com/jspc/eggos/assets"
imouse "github.com/jspc/eggos/drivers/ps2/mouse"
"github.com/jspc/eggos/drivers/uart"
"github.com/jspc/eggos/drivers/vbe"
"golang.org/x/exp/shiny/screen"
"golang.org/x/image/math/f64"
)
Expand Down
2 changes: 1 addition & 1 deletion app/sshd/sshd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net"

"github.com/gliderlabs/ssh"
"github.com/icexin/eggos/app"
"github.com/jspc/eggos/app"
)

var rsaContent = `
Expand Down
Loading