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

boot error #13

Open
Jack-Ji opened this issue Aug 18, 2020 · 7 comments
Open

boot error #13

Jack-Ji opened this issue Aug 18, 2020 · 7 comments

Comments

@Jack-Ji
Copy link

Jack-Ji commented Aug 18, 2020

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.13.8 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jack/.cache/go-build"
GOENV="/home/jack/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jack/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build706439729=/tmp/go-build -gno-record-gcc-switches"

What did you do?

following instructions of README.md mostly:

  1. cd into src and build golang toolkit
  2. cd into biscuit, adjusted GOPATH, QOPTS and run make qemu CPUS=2

Here's detailed modifications:

diff --git a/biscuit/GNUmakefile b/biscuit/GNUmakefile
index bb4cae8898..15b53ace54 100644
--- a/biscuit/GNUmakefile
+++ b/biscuit/GNUmakefile
@@ -8,7 +8,7 @@ ASFLAGS := $(BASEFLAGS) -nostdlib -nostdinc -I$(TOP)
 CFLAGS := $(BASEFLAGS) -ffreestanding -nostdlib -nostdinc -fno-builtin \
        -mno-red-zone -fno-stack-protector
 CXXFLAGS := $(BASEFLAGS) -ffreestanding -nostdlib -fno-builtin -mno-red-zone
-GOPATH ?= $(shell pwd)
+GOPATH := $(shell pwd)
 # bootloader sources
 ASMS := boot.S
 CS   := bootmain.c main.c chentry.c
@@ -85,7 +85,7 @@ SKELDEPS := $(shell find $(SKEL))
 
 CPUS := $(shell echo $${CPUS:-1})
 
-QOPTS := -m 8G -smp cpus=$(CPUS) -cpu Nehalem
+QOPTS := -m 2G -smp cpus=$(CPUS) -cpu Nehalem
 # for testing bhw2's configuration
 #QOPTS := -m 8G -cpu Nehalem -smp sockets=2,cores=10,threads=2

What did you expect to see?

kernel should boot without error

What did you see instead?

SeaBIOS (version 1.13.0-1ubuntu1)


iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+7FF8C9C0+7FECC9C0 CA00
                                                                               


Booting from Hard Disk...
 LAPIC Mhz: 00000000000003E7 
 CPU Mhz: 0000000000000AF8 
 no random!
Reserved 65536 pages (256MB)
              BiscuitOS
          go version: go1.10.1
  1685 MB of physical memory
CPUID: family: 6, model: 1a
sse3 true, ssse3 true, sse41 true, sse42 true, avx false
invariant TSC not supported
bmi1 false, bmi2 false
1GB pages not supported
No hardware performance monitoring
AHCI 8086 2922 (0:4:0), bara 0xfebb1000, MSI 57
ACPI CPUs 2, found 1 APs (0 hyperthreads) across 2 packages
Joining at most 4 CPUs split between packages (no hyperthreads) on 2 packages
 cpu 0000000000000001 joined
done! 1 APs found (1 joined)
Package counts:
  0:   1
  1:   1
Using MEMORY FS
FS log length 1024, maxtrans 512
no FS recovery needed: head 82
start [bin/init []]
read too few elf bytes (program headers)
panic: exec failed -1

goroutine 1 [running]:
main.main.func2(0xc000512260, 0x8, 0x8, 0x0, 0x0, 0x0)
	/home/jack/osdev/biscuit/biscuit/src/kernel/main.go:1688 +0x668
main.main()
	/home/jack/osdev/biscuit/biscuit/src/kernel/main.go:1693 +0x38a
 exit with code 0000000000000002 .
halting
@lixiaozhui
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.13.8 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/jack/.cache/go-build" GOENV="/home/jack/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/jack/go" GOPRIVATE="" GOPROXY="https://goproxy.cn" GOROOT="/usr/lib/go-1.13" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build706439729=/tmp/go-build -gno-record-gcc-switches"

What did you do?

