biscuit icon indicating copy to clipboard operation
biscuit copied to clipboard

boot error

Open Jack-Ji opened this issue 4 years ago • 7 comments

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

Jack-Ji avatar Aug 18 '20 01:08 Jack-Ji

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?

lixiaozhui avatar May 27 '22 05:05 lixiaozhui

您好,邮件已收到~

wuhang-du avatar May 27 '22 05:05 wuhang-du

您好,邮件已收到~

Have you received the solution?

lixiaozhui avatar May 27 '22 05:05 lixiaozhui

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

h4sh5 avatar Dec 19 '22 06:12 h4sh5

您好,邮件已收到~

wuhang-du avatar Dec 19 '22 06:12 wuhang-du

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

rutvora avatar Sep 20 '23 04:09 rutvora

您好,邮件已收到~

wuhang-du avatar Sep 20 '23 04:09 wuhang-du