icexin / eggos Goto Github PK
View Code? Open in Web Editor NEWA Go unikernel running on x86 bare metal
Home Page: http://eggos.icexin.com
License: MIT License
A Go unikernel running on x86 bare metal
Home Page: http://eggos.icexin.com
License: MIT License
At present, if egg run
does not use -k
to specify the kernel file, it simply prints the error of missing kernel file
, need to add more detailed information on how to specify the kernel file.
when I download the eggos and the source, I try run the "helloworld" by "egg run" command,but I receive error, and How can I do , my env setting error?
package github.com/icexin/eggos/app/examples/helloworld
imports github.com/icexin/eggos
imports github.com/icexin/eggos/drivers/e1000
imports github.com/icexin/eggos/inet
imports gvisor.dev/gvisor/pkg/abi/linux
imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /root/go/pkg/mod/gvisor.dev/[email protected]/pkg/gohacks
2022/06/28 09:52:16 error building kernel: exit status 1
Split architecture-independent code
deps #84
Add clear command .
Facing issue, below is code which I wrote but qemu gets stuck.
fmt.Fprintln(ctx.Stdout, “\x1b[1;1H\x1b[2J”)
Osdev.wiki use a linker script, but i could not find one in the repo. I want to understand where have you included the process of the linker, can you please guide me through this part.
Thank you
This project is cool :) can you the add the sponsorship button (or something equivalent) ?
Go 1.17 implements a new way of passing function arguments and results using registers instead of the stack.
This issue is used to track affected modules and corresponding PRs.
I am trying to modify the multiboot header in multiboot_header.S. In order to compile my changes, I have a set up gcc and binutils as described over at osdev. But it seems that I need a gcc that supports both 64-bit and 32-bit mode (the magefile uses both -m32 and -m64). How did you configure your cross compiler?
g1.16
No response
64 bit mode has the following advantages:
I've written a really simple app at https://github.com/jspc/primes which I'd like to package and run via eggos.
(The app calculates primes- it seemed like a simple use case to play with eggos).
The problem I'm facing is that trying to run the app directly with egg run
gives me:
qemu-system-x86_64: multiboot knows VBE. we don't
Could not open option rom 'multiboot_dma.bin': No such file or directory
SeaBIOS (version ArchLinux 1.15.0-1)
iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+0FF914E0+0FEF14E0 CA00
Booting from Hard Disk...
Boot failed: could not read the boot disk
Booting from Floppy...
Boot failed: could not read the boot disk
Booting from DVD/CD...
Boot failed: Could not read from CDROM (code 0003)
Booting from ROM...
iPXE (PCI 00:03.0) starting execution...ok
iPXE initialising devices...ok
iPXE 1.20.1+ (g4bd0) -- Open Source Network Boot Firmware -- http://ipxe.org
Features: DNS HTTP iSCSI TFTP AoE ELF MBOOT PXE bzImage Menu PXEXT
net0: 52:54:00:12:34:56 using 82540em on 0000:00:03.0 (open)
[Link:up, TX:0 TXE:0 RX:0 RXE:0]
Configuring (net0 52:54:00:12:34:56)...... ok
net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
Nothing to boot: No such file or directory (http://ipxe.org/2d03e13b)
No more network devices
No bootable device.
I've read #91, and so I get that the first two lines can be ignored, but the fact qemu can't find the boot disk is worrying.
If I compile an iso
file, then I get the grub menu, then just the line Loading /boot/kernel.elf...
and then it all quits.
Am I doing something wrong? I can see a segfault when I run gdb kernel.elf
, but I'm not sure whether that's just because running a ring0 app on linux fails fast and loud, or whether there's a different reason.
Any pointers you can give me toward figuring this out would be really appreciated!
i am getting this error, (08f7870)
$ mage qemu
go: downloading github.com/spf13/viper v1.8.1
go: downloading github.com/spf13/cobra v1.2.1
go: downloading github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: extracting github.com/spf13/viper v1.8.1
go: downloading github.com/magiconair/properties v1.8.5
go: downloading github.com/spf13/afero v1.6.0
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/pelletier/go-toml v1.9.3
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading github.com/mitchellh/mapstructure v1.4.1
go: extracting github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: extracting github.com/spf13/cobra v1.2.1
go: extracting github.com/spf13/jwalterweatherman v1.1.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: extracting github.com/subosito/gotenv v1.2.0
go: downloading gopkg.in/ini.v1 v1.62.0
go: extracting github.com/mitchellh/mapstructure v1.4.1
go: downloading github.com/spf13/pflag v1.0.5
go: extracting github.com/spf13/afero v1.6.0
go: extracting github.com/magiconair/properties v1.8.5
go: extracting github.com/spf13/cast v1.3.1
go: extracting github.com/fsnotify/fsnotify v1.4.9
go: extracting github.com/hashicorp/hcl v1.0.0
go: downloading golang.org/x/sys v0.0.0-20210510120138-977fb7262007
go: extracting gopkg.in/yaml.v2 v2.4.0
go: extracting github.com/spf13/pflag v1.0.5
go: extracting gopkg.in/ini.v1 v1.62.0
go: extracting github.com/pelletier/go-toml v1.9.3
go: extracting golang.org/x/sys v0.0.0-20210510120138-977fb7262007
go: finding github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: finding github.com/spf13/cobra v1.2.1
go: finding github.com/spf13/pflag v1.0.5
go: finding github.com/spf13/viper v1.8.1
go: finding github.com/fsnotify/fsnotify v1.4.9
go: finding golang.org/x/sys v0.0.0-20210510120138-977fb7262007
go: finding github.com/hashicorp/hcl v1.0.0
go: finding github.com/magiconair/properties v1.8.5
go: finding github.com/mitchellh/mapstructure v1.4.1
go: finding github.com/pelletier/go-toml v1.9.3
go: finding github.com/spf13/afero v1.6.0
go: finding github.com/spf13/cast v1.3.1
go: finding github.com/spf13/jwalterweatherman v1.1.0
go: finding github.com/subosito/gotenv v1.2.0
go: finding gopkg.in/ini.v1 v1.62.0
go: finding gopkg.in/yaml.v2 v2.4.0
build github.com/icexin/eggos/cmd/egg: cannot load embed: malformed module path "embed": missing dot in first path element
Error: running "go build -o ../egg ./egg" failed with exit code 1
I tried egg build
on something very simple:
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:16:51
~/tmp/hello-eggos
130
$ egg build .
2021/08/06 10:16:53 eggos not found in go.mod
2021/08/06 10:16:53 go get github.com/icexin/eggos
go get: added github.com/icexin/eggos v0.4.0
malformed import path "-tags": leading dash
package eggos is not in GOROOT (/usr/local/Cellar/go/1.16/libexec/src/eggos)
2021/08/06 10:18:02 exit status 1
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:02
~/tmp/hello-eggos
1
$ ls -lah
total 2.1M
drwxr-xr-x 6 prologic staff 192 Aug 6 10:18 .
drwxr-xr-x 151 prologic staff 4.8K Aug 6 10:16 ..
-rw-r--r-- 1 prologic staff 80 Aug 6 10:18 go.mod
-rw-r--r-- 1 prologic staff 98K Aug 6 10:18 go.sum
-rwxr-xr-x 1 prologic staff 2.0M Aug 6 10:16 hello-eggos
-rw-r--r-- 1 prologic staff 73 Aug 6 10:16 main.go
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:47
~/tmp/hello-eggos
0
$ cat main.go
package main
import "fmt"
func main() {
fmt.Println("Hello eggos!")
}
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:50
~/tmp/hello-eggos
0
$ cat go.mod
module hello-eggos
go 1.16
require github.com/icexin/eggos v0.4.0 // indirect
It might be the last 3 lines here:
malformed import path "-tags": leading dash
package eggos is not in GOROOT (/usr/local/Cellar/go/1.16/libexec/src/eggos)
2021/08/06 10:18:02 exit status 1
Bug?
running: egg build -o kernel.sh on ubuntu in virtualbox (as to avoid issues with multiple go versions)
1.16.15
../../go/pkg/mod/github.com/icexin/[email protected]/fs/mount/mountfs.go:262:30: cannot use m (type *MountableFs) as type afero.Fs in argument to lstatIfPossible:
*MountableFs does not implement afero.Fs (missing Chown method)
../../go/pkg/mod/github.com/icexin/[email protected]/fs/mount/mountfs.go:266:18: cannot use m (type *MountableFs) as type afero.Fs in argument to departWalk:
*MountableFs does not implement afero.Fs (missing Chown method)
看了一下内核调度部分的代码,架构图中说这部分是没有go runtime的。但是这部分代码是go写的,编译后不就自动使用了go runtime吗?
Now eggos allows users to write their own kernel, the lack of some system calls will cause the program to not run normally, add a document describing how to add syscalls.
Thanks for merging #96, it's really helped me debug the issues I'm having.
The problem is that I'm missing logs which happen in init()
functions in eggos, due to the order in which init functions run- source files are loaded in alphabetical order, the packages are loaded, and those init
functions are added to the run order first, then the ones in the main package.
This means in order to set the log level you need to do something a bit gory like I've done here - create a file which is guaranteed to be parsed first (I prefixed mine with 00_
) and have that include a package whose init
function only exists to call out to set the log level.
Now if that's the way you want this problem solving, then that's fine (I can keep this approach), but I think a better approach would be to change the build tool to:
zz_eggos.go
(following conventions from tools like the operator SDK)eggos.go
file (rather than importing it, which will allow us to avoid the top)I'd also like to make a minor change to how drivers and stuff are initialised. Rather than having them Ignore this, it's an ordering issue with where the panic trap happens, which I will fix.panic()
out, which exits on baremetal and, in my case, clears output (so I can't even see what failed and why) I'd like them to print errors to the console and halt so that the output exists long enough to read.
But I can open a new issue to discuss that design.
brew install brew install i386-elf-binutils i386-elf-gcc i386-elf-gdb
should be
brew install i386-elf-binutils i386-elf-gcc i386-elf-gdb
Eggos will be upgraded to 64-bit in the future. Considering that many codes are strongly related to the architecture, it will be easier to upgrade 64-bit directly without keeping 32-bit code.
However, x86 32-bit protected mode is a classic mode. Many operating system tutorials or materials are based on 32-bit.
If want to keep the 32-bit code, the code needs some refactoring to separate the architecture-related code.
When booting from a Ventoy (latest version) prepared USB flash drive, there's no progress past "loading /boot/kernel.elf".
The screen remains totally blank.
Under Qemu, it works as expected.
Is there any way to debug the kernel during boot-up?
Lenovo Thinkpad E535
AMD A4-4300M CPU
4GB RAM
500GB Samsung 840 EVO
I'm booting from a small 4GB flash drive, turned off secure boot and enabled both UEFI and legacy BIOS (with legacy BIOS being given the preference).
1.16.15
No response
其实是想用go语言开发嵌入式,单片机肯定用不上go的标准库。只要能用上go的协程、管道等主要特性就行。移植的难点估计主要是单片机不支持mmu,内存管理不知道怎么处理。
I came across your project on one of my feeds… What's your project's end goal? I see some issues you've created which to me seem very complex and large scope of work involved
This is a test issue, please disregard (I will close shortly)
go version go1.16.13 linux/amd64
No response
Although the goal of eggos is to run on bare metal, supporting virtio allows us to run eggos on cloud servers.
We can view system metrics through prometheus+grafana and it should be easy to integrate.
We can put more system metrics in procfs
, such as the number of syscalls, the number of context switches, and then we can collect them through Prometheus.
Do we need to build a generic procfs
framework with interfaces like http.Handler
?
Hi,
This is a very cool project - thank you for building it! I tried running the helloworld example on AWS EC2 and got the following error. This output is running with the "debug" log level.
[trap] tid:2
[syscall] tid:4
[pci] no pci device found for e1000
[inet] begin dhcp
panic: nil pointer or invalid memory access
goroutine 1 [running]:
github.com/icexin/eggos/kernel.pageFaultPanic()
/Users/aidan/dev/oss/eggos/kernel/trap.go:73 +0x2a
github.com/icexin/eggos/drivers/e1000.(*driver).Transmit(0x68056140, 0x6808c200, 0x3a29de, 0x6)
/Users/aidan/dev/oss/eggos/drivers/e1000/e1000.go:224 +0x3b
github.com/icexin/eggos/inet.(*endpoint).WritePacket(0x680561e0, 0x68024cdc, 0x4, 0x3ff958, 0x4, 0x680249e8, 0x6, 0x0, 0x0, 0x300000800, ...)
/Users/aidan/dev/oss/eggos/inet/endpoint.go:89 +0x67
gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket(...)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/link/nested/nested.go:117
gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).WritePacket(0x68056230, 0x68024cdc, 0x4, 0x3ff958, 0x4, 0x680249e8, 0x6, 0x0, 0x0, 0x300000800, ...)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/link/ethernet/ethernet.go:66 +0x12d
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacket(0x680ee000, 0x68024cdc, 0x4, 0x3ff958, 0x4, 0x680249e8, 0x6, 0x0, 0x0, 0x300000800, ...)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack/nic.go:368 +0xfe
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacketBuffer(0x680ee000, 0x68024cdc, 0x4, 0x3ff958, 0x4, 0x680249e8, 0x6, 0x0, 0x0, 0x300000800, ...)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack/nic.go:314 +0xd0
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).enqueuePacketBuffer(0x680ee000, 0x6808a960, 0x800, 0x404800, 0x6808c200, 0x6805822a, 0x8, 0x8)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack/nic.go:329 +0x25d
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).WritePacket(0x680ee000, 0x6808a960, 0x800, 0x6808c200, 0x1c, 0x0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack/nic.go:307 +0x53
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket(0x6806ca00, 0x6808a960, 0x6808c200, 0x6808a900, 0x0, 0x0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/network/ipv4/ipv4.go:495 +0x375
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket(0x6806ca00, 0x6808a960, 0x4000000011, 0x6808c200, 0x0, 0x0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/network/ipv4/ipv4.go:445 +0x179
gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket(0x6808a960, 0x4000000011, 0x6808c200, 0x680b0458, 0xd2d0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack/route.go:462 +0xad
gvisor.dev/gvisor/pkg/tcpip/transport/udp.(*udpPacketInfo).send(0x6845e930, 0x405290, 0x680639e0, 0x68022340)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/udp/endpoint.go:874 +0x3f9
gvisor.dev/gvisor/pkg/tcpip/transport/udp.(*endpoint).write(0x680a4f00, 0x405290, 0x680639e0, 0x68022340, 0x0, 0x35f520, 0x1, 0x680639e0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/udp/endpoint.go:581 +0x176
gvisor.dev/gvisor/pkg/tcpip/transport/udp.(*endpoint).Write(0x680a4f00, 0x405290, 0x680639e0, 0x68022340, 0x0, 0x36c720, 0x3381e0, 0x680562d0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/udp/endpoint.go:431 +0x68
gvisor.dev/gvisor/pkg/tcpip/adapters/gonet.(*UDPConn).WriteTo(0x680562d0, 0x680cc100, 0xfa, 0xfa, 0x406f28, 0x68063860, 0x0, 0x0, 0x0)
/Users/aidan/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/adapters/gonet/gonet.go:651 +0x1eb
github.com/icexin/eggos/inet/dhcp.(*Client).Request(0x680ec090, 0x409328, 0x6804c660, 0x0, 0x0, 0x0, 0x0)
/Users/aidan/dev/oss/eggos/inet/dhcp/client.go:150 +0x5e5
github.com/icexin/eggos/inet.dodhcp(0x680249e8, 0x6, 0x6, 0x68056230)
/Users/aidan/dev/oss/eggos/inet/stack.go:87 +0x147
github.com/icexin/eggos/inet.Init()
/Users/aidan/dev/oss/eggos/inet/stack.go:50 +0x234
github.com/icexin/eggos.kernelInit()
/Users/aidan/dev/oss/eggos/eggos.go:34 +0x1dc
github.com/icexin/eggos.init.0()
/Users/aidan/dev/oss/eggos/eggos.go:38 +0x25
That nil pointer panic is from this code:
Lines 223 to 224 in 971efad
A successful run of the same kernel in qemu has different logs:
[trap] tid:2
[video] can't found video info from bootloader, video disabled
[syscall] tid:4
[pci] found 8086:100e for e1000, irq:43
[e1000] enable bus master
[e1000] mmap for bar0 0xfebc0000
[e1000] begin reset
[e1000] reset done
[e1000] link up
[e1000] begin read mac
[e1000] mac:525400123456
[inet] begin dhcp
[dhcp] offer done
[dhcp] offer ip:10.0.2.15 server:10.0.2.2
[dhcp] lease:24h0m0s
[inet] dhcp done
[inet] addr:10.0.2.15
[inet] gateway:10.0.2.2
[inet] mask:255.255.255.0
[inet] dns:10.0.2.3
hello eggos
[syscall] write(1)(0x1, 0x681a4020, 0xc, 0x20, 0xc, 0x4) = 12
I understand that this is unlikely to be enough detail for you to diagnose the problem. I am happy to try assist, but I might need some directions from you. Let me know what details you need and I will try provide them.
We already support running binaries compiled by the go test -c
command, consider adding running tests to github's action
A cool idea, just add one line import _ "github.com/icexin/eggos
, then every go application can run on bare metal.
after running phy
for seconds, panic with output:
root@eggos# phy
fatal error: stopm holding locks
runtime stack:
runtime.throw({0x7b7d92, 0x13})
/Users/fanbingxin/local/go1.17rc1/src/runtime/panic.go:1198 +0x6a
runtime.stopm()
/Users/fanbingxin/local/go1.17rc1/src/runtime/proc.go:2396 +0xe7
runtime.exitsyscall0(0x50400690)
/Users/fanbingxin/local/go1.17rc1/src/runtime/proc.go:4115 +0x17a
runtime.mcall()
/Users/fanbingxin/local/go1.17rc1/src/runtime/asm_386.s:331 +0x44
goroutine 1 [runnable]:
github.com/golang/freetype/raster.(*RGBAPainter).Paint(0x50eca570, {0x50543148, 0x3f, 0x40}, 0x0)
/Users/fanbingxin/go/pkg/mod/github.com/golang/[email protected]/raster/paint.go:127 +0x3db
github.com/golang/freetype/raster.(*Rasterizer).Rasterize(0x50542000, {0x8cf484, 0x50eca570})
/Users/fanbingxin/go/pkg/mod/github.com/golang/[email protected]/raster/raster.go:545 +0x2ae
github.com/fogleman/gg.(*Context).fill(0x5045ed20, {0x8cf484, 0x50eca570})
/Users/fanbingxin/go/pkg/mod/github.com/fogleman/[email protected]/context.go:423 +0x1da
github.com/fogleman/gg.(*Context).FillPreserve(0x5045ed20)
/Users/fanbingxin/go/pkg/mod/github.com/fogleman/[email protected]/context.go:470 +0x168
github.com/fogleman/gg.(*Context).Fill(0x5045ed20)
/Users/fanbingxin/go/pkg/mod/github.com/fogleman/[email protected]/context.go:476 +0x21
github.com/icexin/eggos/app/phy.(*Drawer).DrawCircle(0x5046a7d0, {0x0, 0x0}, 0x400722222222218e, 0x4051800000000000, {0x3f48c8c9, 0x3f52d2d3)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/phy/draw.go:58 +0x390
github.com/jakecoffman/cp.DrawShape(0x50485d80, {0x8e382c, 0x5046a7d0})
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/draw.go:42 +0x311
github.com/jakecoffman/cp.DrawSpace.func1(0x50485d80)
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/draw.go:163 +0x2f
github.com/jakecoffman/cp.(*BBTree).Each.func1({0x771dc0, 0x5055c680})
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/bbtree.go:95 +0x33
github.com/jakecoffman/cp.(*HashSet).Each(0x504515f0, 0x51193cd4)
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/hashset.go:143 +0x5b
github.com/jakecoffman/cp.(*BBTree).Each(0x50518300, 0x50e06c70)
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/bbtree.go:93 +0x4e
github.com/jakecoffman/cp.DrawSpace(0x5045ec40, {0x8e382c, 0x5046a7d0})
/Users/fanbingxin/go/pkg/mod/github.com/jakecoffman/[email protected]/draw.go:162 +0x8b
github.com/icexin/eggos/app/phy.(*Game).Draw(0x5050ae90, 0x5040f968)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/phy/game.go:119 +0x47
github.com/icexin/eggos/app/phy.main(0x50451590)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/phy/game.go:137 +0x14c
github.com/icexin/eggos/app.Run({0x5051e2b0, 0x3}, 0x50451590)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/app.go:44 +0x8c
github.com/icexin/eggos/app/sh.runApp(0x505d0000, {0x5051e2b0, 0x3}, {0x5050ae80, 0x0, 0x0}, 0x0)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/sh/sh.go:67 +0x1c3
github.com/icexin/eggos/app/sh.doline(0x505d0000, {0x5051e298, 0x3})
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/sh/sh.go:50 +0xc9
github.com/icexin/eggos/app/sh.main(0x505d0000)
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/sh/sh.go:30 +0x144
github.com/icexin/eggos/app/sh.Bootstrap()
/Users/fanbingxin/go/src/github.com/icexin/eggos/app/sh/sh.go:80 +0x1fc
main.main()
/Users/fanbingxin/go/src/github.com/icexin/eggos/kmain/main.go:48 +0x481
goroutine 6 [syscall, locked to thread]:
syscall.Syscall(0x1f4, 0x0, 0x0, 0x0)
/Users/fanbingxin/local/go1.17rc1/src/syscall/asm_linux_386.s:19 +0x5
github.com/icexin/eggos/kernel.traploop()
/Users/fanbingxin/go/src/github.com/icexin/eggos/kernel/trap.go:188 +0x11d
created by github.com/icexin/eggos/kernel.Init
/Users/fanbingxin/go/src/github.com/icexin/eggos/kernel/postinit.go:9 +0x35
goroutine 7 [runnable, locked to thread]:
syscall.Syscall(0x1f5, 0x0, 0x0, 0x0)
/Users/fanbingxin/local/go1.17rc1/src/syscall/asm_linux_386.s:19 +0x5
github.com/icexin/eggos/kernel.handleForward()
/Users/fanbingxin/go/src/github.com/icexin/eggos/kernel/syscall.go:330 +0x124
created by github.com/icexin/eggos/kernel.Init
/Users/fanbingxin/go/src/github.com/icexin/eggos/kernel/postinit.go:10 +0x4b
goroutine 8 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f8610, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f8610, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f8600, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 9 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f8650, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f8650, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f8640, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 10 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f8690, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f8690, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f8680, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 11 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f86d0, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f86d0, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f86c0, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 12 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f8710, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f8710, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f8700, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 13 [select]:
gvisor.dev/gvisor/pkg/sync.Gopark(...)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/runtime_unsafe.go:27
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).nextWaker(0x504f8750, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:181 +0x75
gvisor.dev/gvisor/pkg/sleep.(*Sleeper).Fetch(0x504f8750, 0x1)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/sleep/sleep_unsafe.go:228 +0x2a
gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*processor).start(0x504f8740, 0x504924f4)
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:97 +0x7d
created by gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*dispatcher).init
/Users/fanbingxin/go/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/transport/tcp/dispatcher.go:163 +0x142
goroutine 14 [select]:
github.com/icexin/eggos/inet/dhcp.(*Client).renewAfter.func1(0x4e94914f0000, {0x8d9ec0, 0x50451560}, 0x5047de00)
/Users/fanbingxin/go/src/github.com/icexin/eggos/inet/dhcp/client.go:260 +0xcd
created by github.com/icexin/eggos/inet/dhcp.(*Client).renewAfter
/Users/fanbingxin/go/src/github.com/icexin/eggos/inet/dhcp/client.go:257 +0xdb
goroutine 15 [syscall]:
os/signal.signal_recv()
/Users/fanbingxin/local/go1.17rc1/src/runtime/sigqueue.go:169 +0xf1
os/signal.loop()
/Users/fanbingxin/local/go1.17rc1/src/os/signal/signal_unix.go:24 +0x1a
created by os/signal.Notify.func1.1
/Users/fanbingxin/local/go1.17rc1/src/os/signal/signal.go:151 +0x2f
Great work. I'm getting compile errors with Go 1.15 though. I've also tested with Go
1.14.6 and get the same error.
../../Go/go/pkg/mod/github.com/icexin/[email protected]/sleep/commit_noasm.go:38:45: undefined: preparingG
Compiling with 1.14.1 and below works fine however so something was introduced between 1.14.1 and 1.14.6 which causes the error.
Compiling with Go 1.13 is fine up to version 1.13.6
no sight
Now we can add kernel environment variables by passing the -append
parameter to qemu, consider adding command line arguments.
this was done using the precompiled v0.4.1 binary provided in the releases section (go version -m
indicates it was built with 1.16.6).
running egg build -o kernel.elf
and then egg run kernel.elf
or running egg test
in the go project's directory returns the following error from qemu:
qemu-system-x86_64: multiboot knows VBE. we don't
Hi @icexin, @jspc and all eggos developers!
After having explored eggos, it seems the potential is great, both for developing a deeper understanding of low-level interactions between the Go runtime and the operating system, but also for developing quite unique minimal trusted code base scenarios!
I would be glad to foster a community around eggos which help connect developers and users through a shared chat communication platform.
How about we start a Discord server for eggos?
Let me know what you think. I can configure one if you wish.
Cheerful regards,
Robin
Edit: for those that wish to join, here is the invite link to join the eggos Discord chat: https://discord.gg/WBnkCUVmGN
Just like RT-Thread by C language .
There are so many OSes for Intel/Amd architecture , but few for MCU .
I think eggos can be that one .
Thanks !
Add support for WASM, it is best to support the WASI standard, so as to support programs written in c or c++ as user programs. In addition, need to add documentation on how to compile c/c++ to wasm.
Hello,
All commands from the egg executable are not working.
On the root of the cloned project, I for example, trying to run the command:
shell ./egg run
I get this following
shell package github.com/icexin/eggos imports github.com/icexin/eggos: import cycle not allowed 2021/08/31 13:42:17 error building kernel: exit status 1
I have been trying for all other commands and get the same error as well.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.