following instructions of README.md mostly:

  1. cd into src and build golang toolkit
  2. cd into biscuit, adjusted GOPATH, QOPTS and run make qemu CPUS=2

Here's detailed modifications:

diff --git a/biscuit/GNUmakefile b/biscuit/GNUmakefile
index bb4cae8898..15b53ace54 100644
--- a/biscuit/GNUmakefile
+++ b/biscuit/GNUmakefile
@@ -8,7 +8,7 @@ ASFLAGS := $(BASEFLAGS) -nostdlib -nostdinc -I$(TOP)
 CFLAGS := $(BASEFLAGS) -ffreestanding -nostdlib -nostdinc -fno-builtin \
        -mno-red-zone -fno-stack-protector
 CXXFLAGS := $(BASEFLAGS) -ffreestanding -nostdlib -fno-builtin -mno-red-zone
-GOPATH ?= $(shell pwd)
+GOPATH := $(shell pwd)
 # bootloader sources
 ASMS := boot.S
 CS   := bootmain.c main.c chentry.c
@@ -85,7 +85,7 @@ SKELDEPS := $(shell find $(SKEL))
 
 CPUS := $(shell echo $${CPUS:-1})
 
-QOPTS := -m 8G -smp cpus=$(CPUS) -cpu Nehalem
+QOPTS := -m 2G -smp cpus=$(CPUS) -cpu Nehalem
 # for testing bhw2's configuration
 #QOPTS := -m 8G -cpu Nehalem -smp sockets=2,cores=10,threads=2

What did you expect to see?

kernel should boot without error

What did you see instead?

SeaBIOS (version 1.13.0-1ubuntu1)


iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+7FF8C9C0+7FECC9C0 CA00
                                                                               


Booting from Hard Disk...
 LAPIC Mhz: 00000000000003E7 
 CPU Mhz: 0000000000000AF8 
 no random!
Reserved 65536 pages (256MB)
              BiscuitOS
          go version: go1.10.1
  1685 MB of physical memory
CPUID: family: 6, model: 1a
sse3 true, ssse3 true, sse41 true, sse42 true, avx false
invariant TSC not supported
bmi1 false, bmi2 false
1GB pages not supported
No hardware performance monitoring
AHCI 8086 2922 (0:4:0), bara 0xfebb1000, MSI 57
ACPI CPUs 2, found 1 APs (0 hyperthreads) across 2 packages
Joining at most 4 CPUs split between packages (no hyperthreads) on 2 packages
 cpu 0000000000000001 joined
done! 1 APs found (1 joined)
Package counts:
  0:   1
  1:   1
Using MEMORY FS
FS log length 1024, maxtrans 512
no FS recovery needed: head 82
start [bin/init []]
read too few elf bytes (program headers)
panic: exec failed -1

goroutine 1 [running]:
main.main.func2(0xc000512260, 0x8, 0x8, 0x0, 0x0, 0x0)
	/home/jack/osdev/biscuit/biscuit/src/kernel/main.go:1688 +0x668
main.main()
	/home/jack/osdev/biscuit/biscuit/src/kernel/main.go:1693 +0x38a
 exit with code 0000000000000002 .
halting

I have the same problem as you,and same error output.do you have fix?

@wuhang-du
Copy link

wuhang-du commented May 27, 2022 via email

@lixiaozhui
Copy link

您好,邮件已收到~

Have you received the solution?

@h4sh5
Copy link

h4sh5 commented Dec 19, 2022

What was the solution? Can you post it here please?

@wuhang-du
Copy link

wuhang-du commented Dec 19, 2022 via email

@rutvora
Copy link

rutvora commented Sep 20, 2023

For me, the following solution worked:
In biscuit/src/kernel/syscall.go:3314 change 512 to 1024 (or some number larger than 512). It seems that the new init executable generated is larger than 512 bytes, but the value is hardcoded in this line.
After this change, I ran make qemu CPUS=2 again and I was dropped in their shell

@wuhang-du
Copy link

wuhang-du commented Sep 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants